shortRev or dirtyShortRev attribute missing using npins #84

Open
opened 2026-01-19 12:01:51 +00:00 by leana8959 · 0 comments

When using flake-compat in combination with npins, the following error would occur if pinned source uses shortRev or dirtyShortRev attributes in any expression.

I made a repo to reproduce this error https://codeberg.org/leana8959/dirtyRevReproDownstream.

This problem doesn't not happen when using flake-compat within flakes. I'm not sure if this is a bug in flake-compat or npins.

error:
       … while evaluating an expression to select 'drvPath' on it
         at «internal»:1:552:
       … while evaluating strict
         at «internal»:1:552:
       (stack trace truncated; use '--show-trace' to show the full trace)

       error: attribute 'dirtyShortRev' missing
       at /nix/store/nz5ngxqaxvs1izrlh9vsgxi879pf45py-source/flake.nix:16:40:
           15|         pkgs.runCommandLocal "dirtyRev" { } ''
           16|           echo ${self.shortRev or self.dirtyShortRev} > $out
             |                                        ^
           17|         '';

To trigger this error, run the following command within the aforementioned repo after cloning it:

# The flake version, works
nix build .#test

# The npins version, doesn't work
# It is an evaluation error, before any building can even happen.
nix-build -A test

Thank you for your time :)

When using flake-compat in combination with npins, the following error would occur if pinned source uses shortRev or dirtyShortRev attributes in any expression. I made a repo to reproduce this error https://codeberg.org/leana8959/dirtyRevReproDownstream. This problem doesn't not happen when using flake-compat within flakes. I'm not sure if this is a bug in flake-compat or npins. ``` error: … while evaluating an expression to select 'drvPath' on it at «internal»:1:552: … while evaluating strict at «internal»:1:552: (stack trace truncated; use '--show-trace' to show the full trace) error: attribute 'dirtyShortRev' missing at /nix/store/nz5ngxqaxvs1izrlh9vsgxi879pf45py-source/flake.nix:16:40: 15| pkgs.runCommandLocal "dirtyRev" { } '' 16| echo ${self.shortRev or self.dirtyShortRev} > $out | ^ 17| ''; ``` To trigger this error, run the following command within the aforementioned repo after cloning it: ```bash # The flake version, works nix build .#test # The npins version, doesn't work # It is an evaluation error, before any building can even happen. nix-build -A test ``` Thank you for your time :)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lix-project/flake-compat#84
No description provided.