diff options
author | fanquake <fanquake@gmail.com> | 2021-02-17 11:59:57 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-02-17 12:25:06 +0800 |
commit | 36be9b821ae0882ba5ccba543f959636e413991d (patch) | |
tree | a642876ece6d570496640432155c756b90fe0dcc /contrib/guix/guix-build.sh | |
parent | 7c8e605bf4207d176e3a706f8928fae557e49a24 (diff) | |
parent | 901f54321b386258a1682423160bfdfa35ea4c39 (diff) | |
download | bitcoin-36be9b821ae0882ba5ccba543f959636e413991d.tar.xz |
Merge #21087: guix: Passthrough BASE_CACHE into container
901f54321b386258a1682423160bfdfa35ea4c39 guix: Passthrough BASE_CACHE into container (Carl Dong)
Pull request description:
This allows depends-built packages to be cached.
ACKs for top commit:
MarcoFalke:
Approach ACK 901f54321b386258a1682423160bfdfa35ea4c39
fanquake:
ACK 901f54321b386258a1682423160bfdfa35ea4c39
Tree-SHA512: 464815f41fc081d7956bec84380668834b6ee6751c7a3d56daad6e1fc91e582de4bbdd1a89f399b1136f2adc4d9941517cfe4db694f0ee5bf59bf2f44fc6fda0
Diffstat (limited to 'contrib/guix/guix-build.sh')
-rwxr-xr-x | contrib/guix/guix-build.sh | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/contrib/guix/guix-build.sh b/contrib/guix/guix-build.sh index da6bd13f6a..7cb4ec330b 100755 --- a/contrib/guix/guix-build.sh +++ b/contrib/guix/guix-build.sh @@ -180,6 +180,11 @@ and untracked files and directories will be wiped, allowing you to start anew. EOF } +# Create SOURCES_PATH and BASE_CACHE if they are non-empty so that we can map +# them into the container +[ -z "$SOURCES_PATH" ] || mkdir -p "$SOURCES_PATH" +[ -z "$BASE_CACHE" ] || mkdir -p "$BASE_CACHE" + # Deterministically build Bitcoin Core # shellcheck disable=SC2153 for host in $HOSTS; do @@ -274,6 +279,7 @@ EOF --share="$OUTDIR"=/outdir \ --expose="$(git rev-parse --git-common-dir)" \ ${SOURCES_PATH:+--share="$SOURCES_PATH"} \ + ${BASE_CACHE:+--share="$BASE_CACHE"} \ --max-jobs="$MAX_JOBS" \ ${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \ ${ADDITIONAL_GUIX_COMMON_FLAGS} ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} \ @@ -282,6 +288,7 @@ EOF SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \ ${V:+V=1} \ ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \ + ${BASE_CACHE:+BASE_CACHE="$BASE_CACHE"} \ DISTSRC="$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")" \ OUTDIR=/outdir \ bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh" |