-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
nix-shell creates invalid store paths which is inconsitent with nix-build behavior #5132
Comments
This is expected behaviour. You can't create valid paths with (However, if you really want to, there is the undocumented command |
Ah perfect. This is exactly the sub-command I was looking for yesterday. Thanks for the very quick answer. I understand indeed the concept that it may have been explicitly designed that way. However, I was Just for my own understanding and maybe that of others: Could there also be others undocumented feature with nix-build to allow incremental builds?
|
I suppose this issue can be closed ... please re-open otherwise. |
had the same error. sudo reboot fixed it. |
When I use
nix-shell
to debug a package, it creates an invalid path in the store whichcouldn't / wouldn't be reused when I perform subsequent
nix-build
. Here is a very simpleexample of the problem:
The build is successful and installed in
/nix/store/w08118q0kp26qdcz5cdl2rx6chghawam-hello-2.9/bin/hello
store path.I then validate the store path with the following command:
resulting in:
Now, I try to use the exact same command, but with nix-build.
Again, the build is successful and installed in
/nix/store/w08118q0kp26qdcz5cdl2rx6chghawam-hello-2.9/bin/hello
store path.Performing yet again the store path validation
now, everything seems fine (no stderr).
Note that also that I would have assumed that as the path
/nix/store/w08118q0kp26qdcz5cdl2rx6chghawam-hello-2.9
was already in the store, it should have beenused by the
nix-build
command instead of restarting from scratch.Is there something I do not understand there? Is there some other command to perform after
genericBuild
to register the path with the nix store?To have this kind of workflow available would be of great help when you want to quickly experiment
on the sources of a package iteratively using the incremental build capability of
nix-shell
and oncesatisfied, test the integration of this expression in a the system as a whole using
nix-build
in combination withmyEnvFun
without a whole restart of the package you just compiled minutes ago.I know this kind of workflow may be reproduced in some way using only
myEnvFun
but then:myEnvFun
target the development on a single package.system configuration. Lead to stuff like
cabal configure --enable-shared --enable-executable-dynamic --allow-newer
.are able to interact with it. This may imply setting some LD paths, changing PATH
, registering a library to the compiler, etc... In other words, all of the stuff that comes
for free using
nix-shell
's generic phases.The text was updated successfully, but these errors were encountered: