[nix#4813] nix-build exit codes are not as documented #504
Labels
No labels
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/store
bug
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
RFD
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
ux
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: lix-project/lix#504
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This is: https://github.com/NixOS/nix/issues/4813
Consider the following:
That's busted. Quoth the manual:
I am unsure if this is an unavoidable bug caused by the daemon architecture/protocol being busted or if it is an easily fixable bug, but it is certainly reproducible.
nix (Lix, like Nix) 2.92.0-dev-pre20240820-ac69747
Ah, it's permanently busted, and there is no way we can fix this without replacing the protocol. As pointed out by Théophane on the original issue, the cause is that the protocol does not send the exit status.
Since we are under a permanent legacy protocol freeze, this will never be fixed on the legacy Nix protocol. However, this can be fixed when we replace the protocol.
ef0de7c79f/src/libutil/serialise.cc (L249-L271)
Action items: update the documentation to say it's broken
I think this might actually not require rearchitecture, but merely using
Store::buildPathsWithResults
innix-build
and doing the exit code stuff entirely client side instead. I have, however, not inspected the code.Appears this at least would need a refactoring:
failingExitStatus
is currently calculated on the daemon side (which is absurd), and is currently calculated over an entire worker operation (which I believe implicitly does the recursion into dependent derivations necessary to represent multiple failures).b40369942c/src/libstore/build/worker.cc (L557-L575)
The way that this should be refactored is that the exit status should be calculated as a pure function of derivation result and then make the worker code use this (though obviously the fact we are calculating exit status in there to begin with is absurd. Fortunately I suspect we may be able to fix that because we could delete the old serializer and drop the 2.3 protocol, removing it from our API commitment as we plan to do anyhow. This bug has some positive effects!).