-
-
Notifications
You must be signed in to change notification settings - Fork 13.9k
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
ociTools.buildContainer erroring with "path [foo] is not in the Nix store" #316652
Comments
Thanks for pinning, but I haven't worked on
Cc: @SomeoneSerge (who might also be interested) |
I cannot reproduce this issue on my laptop. Reproducer:
$ nix-build --no-out-link /nix/store/hcw309zyix75sym0mhz8hn2kfi8kx4sw-join.drv |
I... am not sure what's going on. I stopped my nix adventure when I was still deeply confused by numerous similar-but-different concepts despite completing multiple tutorials and spending several days practicing. As such, I don't know what nix-build is doing, or how it's related to default.nix or the repl output in the examples above. I would love to help if I could do so in any way, though. (I'm even willing to go through another tutorial, if anyone has a good one handy.) |
Update: I tried using an inlined version of @tomfitzhenry's reproducer and saw the same error.
Something is wrong, but I wonder why the two reproducers would behave differently. |
Looks like it's due to the writeReferencesToFile -> writeClosure change in e9fd438 . I'll continue applying my non-nix-specific skills to try to debug further... |
This is probably obvious for others, but:
And converts it to the file
writeClosure uses (I guess I'm taking notes here in this comment) |
I'm sorry for any trouble the change might cause. I was the author of this change. The corresponding PR is #178717.
It took me quite some time to understand when working on the writeReferencesToFile -> writeClosure refactoring. To simplify things, |
One thing I don't understand is why we get the "x is not in the Nix store" error when x is an actual file under /nix/store. As for buildContainer, are we sure we want to be parsing I think we need a separate "dependencies" parameter where |
It turns out that the samples ( |
I think it's a bug in the structured Legacy interface,
|
The upstream seems to have noticed this. For details, see NixOS/nix#10549 and NixOS/nix#10565. |
Ahh great catch! Thanks. I still think it will be a good idea to have a dedicated "dependencies" or "copyToRoot" field for this, given args is a command array. |
Describe the bug
pkgs.ociTools.buildContainer
is failing with errors such aserror: path '/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash' is not in the Nix store
.This example in the documentation ( https://nixos.org/manual/nixpkgs/unstable/#ssec-pkgs-ociTools-buildContainer-examples ) fails in this way, as well as when I try to integrate this into my NixOS configuration.
Steps To Reproduce
Follow https://nixos.org/manual/nixpkgs/unstable/#ssec-pkgs-ociTools-buildContainer-examples , e.g.
Expected behavior
I expected an OCI image to be built.
Notify maintainers
@ShamrockLee @aib
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: