Skip to content

Conversation

Ericson2314
Copy link
Member

Motivation

Instead of passing them around separately, or doing finicky logic in a try-catch block to recover them, just make BuildError always contain a status, and make it the thrower's responsibility to set it. This is much more simple and explicit.

Once that change is done, split the done functions of DerivationGoal and DerivationBuildingGoal into separate success and failure functions, which ends up being easier to understand and hardly any duplication.

Also, change the handling of failures in resolved cases to use BuildResult::DependencyFailed and a new message. This is because the underlying derivation will also get its message printed --- which is good, because in general the resolved derivation is not unique. One dyn drv test had to be updated, but CA (and dyn drv) is experimental, so I do not mind.

Finally, delete SubstError because it is unused.

Context

Part of my DerivationGoal cleanups

depends on #13853


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

Instead of passing them around separately, or doing finicky logic in a
try-catch block to recover them, just make `BuildError` always contain a
status, and make it the thrower's responsibility to set it. This is much
more simple and explicit.

Once that change is done, split the `done` functions of `DerivationGoal`
and `DerivationBuildingGoal` into separate success and failure
functions, which ends up being easier to understand and hardly any
duplication.

Also, change the handling of failures in resolved cases to use
`BuildResult::DependencyFailed` and a new message. This is because the
underlying derivation will also get its message printed --- which is
good, because in general the resolved derivation is not unique. One dyn
drv test had to be updated, but CA (and dyn drv) is experimental, so I
do not mind.

Finally, delete `SubstError` because it is unused.
@Ericson2314 Ericson2314 requested a review from edolstra as a code owner August 28, 2025 00:10
@github-actions github-actions bot added with-tests Issues related to testing. PRs with tests have some priority store Issues and pull requests concerning the Nix store labels Aug 28, 2025
Copy link

dpulls bot commented Aug 28, 2025

🎉 All dependencies have been resolved !

@Mic92 Mic92 merged commit 0d006ae into NixOS:master Aug 29, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
store Issues and pull requests concerning the Nix store with-tests Issues related to testing. PRs with tests have some priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants