diff options
author | jade <lix@jade.fyi> | 2024-08-25 20:00:58 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@localhost> | 2024-08-25 20:00:58 +0000 |
commit | 72f91767a898e0e918ae377193b58c19a97eec56 (patch) | |
tree | 516ef249ec51110550834efdd1c13db938165c54 /doc | |
parent | 3bf8819fa2717176c9b3bfc24281b3428c431e71 (diff) | |
parent | 686120ee4a34f658b2f19dcac9f9dc44dbc98b93 (diff) |
Merge "fix: good errors for failures caused by allowSubstitutes" into main
Diffstat (limited to 'doc')
-rw-r--r-- | doc/manual/rl-next/allowsubstitutes-errors.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/doc/manual/rl-next/allowsubstitutes-errors.md b/doc/manual/rl-next/allowsubstitutes-errors.md new file mode 100644 index 000000000..47b0555b1 --- /dev/null +++ b/doc/manual/rl-next/allowsubstitutes-errors.md @@ -0,0 +1,21 @@ +--- +synopsis: "Build failures caused by `allowSubstitutes = false` while being the wrong system now produce a decent error" +issues: [fj#484] +cls: [1841] +category: Fixes +credits: jade +--- + +Nix allows derivations to set `allowSubstitutes = false` in order to force them to be built locally without querying substituters for them. +This is useful for derivations that are very fast to build (especially if they produce large output). +However, this can shoot you in the foot if the derivation *has* to be substituted such as if the derivation is for another architecture, which is what `--always-allow-substitutes` is for. + +Perhaps such derivations that are known to be impossible to build locally should ignore `allowSubstitutes` (irrespective of remote builders) in the future, but this at least reports the failure and solution directly. + +``` +$ nix build -f fail.nix +error: a 'unicornsandrainbows-linux' with features {} is required to build '/nix/store/...-meow.drv', but I am a 'x86_64-linux' with features {...} + + Hint: the failing derivation has allowSubstitutes set to false, forcing it to be built rather than substituted. + Passing --always-allow-substitutes to force substitution may resolve this failure if the path is available in a substituter. +``` |