Merge pull request #4838 from NixOS/ca/recursively-substitute-realisations

Recursively substitute the realisations
This commit is contained in:
Eelco Dolstra 2021-06-23 10:33:25 +02:00 committed by GitHub
commit 4a5aa1dbf6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 3 deletions

View file

@ -53,6 +53,12 @@ void DrvOutputSubstitutionGoal::tryNext()
return; return;
} }
for (const auto & [drvOutputDep, _] : outputInfo->dependentRealisations) {
if (drvOutputDep != id) {
addWaitee(worker.makeDrvOutputSubstitutionGoal(drvOutputDep));
}
}
addWaitee(worker.makePathSubstitutionGoal(outputInfo->outPath)); addWaitee(worker.makePathSubstitutionGoal(outputInfo->outPath));
if (waitees.empty()) outPathValid(); if (waitees.empty()) outPathValid();

View file

@ -25,6 +25,8 @@
} }
#define GENERATE_EQUAL(args...) GENERATE_ONE_CMP(==, args) #define GENERATE_EQUAL(args...) GENERATE_ONE_CMP(==, args)
#define GENERATE_LEQ(args...) GENERATE_ONE_CMP(<, args) #define GENERATE_LEQ(args...) GENERATE_ONE_CMP(<, args)
#define GENERATE_NEQ(args...) GENERATE_ONE_CMP(!=, args)
#define GENERATE_CMP(args...) \ #define GENERATE_CMP(args...) \
GENERATE_EQUAL(args) \ GENERATE_EQUAL(args) \
GENERATE_LEQ(args) GENERATE_LEQ(args) \
GENERATE_NEQ(args)

View file

@ -17,11 +17,15 @@ buildDrvs () {
# Populate the remote cache # Populate the remote cache
clearStore clearStore
buildDrvs --post-build-hook ../push-to-store.sh nix copy --to $REMOTE_STORE --file ./content-addressed.nix
# Restart the build on an empty store, ensuring that we don't build # Restart the build on an empty store, ensuring that we don't build
clearStore clearStore
buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs -j0 buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs -j0 transitivelyDependentCA
# Check that the thing weve just substituted has its realisation stored
nix realisation info --file ./content-addressed.nix transitivelyDependentCA
# Check that its dependencies have it too
nix realisation info --file ./content-addressed.nix dependentCA rootCA
# Same thing, but # Same thing, but
# 1. With non-ca derivations # 1. With non-ca derivations