Skip to content

nix shell fails if a derivation output is a symlink #10375

@xworld21

Description

@xworld21

Describe the bug
With nix 2.20 and 2.21, nix shell refuses to work if a derivation output is a symlink to another directory. It seems to trigger an assert that the output must not be a symbolic link.

Originally reported here NixOS/nixpkgs#296751 (comment).

@SuperSandro2000 points out this is probably related to #9882.

Steps To Reproduce
Run nix shell nixpkgs#texliveInfraOnly:

error: path '/nix/store/78kh795l7d9apmap4y7hwpmm238dgc6g-texlive-2023-env-man' is a symlink

The man output is just a symlink to a different buildEnv derivation.

Expected behavior
Derivations outputs which are symlinks to other directories should just work, as they did in nix 2.19 and earlier.

nix --version output

nix (Nix) 2.21.0

Additional context
TeX Live uses the split output because the man page folders contain PDFs, are not compressed, and link to the rest of the 'doc' container which can be quite large.

I can easily work around this issue by making the outputs just folders containing symlinks, instead of symlinks themselves.

Priorities

Add 👍 to issues you find important.

Metadata

Metadata

Assignees

Labels

bugregressionSomething doesn't work anymore

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions