allowSubstitutes causing a derivation to fail to build is not exposed to the user #484

Closed
opened 2024-08-22 23:30:09 +00:00 by jade · 1 comment
Owner

A large amount of everyone's time was wasted debugging why a derivation was not substituting and was simply failing to build: https://matrix.to/#/!9IQChSjwSHXPPWTa:lix.systems/$IFHqKIPVzrnA-fGKiAWKE0QTCkcJ1WWqeU1DLKqr3F8?via=lix.systems&via=matrix.org&via=catgirl.cloud

building of '/nix/store/7s3fi53i1659dack0xp6ca8kmcs435ia-nixpkgs-patched.drv^out' from .drv file: goal destroyed
error:
       … while calling the 'head' builtin
         at /mnt/nix/store/1nf4pp7gw1zsc44j1pq7wn8kznsmx6pn-source/lib/attrsets.nix:1575:11:
         1574|         || pred here (elemAt values 1) (head values) then
         1575|           head values
             |           ^
         1576|         else

       … while evaluating the attribute 'value'
         at /mnt/nix/store/1nf4pp7gw1zsc44j1pq7wn8kznsmx6pn-source/lib/modules.nix:821:9:
          820|     in warnDeprecation opt //
          821|       { value = addErrorContext "while evaluating the option `${showOption loc}':" value;
             |         ^
          822|         inherit (res.defsFinal') highestPrio;

       (stack trace truncated; use '--show-trace' to show the full trace)

       error: a 'x86_64-linux' with features {} is required to build '/nix/store/7s3fi53i1659dack0xp6ca8kmcs435ia-nixpkgs-patched.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, gccarch-armv8-a, kvm, nixos-test}

Observe that nowhere in this error message did it say it didn't try to substitute it because it was not allowed to. It did not even say that in the debug logs.

To cause yourself similar suffering, build a derivation that has a system that the local machine doesn't know how to build, but is available in a substituter and has allowSubstitutes = false.

A large amount of everyone's time was wasted debugging why a derivation was not substituting and was simply failing to build: https://matrix.to/#/!9IQChSjwSHXPPWTa:lix.systems/$IFHqKIPVzrnA-fGKiAWKE0QTCkcJ1WWqeU1DLKqr3F8?via=lix.systems&via=matrix.org&via=catgirl.cloud ``` building of '/nix/store/7s3fi53i1659dack0xp6ca8kmcs435ia-nixpkgs-patched.drv^out' from .drv file: goal destroyed error: … while calling the 'head' builtin at /mnt/nix/store/1nf4pp7gw1zsc44j1pq7wn8kznsmx6pn-source/lib/attrsets.nix:1575:11: 1574| || pred here (elemAt values 1) (head values) then 1575| head values | ^ 1576| else … while evaluating the attribute 'value' at /mnt/nix/store/1nf4pp7gw1zsc44j1pq7wn8kznsmx6pn-source/lib/modules.nix:821:9: 820| in warnDeprecation opt // 821| { value = addErrorContext "while evaluating the option `${showOption loc}':" value; | ^ 822| inherit (res.defsFinal') highestPrio; (stack trace truncated; use '--show-trace' to show the full trace) error: a 'x86_64-linux' with features {} is required to build '/nix/store/7s3fi53i1659dack0xp6ca8kmcs435ia-nixpkgs-patched.drv', but I am a 'aarch64-linux' with features {benchmark, big-parallel, gccarch-armv8-a, kvm, nixos-test} ``` Observe that nowhere in this error message did it say it didn't try to substitute it because it was not allowed to. It did not even say that in the debug logs. To cause yourself similar suffering, build a derivation that has a system that the local machine doesn't know how to build, but is available in a substituter and has `allowSubstitutes = false`.
jade added the
ux
bug
labels 2024-08-22 23:30:09 +00:00
jade self-assigned this 2024-08-23 00:08:11 +00:00
Member

This issue was mentioned on Gerrit on the following CLs:

  • commit message in cl/1841 ("fix: good errors for failures caused by allowSubstitutes")
<!-- GERRIT_LINKBOT: {"cls": [{"backlink": "https://gerrit.lix.systems/c/lix/+/1841", "number": 1841, "kind": "commit message"}], "cl_meta": {"1841": {"change_title": "fix: good errors for failures caused by allowSubstitutes"}}} --> This issue was mentioned on Gerrit on the following CLs: * commit message in [cl/1841](https://gerrit.lix.systems/c/lix/+/1841) ("fix: good errors for failures caused by allowSubstitutes")
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#484
No description provided.