-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
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
replaceDependency can't be used in pure evaluation mode #199162
Labels
0.kind: bug
Something is broken
Comments
Okay, I tested it with a different derivation and |
7 tasks
12 tasks
alois31
added a commit
to alois31/nixpkgs
that referenced
this issue
Jan 27, 2024
Rewrite replaceDependency so that it can apply multiple replacements in one go. This includes correctly handling the case where one of the replacements itself needs to have another replacement applied as well. This rewritten function is now aptly called replaceDependencies. For compatibility, replaceDependency is retained as a simple wrapper over replaceDependencies. It will cause a rebuild because the unpatched dependency is now referenced by derivation instead of by storePath, but the functionality is equivalent. Fixes: NixOS#199162
alois31
added a commit
to alois31/nixpkgs
that referenced
this issue
Feb 27, 2024
Rewrite replaceDependency so that it can apply multiple replacements in one go. This includes correctly handling the case where one of the replacements itself needs to have another replacement applied as well. This rewritten function is now aptly called replaceDependencies. For compatibility, replaceDependency is retained as a simple wrapper over replaceDependencies. It will cause a rebuild because the unpatched dependency is now referenced by derivation instead of by storePath, but the functionality is equivalent. Fixes: NixOS#199162
Any update? Right now replaceDependency is completely unusable if using flakes unless using --impure. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As noticed by @yu-re-ka, trying to use
pkgs.replaceDependency
(orsystem.replaceRuntimeDependencies
in NixOS) in pure evaluation mode results in an error becausebuiltins.storePath
is used.From looking at the source, I couldn't figure out why we need
storePath
at all. It seems like manipulating context-discarded strings would be enough?However I'm having trouble testing this because for some reason my
system.build.toplevel.outPath
is something like/0apn2h3i9xvwfaac83238x97plr9dsn33pxlj7f5mdblc7f6bg9i
(which looks like the sort of string thatbuiltins.placeholder
produces) instead of an actual store path, so I just get a warning that the placeholder does not depend on$oldDependency
. Any idea what's going on here?ping @shlevy @roconnor
The text was updated successfully, but these errors were encountered: