Skip to content
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

--store doesn't work as expected #4183

Open
zimbatm opened this issue Oct 24, 2020 · 5 comments
Open

--store doesn't work as expected #4183

zimbatm opened this issue Oct 24, 2020 · 5 comments

Comments

@zimbatm
Copy link
Member

zimbatm commented Oct 24, 2020

Describe the bug

I don't fully understand the bug yet. When running nix with --store /tmp/foo, things stop working as expected.

Steps To Reproduce

It looks like tools such as builtins.fetchurl return the path to the actual file.

$ nix repl --store /tmp/foo
Welcome to Nix version 3.0pre20200829_f156513. Type :? for help.

nix-repl> builtins.fetchurl "channel:nixos-20.09"
"/tmp/foo/nix/store/nhfagljcxr3idc168k9kfx2w0d5awc5k-nixexprs.tar.xz"

This can lead to issues like this (TODO: include repro):

$ nix develop --store /tmp/foo
error: --- BadStorePath ------------------------------------------------------------------------------------------------------------------- nix
path '/tmp/foo/nix/store/79vpr8pvcf8wlcpjhnsiq2w9nk6467nv-source' is not in the Nix store

Or like this:

$ nix run --store /tmp/foo nixpkgs#hello
error: --- InvalidPath -------------------------------------------------------------------------------------------------------------------- nix
path '/nix/store/5d9nr13b80zlvjwsz9qxx0qq53b8vgzm-nix-3.0pre20200829_f156513' is not valid

Expected behavior

I would expect Nix to bind-mount /tmp/foo/nix to /nix in a user namespace and have all the inherited processed see it the same way.

nix-env --version output
nix-env (Nix) 3.0pre20200829_f156513

@zimbatm zimbatm added the bug label Oct 24, 2020
@xaverdh
Copy link

xaverdh commented Oct 25, 2020

see #4081

@edolstra edolstra added improvement and removed bug labels Oct 26, 2020
@edolstra
Copy link
Member

This works for me:

$ nix run --store /tmp/foo nixpkgs#hello
Hello, world!

@xaverdh
Copy link

xaverdh commented Oct 26, 2020

ah it works from latest master

@xaverdh
Copy link

xaverdh commented Oct 26, 2020

according to my bisect, this was indeed fixed with d9a8619
edit: but that still leaves the issue #4081 linked here; something like it still happens even on recent master

@stale
Copy link

stale bot commented Jun 2, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the stale label Jun 2, 2021
@stale stale bot removed the stale label Dec 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants