Skip to content

Simplify DerivationBuildingGoal#13765

Merged
Ericson2314 merged 4 commits intoNixOS:masterfrom
obsidiansystems:simplify-derivation-building-goal
Aug 15, 2025
Merged

Simplify DerivationBuildingGoal#13765
Ericson2314 merged 4 commits intoNixOS:masterfrom
obsidiansystems:simplify-derivation-building-goal

Conversation

@Ericson2314
Copy link
Member

Motivation

Nothing too complex this time. See each commit for details.

Context


Add 👍 to pull requests you find important.

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

@xokdvium
Copy link
Contributor

@Ericson2314, this needs some clang-format.

No derivation goal type has a notion of variable wanted outputs any
more. They either want them all, or they just care about a single
output, in which case we would just store this information for the one
output in question.
This is just more honest, since we downcasted it to `LocalStore` in many
places. We had the downcast before because it wasn't needed in the hook
case, just the local building case, but now that `DerivationBuilder` is
separated and just does the building case, we have formalized the
boundary where the single downcast should occur.
It is a simple constant that is only used once.
…sert`

Since this goal has no (goal-wide) notion of "wanted outputs" (we're
building the derivation, and thus making all outputs), we should have
`initialOutputs` for all outputs, and if we're missing one that's an
internal error caused by a bug in Nix.

Concretely, `DerivationBuildingGoal::gaveUpOnSubstitution` now clearly
does create `initialOutputs` for all outputs, whereas a few commits ago
that was not obvious, so I feel confident in saying that this invariant
that should be upheld, in fact is upheld.

`scatchOutputs` is initialized for every initial output, so the same
change to it follows for the same reasons.
@Ericson2314 Ericson2314 force-pushed the simplify-derivation-building-goal branch from c0dd142 to 9ccbe23 Compare August 15, 2025 19:51
@Ericson2314 Ericson2314 merged commit 97c966c into NixOS:master Aug 15, 2025
14 checks passed
@Ericson2314 Ericson2314 deleted the simplify-derivation-building-goal branch August 15, 2025 20:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants