-
-
Notifications
You must be signed in to change notification settings - Fork 220
(WIP) feat: migrate pgrx extensions to crane build system #1974
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: update-nixpkgs
Are you sure you want to change the base?
Conversation
906fbe3 to
8f0dffb
Compare
8f0dffb to
becd92c
Compare
d95ecff to
38ead9e
Compare
95dd61a to
288b31d
Compare
4665a3f to
14906f4
Compare
b48e4c3 to
3df6c4a
Compare
14906f4 to
266a129
Compare
266a129 to
7f01b44
Compare
|
this one seems pretty important and would like to get to this one soon after nixpkgs update |
3df6c4a to
94d1c75
Compare
7f01b44 to
dc2e9f5
Compare
|
Basic crane integration works correctly ( To fix this, we need to either update the external |
This change adds [crane](https://crane.dev/) support to the existing `pgrx` extension builder, enabling better incremental build performance and caching for `pg_jsonschema` and other pgrx extensions. Crane separates dependency builds from main crate builds, allowing dependencies to be cached independently. The unified `buildPgrxExtension.nix` now accepts an optional `craneLib` parameter. When provided, it uses crane's two-phase build (`buildDepsOnly` + `buildPackage`). Otherwise, it falls back to `rustPlatform.buildRustPackage`. Both paths share the same build and install logic, avoiding code duplication. Crane requires `Cargo.lock` at the source root while `rustPlatform` accepts external `lockFile` paths. The builder handles this by ensuring external lock files are properly accessible during the build process. Crane's `cargoVendorDir` is only used for crane builds to avoid conflicts with rustPlatform's cargo handling. Extensions opt into crane builds by passing `useCrane = true` to `mkPgrxExtension`. All existing build parameters remain compatible with both backends.
dc2e9f5 to
c13e207
Compare
This change adds crane support to the existing
pgrxextension builder, enabling better incremental build performance and caching forpg_jsonschemaand other pgrx extensions. Crane separates dependency builds from main crate builds, allowing dependencies to be cached independently.The unified
buildPgrxExtension.nixnow accepts an optionalcraneLibparameter. When provided, it uses crane's two-phase build (buildDepsOnly+buildPackage). Otherwise, it falls back torustPlatform.buildRustPackage. Both paths share the same build and install logic, avoiding code duplication.Crane requires
Cargo.lockat the source root whilerustPlatformaccepts externallockFilepaths. The builder handles this by ensuring external lock files are properly accessible during the build process. Crane'scargoVendorDiris only used for crane builds to avoid conflicts with rustPlatform's cargo handling.Extensions opt into crane builds by passing
useCrane = truetomkPgrxExtension. All existing build parameters remain compatible with both backends.