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

Regression with ~/.local/share/nix/root used as a chroot store #10331

Closed
augu5te opened this issue Mar 26, 2024 · 0 comments · Fixed by #10345
Closed

Regression with ~/.local/share/nix/root used as a chroot store #10331

augu5te opened this issue Mar 26, 2024 · 0 comments · Fixed by #10345
Assignees
Labels

Comments

@augu5te
Copy link

augu5te commented Mar 26, 2024

Describe the bug

When ~/.local/share/nix/root is used as a chroot store with nix-static, nix flake show failed

# nix flake show
path:/home/orichard/hello?lastModified=1711466600&narHash=sha256 IGkkheERaBI7UV65W3STBpbO1A79TJ4fTbzdlXRV5Zs%3D
error: path '/home/orichard/.local/share/nix/root/nix/store/fl6fyrl15ydxs1ga7k5scn4qfy72wd49-source' is not in the Nix store

Steps To Reproduce

  1. Build nix-static to simplify test on machine without nix and nix store: nix build "github:NixOS/nix/598deb2b23bc59df61c92ea25745d675686f3991#packages.x86_64-linux.nix-static"
  2. Copy result/bin/nix on machine without nix
  3. Test with simple flake.nix

Regression
nix flake show works up to 2.20.5. With git bisect, the first bad commit: [598deb2]

  Date:   Mon Feb 26 15:08:08 2024 +0100                                                    
                                                                                          
    Use SourcePath for reading flake.{nix,lock}                                           
                                                                                          
    Flakes still reside in the Nix store (so there shouldn't be any change
    in behaviour), but they are now accessed via the rootFS              
    accessor. Since rootFS implements access checks, we no longer have to                 
    worry about flake.{nix,lock} or their parents being symlinks that                     
    escape from the flake.                                                                
                                                                                          
    Extracted from the lazy-trees branch.     

@edolstra, I suppose it's related to #6530. Contrary to #6853, this issue is blocking.

Priorities

Add 👍 to issues you find important.

@augu5te augu5te added the bug label Mar 26, 2024
@edolstra edolstra self-assigned this Mar 27, 2024
edolstra added a commit to edolstra/nix that referenced this issue Mar 27, 2024
This is a temporary fix until we can pass `SourcePath`s rather than
`StorePath`s to `call-flake.nix`.

Fixes NixOS#10331.
edolstra added a commit to edolstra/nix that referenced this issue Mar 29, 2024
edolstra added a commit to edolstra/nix that referenced this issue Mar 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants