Skip to content

Commit 5ba5bec

Browse files
committed
Merge #21272: guix: Passthrough SDK_PATH into container
13a9fd1 guix: Passthrough SDK_PATH into container (Carl Dong) Pull request description: This is a usability improvement for Guix builders so that they don't have to extract the Xcode tarball into `depends/SDKs` every time. Inspiration: bitcoin/bitcoin#21089 (comment) ACKs for top commit: laanwj: Tested ACK 13a9fd1 Tree-SHA512: 63392d537e48a0da9f0ee04a929613b139bef1ac5643187871c9ea5376afd2a3d95df0f5e0950ae0eccd2813b166667be98401e5a248ae9c187fe4e84e54d427
2 parents 8d37841 + 13a9fd1 commit 5ba5bec

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

contrib/guix/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,13 @@ find output/ -type f -print0 | sort -z | xargs -r0 sha256sum
118118
depends tree. Setting this to the same directory across multiple builds of the
119119
depends tree can eliminate unnecessary building of packages.
120120

121+
* _**SDK_PATH**_
122+
123+
Set the path where _extracted_ SDKs can be found. This is passed through to
124+
the depends tree. Note that this is should be set to the _parent_ directory of
125+
the actual SDK (e.g. SDK_PATH=$HOME/Downloads/macOS-SDKs instead of
126+
$HOME/Downloads/macOS-SDKs/Xcode-11.3.1-11C505-extracted-SDK-with-libcxx-headers).
127+
121128
* _**MAX_JOBS**_
122129

123130
Override the maximum number of jobs to run simultaneously, you might want to

contrib/guix/guix-build.sh

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,10 +196,11 @@ and untracked files and directories will be wiped, allowing you to start anew.
196196
EOF
197197
}
198198

199-
# Create SOURCES_PATH and BASE_CACHE if they are non-empty so that we can map
200-
# them into the container
199+
# Create SOURCES_PATH, BASE_CACHE, and SDK_PATH if they are non-empty so that we
200+
# can map them into the container
201201
[ -z "$SOURCES_PATH" ] || mkdir -p "$SOURCES_PATH"
202202
[ -z "$BASE_CACHE" ] || mkdir -p "$BASE_CACHE"
203+
[ -z "$SDK_PATH" ] || mkdir -p "$SDK_PATH"
203204

204205
# Deterministically build Bitcoin Core
205206
# shellcheck disable=SC2153
@@ -302,6 +303,7 @@ EOF
302303
--expose="$(git rev-parse --git-common-dir)" \
303304
${SOURCES_PATH:+--share="$SOURCES_PATH"} \
304305
${BASE_CACHE:+--share="$BASE_CACHE"} \
306+
${SDK_PATH:+--share="$SDK_PATH"} \
305307
--max-jobs="$MAX_JOBS" \
306308
--keep-failed \
307309
${SUBSTITUTE_URLS:+--substitute-urls="$SUBSTITUTE_URLS"} \
@@ -312,6 +314,7 @@ EOF
312314
${V:+V=1} \
313315
${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \
314316
${BASE_CACHE:+BASE_CACHE="$BASE_CACHE"} \
317+
${SDK_PATH:+SDK_PATH="$SDK_PATH"} \
315318
DISTSRC="$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")" \
316319
OUTDIR=/outdir \
317320
bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh"

contrib/guix/libexec/build.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ make -C depends --jobs="$MAX_JOBS" HOST="$HOST" \
184184
${V:+V=1} \
185185
${SOURCES_PATH+SOURCES_PATH="$SOURCES_PATH"} \
186186
${BASE_CACHE+BASE_CACHE="$BASE_CACHE"} \
187+
${SDK_PATH+SDK_PATH="$SDK_PATH"} \
187188
i686_linux_CC=i686-linux-gnu-gcc \
188189
i686_linux_CXX=i686-linux-gnu-g++ \
189190
i686_linux_AR=i686-linux-gnu-ar \

0 commit comments

Comments
 (0)