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

nix why-depends --derivation does not understand that a derivation can depend on a source #8051

Open
roberth opened this issue Mar 15, 2023 · 2 comments
Assignees
Labels
bug new-cli Relating to the "nix" command

Comments

@roberth
Copy link
Member

roberth commented Mar 15, 2023

Describe the bug

When the second path of why-depends is not an output but a source, the command fails.

Note that source-ness of a path is not an intrinsic property, highlighting that --derivation makes the why-depends logic trickier than strictly necessary.

Steps To Reproduce

Construed example. Not a lot of

Open nix repl . in nixpkgs.

nix-repl> :lf nix
Added 15 variables.

nix-repl> let pkg = packages.x86_64-linux.default; in "nix why-depends --derivation ${pkg.drvPath} ${pkg.src}"
"nix why-depends --derivation /nix/store/6955rml5885mskbq7xzqnv6bg4c796i7-nix-2.15.0pre20230314_9ec1a3a.drv /nix/store/ny8qz9mlx58g3mm2zxlmmzmxxfvakhw9-source"

nix-repl> :q

$ nix why-depends --derivation /nix/store/6955rml5885mskbq7xzqnv6bg4c796i7-nix-2.15.0pre20230314_9ec1a3a.drv /nix/store/ny8qz9mlx58g3mm2zxlmmzmxxfvakhw9-source
error: '/nix/store/ny8qz9mlx58g3mm2zxlmmzmxxfvakhw9-source' does not have a known deriver

Expected behavior

Do not look for a deriver of a source; just report the chain. --derivation is on the way out, so this issue is mostly to document this specific use case.

nix-env --version output

Additional context

Add any other context about the problem here.

Priorities

Add 👍 to issues you find important.

@SuperSandro2000
Copy link
Member

path-info has similar problems:

 ➜ nix path-info --json --derivation --extra-experimental-features "nix-command flakes" /nix/var/nix/profiles/system-123-link/
error: '/nix/store/60xn4zmr9fj87gfh18p0xkwj9fkrr7cx-nixos-system-host-23.11' does not have a known deriver

@Ericson2314
Copy link
Member

#8594 the solution is around the corner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug new-cli Relating to the "nix" command
Projects
None yet
Development

No branches or pull requests

3 participants