Derivation with empty outputs gets an uncharacteristic error message #1142

Open
opened 2026-02-27 21:55:14 +00:00 by raito · 0 comments
Owner

Derivation with empty outputs should receive a clear message that the output list is empty and should contain something.

Instead, we get:

❯ nix-build -E 'derivation { outputs = []; system = ":"; builder = ""; }'                                                      
error:
       … while evaluating an expression to select 'value' on it
         at «internal»:1:690:
       … while calling the 'head' builtin
         at «internal»:1:691:
       error: list index 0 is out of bounds

Problem is that we need to decide if the error is fatal or not, it is currently is. If we throw an abort from the builtin, it's also meh. If we throw a catchable error, well… it's now catchable!

All (strong) opinions welcome.

cc @pennae

Derivation with empty outputs should receive a clear message that the output list is empty and should contain something. Instead, we get: ``` ❯ nix-build -E 'derivation { outputs = []; system = ":"; builder = ""; }' error: … while evaluating an expression to select 'value' on it at «internal»:1:690: … while calling the 'head' builtin at «internal»:1:691: error: list index 0 is out of bounds ``` Problem is that we need to decide if the error is fatal or not, it is currently is. If we throw an abort from the builtin, it's also meh. If we throw a catchable error, well… it's now catchable! All (strong) opinions welcome. cc @pennae
raito added this to the 2.96 milestone 2026-03-03 02:30:14 +00:00
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/lix#1142
No description provided.