-
-
Notifications
You must be signed in to change notification settings - Fork 221
fix(nix): use the same postgresql inside switch-ext-version #1990
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: develop
Are you sure you want to change the base?
Conversation
currently, `switch-ext-version` uses `nixpkgs.postgresql`, instead of the `postgresql` chosen from outside.
WalkthroughA new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (3)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
nix/packages/postgres.nix (1)
144-150: Good refactoring; note partial duplication remains.The introduction of the
postgres-pkgsbinding eliminates redundant computation withinmakePostgresBin. However,makeOurPostgresPkgsSet(line 117) still independently callsmakeOurPostgresPkgs, so the full extension set is computed twice: once inmakePostgresBinand once inmakeOurPostgresPkgsSet(invoked frommakePostgresat line 173).This partial duplication is not a critical issue but could be optimized in a future refactor.
📜 Review details
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
nix/packages/postgres.nix
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: pg_net - Postgres 17 (aarch64-darwin)
- GitHub Check: pg_partman - Postgres orioledb-17 (aarch64-darwin)
- GitHub Check: plpgsql_check - Postgres 17 (aarch64-darwin)
- GitHub Check: pg_cron - Postgres 17 (aarch64-darwin)
- GitHub Check: pg_partman - Postgres 17 (aarch64-darwin)
- GitHub Check: no packages to build (aarch64-linux)
🔇 Additional comments (2)
nix/packages/postgres.nix (2)
111-111: LGTM!The change from
pkgs.callPackagetoextCallPackagecorrectly applies the fix to all extensions, ensuring they receive the correctpostgresqlversion in their build environment.
105-109: Fix correctly uses recursive let binding to inject correct postgresql version.The pattern is valid and commonly used in Nix—let bindings are lazy, allowing recursive references.
callPackageWithinjects the correctpostgresqlversion into all extension modules' scope, resolving the original issue where switch-ext-version was using the nixpkgs default instead of the selected version. The mechanism works because when each extension is loaded,extCallPackageis already bound in the scope.
samrose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@o-santi thank you for this great work and analysis you did that led to these changes. We'll run some e2e tests on it, document on this PR and merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not actually asking for changes yet, but when I trigger a rebuild of wrappers package seems to nearly crash my computer. Just wanting to investigate that aspect before merge, since these changes don't trigger a full rebuild of rust extensions, and we need to make sure our CI can rebuild in a fault tolerant way. Update see comment below #1990 (review)
samrose
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restoring approval but we'll just document e2e test here prior to merge
|
Will run the smoke tests on this branch and report back |
|
The engine smoke scenario across the 15 17 17-oriole matrix which runs all the SQL tests in nix/tests passed |
|
Waiting on the upgrade smoke scenario results, will report back in about an hour when it's done for 15->17 and 17->17 |
|
All good |
What kind of change does this PR introduce?
Currently,
switch-ext-versionusesnixpkgs.postgresql, instead of thepostgresqlchosen insidenix/packages/postgres.nix.To test for this, we can add
builtins.trace postgresql.drvPathinsidenix/packages/switch-ext-version.nix:What is the current behavior?
postgresqlhas version 15.14, even though we chosepsql_17.What is the new behavior?
Correct one is chosen.
Additional context
There are more stuff that I'd like to propose to change. For instance, there are IFDs for
Cargo.lockthat I believe would be pretty simple to change.Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.