Substitute drv outputs#4238
Conversation
src/libstore/daemon.cc
Outdated
| logger->startWork(); | ||
| auto outputId = DrvOutputId::parse(readString(from)); | ||
| auto outputPath = StorePath(readString(from)); | ||
| store->registerDrvOutput(outputId, DrvOutputInfo{outputPath}); |
There was a problem hiding this comment.
Shouldn't this require trusted user or signature verification?
There was a problem hiding this comment.
It definitely should, yes, and that's one of the necessary follow-ups.
I think it's okay to keep it for a subsequent PR though, as long as it is behind the ca-derivations feature flag (which it isn't atm, I'll have to add it)
There was a problem hiding this comment.
Where do you track these problems?
There was a problem hiding this comment.
Curently mostly on a sheet of paper on my desk. Opening proper issues is still on my todo-list
There was a problem hiding this comment.
a9090ae to
b2a19e0
Compare
b2a19e0 to
45c0a9b
Compare
20a3ccc to
4f0541e
Compare
9e86318 to
081b0bf
Compare
661b315 to
e10741c
Compare
|
🎉 All dependencies have been resolved ! |
ddc348a to
0d77839
Compare
Change the `nix-build` logic for linking/printing the output paths to allow for some outputs to be missing. This might happen when the toplevel derivation didn't have to be built, either because all the required outputs were already there, or because they have all been substituted.
Simple test to ensure that `nix-build && nix-collect-garbage && nix-build -j0` works as it should
Once a build is done, get back to the original derivation, and register all the newly built outputs for this derivation. This allows Nix to work properly with derivations that don't have all their build inputs available − thus allowing garbage collection and (once it's implemented) binary substitution
Where a `RealisedPath` is a store path with its history, meaning either an opaque path for stuff that has been directly added to the store, or a `Realisation` for stuff that has been built by a derivation This is a low-level refactoring that doesn't bring anything by itself (except a few dozen extra lines of code :/ ), but raising the abstraction level a bit is important on a number of levels: - Commands like `nix build` have to query for the realisations after the build is finished which is fragile (see 27905f1 for example). Having them oprate directly at the realisation level would avoid that - Others like `nix copy` currently operate directly on (built) store paths, but need a bit more information as they will need to register the realisations on the remote side
That way we can copy the realisations too (in addition to the store paths themselves)
To prepare for the upcoming DrvOutputSubstitutionGoal
Requires a slight update to the test infra to work properly
0cb72be to
1c6c71d
Compare
|
@regnat I don't think this depends on anything anymore? Also, there is another place we want to substitute resolutions: when resolving CA derivations. In that case we don't want to fetch the data. That means we would need to not have resolution goals spawn path goals, at least not unconditionally. |
|
Getting into the weeds, I think some of the Basically we end up with:
This can be done in a follow-up PR, of course. |
It still depends #4487 which itself depends on #4340 and #4372 (unless we want to merge it into #4487. I don't really care about the order as long as everything ends-up merged)
Fully agree. I've opened #4493 to track that (sorry, I though there was already an issue about it) |
abf404b to
8ac4133
Compare
75bd078 to
c43f446
Compare
|
🎉 All dependencies have been resolved ! |
Depends on #4225, only commits after 97aca21 are new.Depends on #4487
Changes the build loop to allow substituting derivation outputs.