diff options
author | fanquake <fanquake@gmail.com> | 2021-02-23 10:46:36 +0800 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2021-02-23 10:51:41 +0800 |
commit | 3371758af49cfe431141dfc314b4406b79bce1c3 (patch) | |
tree | 00311f87f342e3b55d5605e1108d09bb7fb3ca08 | |
parent | 64343a61105eaed4cfb470620a1871fee5c71cd6 (diff) | |
parent | a6a1b106dcc4350e420c461171c47e4934087175 (diff) |
Merge #21078: guix: only download sources for hosts being built
a6a1b106dcc4350e420c461171c47e4934087175 guix: only download sources for hosts being built (fanquake)
Pull request description:
For example, if a user is only interested in building for Linux, this saves downloading the macOS compiler and additional dependencies, which is meaningful on a slow/poor connection. This will result in a few additional `make` invocations, for the Linux hosts, however this is low overhead, and time-wise irrelevant in terms of the overall build.
ACKs for top commit:
laanwj:
Code review ACK a6a1b106dcc4350e420c461171c47e4934087175
Tree-SHA512: 34c916ae6f69fed0d5845690b39111a8bee37208fd727176f375cf5eb4860f512abe12bde2680d697c859b4d50a3bc5688ddca7c2f28f9968fcf358753cf3f6d
-rwxr-xr-x | contrib/guix/guix-build.sh | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/contrib/guix/guix-build.sh b/contrib/guix/guix-build.sh index 3b9030682a..7af132b240 100755 --- a/contrib/guix/guix-build.sh +++ b/contrib/guix/guix-build.sh @@ -136,9 +136,24 @@ done # environment) MAX_JOBS="${MAX_JOBS:-$(nproc)}" +# Usage: host_to_commonname HOST +# +# HOST: The current platform triple we're building for +# +host_to_commonname() { + case "$1" in + *darwin*) echo osx ;; + *mingw*) echo win ;; + *linux*) echo linux ;; + *) exit 1 ;; + esac +} + # Download the depends sources now as we won't have internet access in the build # container -make -C "${PWD}/depends" -j"$MAX_JOBS" download ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} +for host in $HOSTS; do + make -C "${PWD}/depends" -j"$MAX_JOBS" download-"$(host_to_commonname "$host")" ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} +done # Determine the reference time used for determinism (overridable by environment) SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git log --format=%at -1)}" |