diff options
author | regnat <rg@regnat.ovh> | 2021-05-06 16:45:09 +0200 |
---|---|---|
committer | regnat <rg@regnat.ovh> | 2021-05-06 17:38:20 +0200 |
commit | b66234134fadc720d6c177d62e6ce4c9f4093a89 (patch) | |
tree | c0c4a8fa838b244abe081c41b3c439ace8a35d6b /tests/ca | |
parent | fe3a10a9b2c61ba19b24da4c93c4abc9e7583f3d (diff) |
Add a realisations disk cache
Similar to the nar-info disk cache (and using the same db).
This makes rebuilds muuch faster.
- This works regardless of the ca-derivations experimental feature.
I could modify the logic to not touch the db if the flag isn’t there,
but given that this is a trash-able local cache, it doesn’t seem to be
really worth it.
- We could unify the `NARs` and `Realisation` tables to only have one
generic kv table. This is left as an exercise to the reader.
- I didn’t update the cache db version number as the new schema just
adds a new table to the previous one, so the db will be transparently
migrated and is backwards-compatible.
Fix #4746
Diffstat (limited to 'tests/ca')
-rw-r--r-- | tests/ca/substitute.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/ca/substitute.sh b/tests/ca/substitute.sh index 737c851a5..dfc4ea68e 100644 --- a/tests/ca/substitute.sh +++ b/tests/ca/substitute.sh @@ -45,3 +45,16 @@ if [[ -z "$(ls "$REMOTE_STORE_DIR/realisations")" ]]; then echo "Realisations not rebuilt" exit 1 fi + +# Test the local realisation disk cache +buildDrvs --post-build-hook ../push-to-store.sh +clearStore +# Add the realisations of rootCA to the cachecache +clearCacheCache +export _NIX_FORCE_HTTP=1 +buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs -j0 +# Try rebuilding, but remove the realisations from the remote cache to force +# using the cachecache +clearStore +rm $REMOTE_STORE_DIR/realisations/* +buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs -j0 |