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 profile install mixes up package names/paths when there are conflicting files #11632

Open
Br1ght0ne opened this issue Oct 3, 2024 · 0 comments
Labels

Comments

@Br1ght0ne
Copy link
Member

Br1ght0ne commented Oct 3, 2024

Describe the bug
When trying to install a package with nix profile install that has a conflicting file with an already installed package, the error message sometimes mixes up the paths and suggests a wrong command to remove an existing package.

Steps To Reproduce

  1. nix profile install nixpkgs#jujutsu (has a jj binary)
  2. nix profile install nixpkgs#jj (also has a jj binary)
  3. See error message about conflicting files, where jj-1.9.2 is presented as "existing", and jujutsu-0.22.0 as "new", and nix profile remove jj should have been nix profile remove jujutsu:
error: An existing package already provides the following file:

         /nix/store/67yh68h0zfglrfh5411mwiwiszdwciyq-jj-1.9.2/bin/jj

       This is the conflicting file from the new package:

         /nix/store/dw9k7qnhjjdyjsj0d11ajks4fds21x40-jujutsu-0.22.0/bin/jj

       To remove the existing package:

         nix profile remove jj

       The new package can also be installed next to the existing one by assigning a different priority.
       The conflicting packages have a priority of 5.
       To prioritise the new package:

         nix profile install flake:nixpkgs#legacyPackages.aarch64-darwin.jujutsu --priority 4

       To prioritise the existing package:

         nix profile install flake:nixpkgs#legacyPackages.aarch64-darwin.jujutsu --priority 6

Expected behavior

Expected jj package to be "new", and jujutsu to be "existing".

nix-env --version output

nix-env (Nix) 2.24.9

Additional context

If the order of operations is swapped (install jj first, jujutsu second), the error message is identical (but correct in the latter case), which is wrong.

Priorities

Add 👍 to issues you find important.

@Br1ght0ne Br1ght0ne added the bug label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant