Skip to content

Reapply the rest of #14022#14225

Merged
Ericson2314 merged 3 commits intoNixOS:masterfrom
obsidiansystems:derivation-resolution-goal-2
Oct 14, 2025
Merged

Reapply the rest of #14022#14225
Ericson2314 merged 3 commits intoNixOS:masterfrom
obsidiansystems:derivation-resolution-goal-2

Conversation

@Ericson2314
Copy link
Member

Motivation

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.

@Ericson2314 Ericson2314 requested a review from xokdvium October 12, 2025 14:31
@Ericson2314 Ericson2314 requested a review from edolstra as a code owner October 12, 2025 14:31
@github-actions github-actions bot added the with-tests Issues related to testing. PRs with tests have some priority label Oct 12, 2025
@Ericson2314 Ericson2314 mentioned this pull request Oct 12, 2025
@xokdvium xokdvium self-assigned this Oct 12, 2025
@Ericson2314 Ericson2314 force-pushed the derivation-resolution-goal-2 branch from 4ffb384 to 89e9286 Compare October 13, 2025 22:28
Resolve the derivation before creating a building goal, in a context
where we know what output(s) we want. That way we have a chance just to
download the outputs we want.

Fix NixOS#13247

(cherry picked from commit 39f6fd9)
Force the internals to be more explicit.
The refactor in the last commit fixed the bug it was supposed to fix,
but introduced a new bug in that sometimes we tried to write a resolved
derivation to a store before all its `inputSrcs` were in that store.

The solution is to defer writing the derivation until inside
`DerivationBuildingGoal`, just before we do an actual build. At this
point, we are sure that all inputs in are the store.

This does have the side effect of meaning we don't write down the
resolved derivation in the substituting case, only the building case,
but I think that is actually fine. The store that actually does the
building should make a record of what it built by storing the resolved
derivation. Other stores that just substitute from that store don't
necessary want that derivation however. They can trust the substituter
to keep the record around, or baring that, they can attempt to re
resolve everything, if they need to be audited.

(cherry picked from commit c97b050)
@Ericson2314 Ericson2314 force-pushed the derivation-resolution-goal-2 branch from 89e9286 to ad893ac Compare October 13, 2025 22:42
@Ericson2314 Ericson2314 enabled auto-merge October 13, 2025 22:43
@Ericson2314 Ericson2314 added this pull request to the merge queue Oct 13, 2025
Merged via the queue into NixOS:master with commit 16e946b Oct 14, 2025
18 checks passed
@Ericson2314 Ericson2314 deleted the derivation-resolution-goal-2 branch October 14, 2025 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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