You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Firstly I think this is a different issue from the one stated here: #5587 - that one says it only allows duplicates for identical everything, i.e. identical bash binaries all of which have the same path in the nix-store.
Here, I encountered that we can have conflicting binary names even for non-identical packages but in a slightly less straight-forward setup. The conflicting binaries should have a non-current priority and then they are silently allowed to exist as the non-current priority (i.e lower priorities) don't make it to the bin/ of the current profile.
install a pkg, say jq from any one of the flake alias above:
nix profile install foo0#jq
That'll be installed with a default priority (of 5 currently). Installing another version will conflict unless you give a different priority. However I can give the exact same priority for all others as long as it's other than the currently chosen priority (5) for the pkg:
This is not great as priority 6 doesn't have a jq that can be unambiguously chosen. This problem will manifest much later when I decide to uninstall the currently chosen priority for jq (5). Check output of current profile's manifest.json to get the index position of jq with priority 5. Say that's position 3 (verify via nix profile list but that's not going to give you the priority (as of writing this), so you need to check manifest.json anyway).
nix profile remove 3 # <<<<<<<<<<<<<< FAILS
removing 'flake:my3#legacyPackages.aarch64-linux.jq'
error: Unable to build profile. There is a conflict for the following files:
/nix/store/1gakxx73xxza318d4rypjnpxacqf5gya-jq-1.6-man/share/man/man1/jq.1.gz
/nix/store/glvdkn0gwmvhry67ic4sza18js0xbfc0-jq-1.6-man/share/man/man1/jq.1.gz
I suppose it fails because it can't decide which of the jq binaries to choose for the putting into the new profile-version's bin/ dir (and correctly so)
Expected behavior
If more than 1 binary with the same name are competing for the same priority, nix profile install <...> --priority <n> should fail instead of silently passing and the problem manifesting much later at other points (such as on nix profile remove <n> above.
ustulation
changed the title
nix allows duplicate duplicate binaries even for different packages under certain conditions
nix allows duplicate binaries even for different packages under certain conditions
Jan 18, 2024
The expected behavior describes conflicting on name. This sometimes leads to possible issues where 2 different packages are named the same unintentionally. For instance:
Describe the bug
Firstly I think this is a different issue from the one stated here: #5587 - that one says it only allows duplicates for identical everything, i.e. identical bash binaries all of which have the same path in the nix-store.
Here, I encountered that we can have conflicting binary names even for non-identical packages but in a slightly less straight-forward setup. The conflicting binaries should have a non-current priority and then they are silently allowed to exist as the non-current priority (i.e lower priorities) don't make it to the
bin/
of the current profile.Steps To Reproduce
jq
from any one of the flake alias above:5
currently). Installing another version will conflict unless you give a different priority. However I can give the exact same priority for all others as long as it's other than the currently chosen priority (5
) for the pkg:jq
that can be unambiguously chosen. This problem will manifest much later when I decide to uninstall the currently chosen priority forjq
(5
). Check output of current profile'smanifest.json
to get the index position ofjq
with priority5
. Say that's position3
(verify vianix profile list
but that's not going to give you the priority (as of writing this), so you need to checkmanifest.json
anyway).jq
binaries to choose for the putting into the new profile-version'sbin/
dir (and correctly so)Expected behavior
If more than 1 binary with the same name are competing for the same priority,
nix profile install <...> --priority <n>
should fail instead of silently passing and the problem manifesting much later at other points (such as onnix profile remove <n>
above.nix-env --version
output2.19.2
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: