agenix fails to build when Lix overlay is used #274

Closed
opened 2024-05-06 19:47:16 +00:00 by mjm · 9 comments

Describe the bug

agenix doesn't seem to be able to build against Lix, though it was working with Nix 2.18.2.

Build log:

warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/l5wi6vkmi83abx6rqcizayn26xcrh8bj-agenix-0.15.0.drv^*'
@nix { "action": "setPhase", "phase": "patchPhase" }
Running phase: patchPhase
@nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" }
Running phase: updateAutotoolsGnuConfigScriptsPhase
@nix { "action": "setPhase", "phase": "configurePhase" }
Running phase: configurePhase
no configure script, doing nothing
@nix { "action": "setPhase", "phase": "buildPhase" }
Running phase: buildPhase
no Makefile or custom buildPhase, doing nothing
@nix { "action": "setPhase", "phase": "installPhase" }
Running phase: installPhase
@nix { "action": "setPhase", "phase": "fixupPhase" }
Running phase: fixupPhase
shrinking RPATHs of ELF executables and libraries in /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0
checking for references to /build/ in /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0...
patching script interpreter paths in /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0
/nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0/bin/agenix: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/h3bhzvz9ipglcybbcvkxvm4vg9lwvqg4-bash-5.2p26/>
stripping (with command strip and flags -S -p) in  /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0/bin
@nix { "action": "setPhase", "phase": "installCheckPhase" }
Running phase: installCheckPhase
no Makefile or custom installCheckPhase, doing nothing
agenix version: 0.15.0
warning: '/nix/var/nix' does not exist, so Nix will use '/build/tmp.9ZNhGXBeJF/.local/share/nix/root' as a chroot store
error: creating directory '/nix/var': Permission denied
There is no rule for secret1.age in ./secrets.nix.
/nix/store/558iw5j1bk7z6wrg8cp96q2rx03jqj1v-stdenv-linux/setup: line 138: test: =: unary operator expected
/nix/store/558iw5j1bk7z6wrg8cp96q2rx03jqj1v-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context

agenix depends on nix, so the overlay set up by the NixOS module is causing it to build against Lix. I'm not exactly sure how this is causing this particular issue in its install check.

I can probably work around this by either making sure agenix builds with Nix instead of Lix, or by disabling the install check phase.

Steps To Reproduce

  1. Pull in the NixOS module overlay
  2. Include pkgs.callPackage "${agenix}/pkgs/agenix.nix" { } in the system's packages somehow
  3. Build the system

Expected behavior

agenix builds without errors

nix --version output

nix (Nix) 2.18.2

These systems haven't been able to build a version with Lix yet because of this failure.

Additional context

I think this is sandboxing related somehow, as it doesn't fail on Darwin, only Linux.

## Describe the bug agenix doesn't seem to be able to build against Lix, though it was working with Nix 2.18.2. Build log: ``` warning: The interpretation of store paths arguments ending in `.drv` recently changed. If this command is now failing try again with '/nix/store/l5wi6vkmi83abx6rqcizayn26xcrh8bj-agenix-0.15.0.drv^*' @nix { "action": "setPhase", "phase": "patchPhase" } Running phase: patchPhase @nix { "action": "setPhase", "phase": "updateAutotoolsGnuConfigScriptsPhase" } Running phase: updateAutotoolsGnuConfigScriptsPhase @nix { "action": "setPhase", "phase": "configurePhase" } Running phase: configurePhase no configure script, doing nothing @nix { "action": "setPhase", "phase": "buildPhase" } Running phase: buildPhase no Makefile or custom buildPhase, doing nothing @nix { "action": "setPhase", "phase": "installPhase" } Running phase: installPhase @nix { "action": "setPhase", "phase": "fixupPhase" } Running phase: fixupPhase shrinking RPATHs of ELF executables and libraries in /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0 checking for references to /build/ in /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0... patching script interpreter paths in /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0 /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0/bin/agenix: interpreter directive changed from "#!/usr/bin/env bash" to "/nix/store/h3bhzvz9ipglcybbcvkxvm4vg9lwvqg4-bash-5.2p26/> stripping (with command strip and flags -S -p) in /nix/store/h49ssc6dqlr7lppp4bwnblzvibq3qdin-agenix-0.15.0/bin @nix { "action": "setPhase", "phase": "installCheckPhase" } Running phase: installCheckPhase no Makefile or custom installCheckPhase, doing nothing agenix version: 0.15.0 warning: '/nix/var/nix' does not exist, so Nix will use '/build/tmp.9ZNhGXBeJF/.local/share/nix/root' as a chroot store error: creating directory '/nix/var': Permission denied There is no rule for secret1.age in ./secrets.nix. /nix/store/558iw5j1bk7z6wrg8cp96q2rx03jqj1v-stdenv-linux/setup: line 138: test: =: unary operator expected /nix/store/558iw5j1bk7z6wrg8cp96q2rx03jqj1v-stdenv-linux/setup: line 131: pop_var_context: head of shell_variables not a function context ``` agenix depends on `nix`, so the overlay set up by the NixOS module is causing it to build against Lix. I'm not exactly sure how this is causing this particular issue in its install check. I can probably work around this by either making sure agenix builds with Nix instead of Lix, or by disabling the install check phase. ## Steps To Reproduce 1. Pull in the [NixOS module overlay](https://git.lix.systems/lix-project/nixos-module/src/branch/main/overlay.nix) 2. Include `pkgs.callPackage "${agenix}/pkgs/agenix.nix" { }` in the system's packages somehow 3. Build the system ## Expected behavior agenix builds without errors ## `nix --version` output ``` nix (Nix) 2.18.2 ``` These systems haven't been able to build a version with Lix yet because of this failure. ## Additional context I think this is sandboxing related somehow, as it doesn't fail on Darwin, only Linux.
mjm added the
bug
label 2024-05-06 19:47:16 +00:00
Owner

well, inserting an echo in agenix.sh makes it work, somehow, so thats where we're at

well, inserting an echo in `agenix.sh` makes it work, somehow, so thats where we're at
Owner

im pretty sure its not sandbox related, just because building agenix with Lix is not a problem, only building agenix with Lix as its Nix dependency

im pretty sure its not sandbox related, just because building agenix *with* Lix is not a problem, only building agenix with Lix as its Nix dependency
Owner

hmmmm, this might be the profile v3 changes. will try with 076dfd30c6 reverted

hmmmm, this might be the profile v3 changes. will try with 076dfd30c6167cfb8f5003a36baef4438f687782 reverted
qyriad added the
Downstream Dependents
label 2024-05-07 00:32:42 +00:00
Owner

Bisected to b247ef72dc, cc @artemist

Bisected to b247ef72dc7bcc857288c0ddcceb3e42f76a78f1, cc @artemist
Owner

Seems like a previously ignored exception is now being propagated

Seems like a previously ignored exception is now being propagated
Owner

actually no, it seems like chroot stores aren't getting stateDir set properly

actually no, it seems like chroot stores aren't getting `stateDir` set properly
Owner

Found it. Fix underway.

Found it. Fix underway.
Author

That's awesome! In the meantime, I worked around it by doing this instead:

pkgs.callPackage "${agenix}/pkgs/agenix.nix" {
  nix = pkgs.nixVersions.nix_2_18_upstream;
}
That's awesome! In the meantime, I worked around it by doing this instead: ```nix pkgs.callPackage "${agenix}/pkgs/agenix.nix" { nix = pkgs.nixVersions.nix_2_18_upstream; } ```
Owner

you should also be to workaround it with agenix.overrideAttrs { doInstallCheck = false; } — its just the tests in the derivation's sandbox executing Lix that are failing

you should also be to workaround it with `agenix.overrideAttrs { doInstallCheck = false; }` — its just the tests in the derivation's sandbox executing Lix that are failing
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
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/lix#274
No description provided.