[nix#4813] nix-build exit codes are not as documented #504
Labels
No labels
Affects/CppNix
Affects/Nightly
Affects/Only nightly
Affects/Stable
Area/build-packaging
Area/cli
Area/evaluator
Area/fetching
Area/flakes
Area/language
Area/lix ci
Area/nix-eval-jobs
Area/profiles
Area/protocol
Area/releng
Area/remote-builds
Area/repl
Area/repl/debugger
Area/store
bug
Context
contributors
Context
drive-by
Context
maintainers
Context
RFD
crash 💥
Cross Compilation
devx
docs
Downstream Dependents
E/easy
E/hard
E/help wanted
E/reproducible
E/requires rearchitecture
imported
Language/Bash
Language/C++
Language/NixLang
Language/Python
Language/Rust
Needs Langver
OS/Linux
OS/macOS
performance
regression
release-blocker
stability
Status
blocked
Status
invalid
Status
postponed
Status
wontfix
testing
testing/flakey
Topic/Large Scale Installations
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…
Add table
Add a link
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.
https://git.lix.systems/lix-project/lix/src/ef0de7c79f3b32f66db447220d26eae7e7c07b19/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). https://git.lix.systems/lix-project/lix/src/b40369942cdb3e713c473515b9760f8a0d2ed3cc/src/libstore/build/worker.cc#L557-L575The 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!).