-
Notifications
You must be signed in to change notification settings - Fork 71
nix/review_shell.nix: use ignoreSingleFileOutputs whenever available #427
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: master
Are you sure you want to change the base?
Conversation
631c8aa
to
0f4ff8d
Compare
Thanks. Looks good. |
Considering that the single-file-output error is a potential way to enforce the correctness of I prepared the implementation to support @Mic92, what do you think? |
0f4ff8d
to
ec9467b
Compare
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'm not sure if it's something to do with the change in evaluation methods, but lately I'm getting a lot more file conflicts due to "test.*" being included in attrs.nix, so it would be nice to get this in.
ignoreCollisions = true; | ||
}; | ||
env = | ||
local-pkgs.buildEnv { |
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 this needs parens around the attrset update, so ignoreSingleFileOutputs
makes it into buildEnv
.
It does seem to work okay once that's changed.
@corngood Thank you for rewiewing! Do you think it's preferred to have |
My gut feeling is that it should be a default, because people often run However, you did mention this:
and I don't really understand what you mean by it. Maybe you can give an example? |
$ nix build --impure --expr "let pkgs = import ./. { }; in pkgs.buildEnv { name = ''empty-file-env''; paths = [ (pkgs.emptyFile.overrideAttrs (previousAttrs: { meta = previousAttrs.meta or { } // { outputsToInstall = [ ]; }; })) ]; }"
$ nix build --impure --expr "let pkgs = import ./. { }; in pkgs.buildEnv { name = ''empty-file-env''; paths = [ (pkgs.emptyFile.overrideAttrs (previousAttrs: { meta = removeAttrs previousAttrs.meta or { } [ ''outputsToInstall'' ]; })) ]; }"
error: builder for '/nix/store/2g6w6l2gc2inj96gji5fnaycyjc15rfb-empty-file-env.drv' failed with exit code 255;
last 1 log lines:
> error: The store path /nix/store/ij3gw72f4n5z4dz6nnzl1731p9kmjbwr-empty-file is a file and can't be merged into an environment using pkgs.buildEnv! at /nix/store/qrwjx5798fsp5yxaawrf5aklh1hp2xba-builder.pl line 115.
For full logs, run 'nix log /nix/store/2g6w6l2gc2inj96gji5fnaycyjc15rfb-empty-file-env.drv'. |
Is it the default behavior now? I thought it would be opt-in. |
It's the top level NixOS/nixpkgs#389338 (comment)
etc That one was done with github eval. Below that I posted a darwin review, which used local eval, and it didn't build anything in |
I looked into this a bit, and I think it's just the difference between local eval using I didn't realise they were so drastically different (essentially opt-in vs opt-out). |
This PR depends on NixOS/nixpkgs#353752 and fixes #408 partially.
Cc: @corngood