Skip to content

Conversation

Ericson2314
Copy link
Member

Motivation

#11897 and #11928 and #11896

Don't even bother reviewing yet. It compiles but fails tests and none of the interesting things are done.

Context


Add 👍 to pull requests you find important.

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

@github-actions github-actions bot added new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority store Issues and pull requests concerning the Nix store labels Feb 13, 2025
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch from 6f610de to be5cfe4 Compare May 21, 2025 01:25
@github-actions github-actions bot added the fetching Networking with the outside (non-Nix) world, input locking label May 21, 2025
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch from be5cfe4 to 7b01c8b Compare May 21, 2025 22:01
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch from 7b01c8b to 546d826 Compare July 9, 2025 20:32
@Ericson2314 Ericson2314 force-pushed the build-trace-rework branch 2 times, most recently from 539b7ca to a031df7 Compare September 24, 2025 03:33
…tput

In the case where the store object doesn't exist, we do correctly move
(rather than copy) the scratch data into place. In this case, the
destination store object already exists, but we still want to clean up
after ourselves.
This allows refactoring without changing wire protocol by mistake.
There is now a clean separation between successful and failing build
results.
Realisations are conceptually key-value pairs, mapping `DrvOutputs` (the
key) to information about that derivation output.

This separate the value type, which will be useful in maps, etc., where
we don't want to denormalize by including the key twice.
It should be the responsibility of implementations that don't implement
it to say so.

See also PR NixOS#9799, and issue NixOS#5729
Tests the realisation functionality we just added.
@github-actions github-actions bot added the c api Nix as a C library with a stable interface label Sep 27, 2025
This test ends up being skipped, since the bug has not yet been fixed. A
future commit will fix the bug.

Progress on NixOS#13247, naturally.
This prepares the way for fixing a few issues.
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
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c api Nix as a C library with a stable interface fetching Networking with the outside (non-Nix) world, input locking new-cli Relating to the "nix" command 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.

1 participant