-
Notifications
You must be signed in to change notification settings - Fork 137
fix compatibility with Nix 2.32+ show-derivation output #346
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
Conversation
x10an14
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.
LGTM!
|
Well I can't merge anymore apparently, but please, @rvem ? @PhilTaken ? anybody |
Rutherther
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.
Changes from this PR will break usage for people using nix store at different location than the default one.
| let new_deriver = &if data.supports_flakes || data.deploy_data.merged_settings.remote_build.unwrap_or(false) { | ||
| // Nix 2.32+ returns relative paths (without /nix/store/ prefix) in show-derivation output | ||
| // Normalize to always use full store paths | ||
| let deriver = if deriver_key.starts_with("/nix/store/") { |
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.
I think a check for just '/' would be better. That way people using nix store at different locations will also be able to use this.
| let deriver = if deriver_key.starts_with("/nix/store/") { | ||
| deriver_key.to_string() | ||
| } else { | ||
| format!("/nix/store/{}", deriver_key) |
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.
This doesn't allow locations for nix store other than /nix/store. One solution would be to look at $NIX_STORE_DIR env var for location of the store and prepend that, only defaulting to /nix/store. Another would be to utilize the output of nix eval --expr builtins.storeDir.
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.
Ah, the command is definitely better, because this can also be configured in nix.conf - https://nix.dev/manual/nix/2.32/command-ref/conf-file.html#conf-store
serokell#346 fixes compatibility with Nix 2.32+ but as stated in [1] it doesn't allow locations for nix store other than /nix/store. This patch calls nix eval to retreive the storeDir not relying one the hard-coded value. [1] serokell#346 (comment)
serokell#346 fixes compatibility with Nix 2.32+ but as stated in [1] it doesn't allow locations for nix store other than /nix/store. This patch calls nix eval to retreive the storeDir not relying one the hard-coded value. [1] serokell#346 (comment)
Fixes #340