Skip to content

Conversation

@juliankuners
Copy link
Contributor

When installing a nix derivation into a profile, the entire content of that output is placed into a profile directory. This currently included the generated kdist directories like, e.g., wasm-semantics, evm-semantics, etc.

Due to this, nix will fail to install a derivation if another installed derivation provides conflicting files. This can happen, e.g., when installing both komet and skribe. Nix will then throw an error like this:

$ kup install komet
 ⌛ Building 'komet' ...
warning: skipping dangling symlink '/tmp/nix-99859-0/lib/scripts'
error: An existing package already provides the following file:

         /nix/store/y3m4pakz9gxj7dp985y64karrvr8i81a-komet-42d24e605352a81523ca7ac67b782e210406d470/wasm-semantics/source/wasm-semantics/test.md

       This is the conflicting file from the new package:

         /nix/store/5vzw3cmnyk1k4d1sqhfyi11ws6ikrxx3-skribe-abfe4c931103a9de2c32526ff61966cc16734563/wasm-semantics/source/wasm-semantics/test.md

       To remove the existing package:

         nix profile remove komet

       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 github:runtimeverification/skribe/abfe4c931103a9de2c32526ff61966cc16734563?narHash=sha256-DnzUrJu4hjwHjMbO1HlzPlPGvDGmOn%2BHcR3FMQjoL40%3D#packages.x86_64-linux.skribe --priority 4

       To prioritise the existing package:

         nix profile install github:runtimeverification/skribe/abfe4c931103a9de2c32526ff61966cc16734563?narHash=sha256-DnzUrJu4hjwHjMbO1HlzPlPGvDGmOn%2BHcR3FMQjoL40%3D#packages.x86_64-linux.skribe --priority 6
Command '['nix', 'profile', 'install', 'github:runtimeverification/komet/42d24e605352a81523ca7ac67b782e210406d470?narHash=sha256-ad1PBpVWh6Kc6Nqm095ULCiD3ES0EuTBUeTEDbP8SBY%3D#packages.x86_64-linux.komet', '--extra-experimental-features', 'nix-command flakes']' returned non-zero exit status 1.

❗ The operation could not be completed.
   See the error output above (try re-running this command with '--verbose' for more detailed logs) .

This PR fixes this by placing the kdist files in a separate nix derivation output out. The binaries are placed in output bin. This is properly following nix conventions of multiple-output derivations.

A PR like this should be created in every RV nix repository, respectively. Though this already resolves every conflict between skribe and another RV nix-packaged tool.

Copy link
Member

@bbyalcinkaya bbyalcinkaya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally with kup. The fix works as expected and resolves the conflict.

@automergerpr-permission-manager automergerpr-permission-manager bot merged commit 4f1923d into master Dec 17, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants