2020-11-09 15:04:43 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Ensure that binary substitution works properly with ca derivations
|
|
|
|
|
|
|
|
source common.sh
|
|
|
|
|
|
|
|
sed -i 's/experimental-features .*/& ca-derivations ca-references/' "$NIX_CONF_DIR"/nix.conf
|
|
|
|
|
2021-03-26 16:10:15 +00:00
|
|
|
rm -rf $TEST_ROOT/binary_cache
|
|
|
|
|
2020-11-09 15:04:43 +00:00
|
|
|
export REMOTE_STORE=file://$TEST_ROOT/binary_cache
|
|
|
|
|
|
|
|
buildDrvs () {
|
|
|
|
nix build --file ./content-addressed.nix -L --no-link "$@"
|
|
|
|
}
|
|
|
|
|
|
|
|
# Populate the remote cache
|
2021-03-26 16:10:15 +00:00
|
|
|
clearStore
|
2020-11-09 15:04:43 +00:00
|
|
|
buildDrvs --post-build-hook ../push-to-store.sh
|
|
|
|
|
|
|
|
# Restart the build on an empty store, ensuring that we don't build
|
|
|
|
clearStore
|
|
|
|
buildDrvs --substitute --substituters $REMOTE_STORE --no-require-sigs -j0
|
|
|
|
|