Skip to content

Commit 7530f3d

Browse files
Merge #6490: ci: container improvements
04ce1fe ci: deduplicate macOS SDK setup logic (Kittywhiskers Van Gogh) 8dd0db7 ci: fix "LC_ALL: cannot change locale (en_US.UTF-8)" in Guix container (Kittywhiskers Van Gogh) 187fe17 ci: don't stage packages in `/tmp`, reduce layers for `cppcheck` build (Kittywhiskers Van Gogh) eef8635 ci: install `i386` packages only if host is `amd64`, merge layers (Kittywhiskers Van Gogh) e770229 ci: purge package manager cache after each interaction (Kittywhiskers Van Gogh) b7099ee ci: remove redundant `version` attribute, avoid `lldb` personality error (Kittywhiskers Van Gogh) 64cdc42 ci: add LLVM library path to `LD_LIBRARY_PATH` and GDB allowlist (Kittywhiskers Van Gogh) 440fd3f ci: drop distro LLVM packages, move Clang install up, set defaults (Kittywhiskers Van Gogh) Pull request description: ## Additional Information * This pull request pulls container-specific changes from [dash#6387](#6387), [dash#6400](#6400) and [dash#6421](#6421) * The `HOST` check before running `setup_sdk.sh` isn't a part of the script itself as the script is written to be independent of external variables set. The caller is expected to know the conditions needed to run `setup_sdk.sh` as the script is _relatively_ agnostic to its environment. * The `version` attribute in the [`develop`](https://github.com/dashpay/dash/blob/a8e2316d6f9c6726a498bcae2c5c5d7354769511/contrib/containers/develop/docker-compose.yml) and [`guix`](https://github.com/dashpay/dash/blob/a8e2316d6f9c6726a498bcae2c5c5d7354769511/contrib/containers/guix/docker-compose.yml) container's `docker-compose.yml` has been dropped as the attribute has been deprecated in the compose spec ([source](https://github.com/compose-spec/compose-spec/blob/65ef9f4a5d713b405a77c45c64263f2543e65267/spec.md#version-top-level-element-obsolete)). * Using `LD_LIBRARY_PATH` to point to LLVM's libraries are acceptable and will not interfere with executing binaries built using the distro's packaged compiler as it will eventually search default paths and find the libraries shipped with the distro ([source](https://man7.org/linux/man-pages/man8/ld.so.8.html)). * Currently, running LLDB will result in a "personality set failed: Operation not permitted" error ([source](https://discourse.llvm.org/t/running-lldb-in-a-container/76801)). This is caused by its attempt at disabling ASLR for debugging. To work around this error, the container will now operate under relaxed restrictions (`seccomp=unconfined`). As disabling ASLR is valuable when debugging and the container is meant for developers (i.e. it isn't used for CI), we have opted to relax restrictions instead of skipping ASLR disablement. * As of `develop` (a8e2316), packages built by the container are stored in `/tmp`, which is inadvisable as it is the same directory used to store functional test runs and it's not too difficult to delete `/tmp`'s contents to save space in a long running [`develop`](https://github.com/dashpay/dash/blob/a8e2316d6f9c6726a498bcae2c5c5d7354769511/contrib/containers/develop/docker-compose.yml) container and then realize that both `shellcheck` and `cppcheck` are stored there and now you have to ditch the container you're working in and restart it. * To remedy this, packages are now built and stored in `/opt` in accordance with the FHS ([source](https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html)). `/usr/local` was a contender but it's pre-populated, meanwhile `ls /opt` would give you a very quick picture of what's built for the container. * `/tmp` will not be entirely empty because [pypa/pip#10753](pypa/pip#10753) results in residual `.pem` files leaking into `/tmp` and `pyenv` stores its build log there and keeping it around has some debug value. ## Breaking Changes None expected. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have added or updated relevant unit/integration/functional/e2e tests **(note: N/A)** - [x] I have made corresponding changes to the documentation **(note: N/A)** - [x] I have assigned this pull request to a milestone _(for repository code-owners and collaborators only)_ ACKs for top commit: UdjinM6: ACK 04ce1fe PastaPastaPasta: utACK 04ce1fe Tree-SHA512: 5442ae06cb73b9bc4eec908803548195ae8fd9150422789e5f98578ad01a303b5361f9ba42fe8faee27ac91e38328b7771e4ba42b296dfa70ecbbfc7d10436b6
2 parents 5bf0409 + 04ce1fe commit 7530f3d

File tree

8 files changed

+125
-102
lines changed

8 files changed

+125
-102
lines changed

.gitlab-ci.yml

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,11 @@ builder-image:
4040
needs:
4141
- builder-image
4242
image: $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
43-
variables:
44-
SDK_URL: https://bitcoincore.org/depends-sources/sdks
45-
XCODE_VERSION: "15.0"
46-
XCODE_BUILD_ID: 15A240d
4743
before_script:
48-
- echo HOST=$HOST
4944
- |
50-
if [ "$HOST" = "x86_64-apple-darwin" ]; then
51-
mkdir -p depends/SDKs
52-
mkdir -p depends/sdk-sources
53-
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
54-
OSX_SDK_PATH="depends/sdk-sources/${OSX_SDK_BASENAME}"
55-
if [ ! -f "$OSX_SDK_PATH" ]; then
56-
echo "Downloading MacOS SDK"
57-
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
58-
fi
59-
if [ -f "$OSX_SDK_PATH" ]; then
60-
echo "Extracting MacOS SDK"
61-
tar -C depends/SDKs -xf "$OSX_SDK_PATH"
62-
fi
45+
echo HOST=${HOST}
46+
if [[ "${HOST}" == "x86_64-apple-darwin" ]]; then
47+
./contrib/containers/guix/scripts/setup-sdk
6348
fi
6449
script:
6550
- make -j$(nproc) -C depends HOST=$HOST $DEP_OPTS

ci/dash/build_depends.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,8 @@ mkdir -p $CACHE_DIR/sdk-sources
2020
ln -s $CACHE_DIR/depends ${DEPENDS_DIR}/built
2121
ln -s $CACHE_DIR/sdk-sources ${DEPENDS_DIR}/sdk-sources
2222

23-
mkdir -p ${DEPENDS_DIR}/SDKs
24-
25-
if [ -n "$XCODE_VERSION" ]; then
26-
OSX_SDK_BASENAME="Xcode-${XCODE_VERSION}-${XCODE_BUILD_ID}-extracted-SDK-with-libcxx-headers.tar.gz"
27-
OSX_SDK_PATH="${DEPENDS_DIR}/sdk-sources/${OSX_SDK_BASENAME}"
28-
if [ ! -f "$OSX_SDK_PATH" ]; then
29-
curl --location --fail "${SDK_URL}/${OSX_SDK_BASENAME}" -o "$OSX_SDK_PATH"
30-
fi
31-
if [ -f "$OSX_SDK_PATH" ]; then
32-
tar -C ${DEPENDS_DIR}/SDKs -xf "$OSX_SDK_PATH"
33-
fi
23+
if [[ "${HOST}" == "x86_64-apple-darwin" ]]; then
24+
./contrib/containers/guix/scripts/setup-sdk
3425
fi
3526

3627
make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS

contrib/containers/ci/Dockerfile

Lines changed: 74 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,17 @@ ENV DEBIAN_FRONTEND="noninteractive" TZ="Europe/London"
77
# (zlib1g-dev is needed for the Qt host binary builds, but should not be used by target binaries)
88
ENV APT_ARGS="-y --no-install-recommends --no-upgrade"
99

10-
11-
# Install packages for i386; disabled on aarch64 and arm64 hosts
12-
RUN (dpkg --print-architecture | grep -Eq 'aarch64|arm64' || dpkg --add-architecture i386)
13-
RUN (dpkg --print-architecture | grep -Eq 'aarch64|arm64' || (apt-get update && apt-get install $APT_ARGS \
14-
g++-multilib \
15-
wine32) && rm -rf /var/lib/apt/lists/*)
16-
17-
RUN apt-get update && apt-get install $APT_ARGS \
10+
# Install packages for i386 on amd64 hosts, then install common packages
11+
RUN set -ex; \
12+
apt-get update && \
13+
if [ "$(dpkg --print-architecture)" = "amd64" ]; then \
14+
dpkg --add-architecture i386 && \
15+
apt-get update && \
16+
apt-get install $APT_ARGS \
17+
g++-multilib \
18+
wine32; \
19+
fi; \
20+
apt-get install $APT_ARGS \
1821
autotools-dev \
1922
automake \
2023
autoconf \
@@ -23,13 +26,11 @@ RUN apt-get update && apt-get install $APT_ARGS \
2326
bsdmainutils \
2427
curl \
2528
ccache \
26-
clang \
2729
cmake \
2830
g++ \
2931
gettext \
3032
git \
31-
libc++-dev \
32-
libc++abi-dev \
33+
gnupg \
3334
libtool \
3435
libxcb-icccm4 \
3536
libxcb-image0 \
@@ -42,11 +43,38 @@ RUN apt-get update && apt-get install $APT_ARGS \
4243
libxcb-xinerama0 \
4344
libxcb-xkb1 \
4445
libxkbcommon-x11-0 \
45-
wget \
46+
lsb-release \
47+
software-properties-common \
4648
unzip \
49+
wget \
4750
m4 \
4851
pkg-config \
49-
zlib1g-dev
52+
zlib1g-dev \
53+
&& rm -rf /var/lib/apt/lists/*
54+
55+
# Install Clang+LLVM and set it as default
56+
# We don't need all packages but the default set doesn't include some
57+
# packages we want so we will need to install some of them manually.
58+
ARG LLVM_VERSION=16
59+
RUN set -ex; \
60+
echo "Installing LLVM and Clang ${LLVM_VERSION}..."; \
61+
curl -sL https://apt.llvm.org/llvm.sh | bash -s "${LLVM_VERSION}"; \
62+
echo "Installing additional packages..."; \
63+
apt-get update && apt-get install $APT_ARGS \
64+
"clang-format-${LLVM_VERSION}" \
65+
"clang-tidy-${LLVM_VERSION}" \
66+
"libc++-${LLVM_VERSION}-dev" \
67+
"libc++abi-${LLVM_VERSION}-dev" \
68+
"libclang-rt-${LLVM_VERSION}-dev"; \
69+
rm -rf /var/lib/apt/lists/*; \
70+
echo "Setting defaults..."; \
71+
lldbUpdAltArgs="update-alternatives --install /usr/bin/llvm-config llvm-config /usr/bin/llvm-config-${LLVM_VERSION} 100"; \
72+
for binName in clang clang++ clang-format clang-tidy clangd ld.lld lldb lldb-server; do \
73+
lldbUpdAltArgs="${lldbUpdAltArgs} --slave /usr/bin/${binName} ${binName} /usr/bin/${binName}-${LLVM_VERSION}"; \
74+
done; \
75+
sh -c "${lldbUpdAltArgs}";
76+
# LD_LIBRARY_PATH is empty by default, this is the first entry
77+
ENV LD_LIBRARY_PATH="/usr/lib/llvm-${LLVM_VERSION}/lib"
5078

5179
# Python setup
5280
# PYTHON_VERSION should match the value in .python-version
@@ -61,10 +89,11 @@ RUN apt-get update && apt-get install $APT_ARGS \
6189
libreadline-dev \
6290
libsqlite3-dev \
6391
libssl-dev \
64-
llvm \
6592
make \
6693
tk-dev \
67-
xz-utils
94+
xz-utils \
95+
&& rm -rf /var/lib/apt/lists/*
96+
6897
ENV PYENV_ROOT="/usr/local/pyenv"
6998
ENV PATH="${PYENV_ROOT}/shims:${PYENV_ROOT}/bin:${PATH}"
7099
RUN curl https://pyenv.run | bash \
@@ -82,19 +111,38 @@ RUN pip3 install \
82111
pyzmq==22.3.0 \
83112
vulture==2.3
84113

85-
# dash_hash
86114
ARG DASH_HASH_VERSION=1.4.0
87-
RUN git clone --depth 1 --no-tags --branch=${DASH_HASH_VERSION} https://github.com/dashpay/dash_hash
88-
RUN cd dash_hash && pip3 install -r requirements.txt .
115+
RUN set -ex; \
116+
cd /tmp; \
117+
git clone --depth 1 --no-tags --branch=${DASH_HASH_VERSION} https://github.com/dashpay/dash_hash; \
118+
cd dash_hash && pip3 install -r requirements.txt .; \
119+
cd .. && rm -rf dash_hash
120+
121+
ARG CPPCHECK_VERSION=2.13.0
122+
RUN set -ex; \
123+
curl -fL "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" -o /tmp/cppcheck.tar.gz; \
124+
mkdir -p /opt/cppcheck && tar -xzf /tmp/cppcheck.tar.gz -C /opt/cppcheck --strip-components=1 && rm /tmp/cppcheck.tar.gz; \
125+
cd /opt/cppcheck; \
126+
mkdir build && cd build && cmake .. && cmake --build . -j "$(( $(nproc) - 1 ))"; \
127+
mkdir /usr/local/share/Cppcheck && ln -s /opt/cppcheck/cfg/ /usr/local/share/Cppcheck/cfg; \
128+
rm -rf /tmp/cppcheck.tar.gz
129+
ENV PATH="/opt/cppcheck/build/bin:${PATH}"
89130

131+
ARG SHELLCHECK_VERSION=v0.7.1
132+
RUN set -ex; \
133+
curl -fL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" -o /tmp/shellcheck.tar.xz; \
134+
mkdir -p /opt/shellcheck && tar -xf /tmp/shellcheck.tar.xz -C /opt/shellcheck --strip-components=1 && rm /tmp/shellcheck.tar.xz
135+
ENV PATH="/opt/shellcheck:${PATH}"
136+
137+
# Add user with specified (or default) user/group ids and setup configuration files
90138
ARG USER_ID=1000
91139
ARG GROUP_ID=1000
92-
93-
# add user with specified (or default) user/group ids
94-
ENV USER_ID="${USER_ID}"
95-
ENV GROUP_ID="${GROUP_ID}"
96-
RUN groupadd -g ${GROUP_ID} dash
97-
RUN useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash
140+
RUN set -ex; \
141+
groupadd -g ${GROUP_ID} dash; \
142+
useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /home/dash dash; \
143+
mkdir -p /home/dash/.config/gdb; \
144+
echo "add-auto-load-safe-path /usr/lib/llvm-${LLVM_VERSION}/lib" | tee /home/dash/.config/gdb/gdbinit; \
145+
chown ${USER_ID}:${GROUP_ID} -R /home/dash
98146

99147
# Packages needed for all target builds
100148
RUN apt-get update && apt-get install $APT_ARGS \
@@ -111,17 +159,8 @@ RUN apt-get update && apt-get install $APT_ARGS \
111159
valgrind \
112160
wine-stable \
113161
wine64 \
114-
xorriso
115-
116-
ARG CPPCHECK_VERSION=2.13.0
117-
RUN curl -sL "https://github.com/danmar/cppcheck/archive/${CPPCHECK_VERSION}.tar.gz" | tar -xvzf - --directory /tmp/
118-
RUN cd /tmp/cppcheck-${CPPCHECK_VERSION} && mkdir build && cd build && cmake .. && cmake --build . -j 8
119-
ENV PATH="/tmp/cppcheck-${CPPCHECK_VERSION}/build/bin:${PATH}"
120-
RUN mkdir /usr/local/share/Cppcheck && ln -s /tmp/cppcheck-${CPPCHECK_VERSION}/cfg/ /usr/local/share/Cppcheck/cfg
121-
122-
ARG SHELLCHECK_VERSION=v0.7.1
123-
RUN curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz" | tar --xz -xf - --directory /tmp/
124-
ENV PATH="/tmp/shellcheck-${SHELLCHECK_VERSION}:${PATH}"
162+
xorriso \
163+
&& rm -rf /var/lib/apt/lists/*
125164

126165
# This is a hack. It is needed because gcc-multilib and g++-multilib are conflicting with g++-arm-linux-gnueabihf. This is
127166
# due to gcc-multilib installing the following symbolic link, which is needed for -m32 support. However, this causes
@@ -135,20 +174,6 @@ RUN \
135174
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix; \
136175
exit 0
137176

138-
ARG LLVM_VERSION=16
139-
# Setup Clang+LLVM support
140-
RUN apt-get update && apt-get install $APT_ARGS \
141-
lsb-release \
142-
software-properties-common \
143-
gnupg \
144-
&& rm -rf /var/lib/apt/lists/*
145-
146-
RUN cd /tmp && \
147-
wget https://apt.llvm.org/llvm.sh && \
148-
chmod +x llvm.sh && \
149-
/tmp/llvm.sh ${LLVM_VERSION} && \
150-
rm -rf /tmp/llvm.sh
151-
152177
RUN \
153178
mkdir -p /src/dash && \
154179
mkdir -p /cache/ccache && \

contrib/containers/develop/docker-compose.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
version: "3.9"
21
services:
32
container:
43
entrypoint: /bin/bash
54
build:
65
context: '..'
76
dockerfile: './develop/Dockerfile'
8-
tty: true # Equivalent to -t
9-
stdin_open: true # Equivalent to -i
107
ports:
118
- "9998:9998" # Mainnet Ports
129
- "9999:9999"
1310
- "19998:19998" # Testnet Ports
1411
- "19999:19999"
12+
security_opt:
13+
- seccomp:unconfined
14+
stdin_open: true # Equivalent to -i
15+
tty: true # Equivalent to -t
1516

1617
# A note about volumes:
1718
#

contrib/containers/guix/Dockerfile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ RUN apt-get update && \
1818
sudo \
1919
wget \
2020
xz-utils && \
21-
rm -rf /var/lib/apt/lists/*
21+
rm -rf /var/lib/apt/lists/*; \
22+
targetLocale="en_US.UTF-8"; \
23+
locale-gen ${targetLocale} && \
24+
update-locale LC_ALL=${targetLocale} && \
25+
update-locale LANG=${targetLocale};
2226

2327
ARG guix_download_path=ftp://ftp.gnu.org/gnu/guix
2428
ARG guix_version=1.4.0
@@ -30,8 +34,7 @@ ENV PATH="/usr/local/bin:/usr/local/guix/current/bin:$PATH"
3034

3135
# Application Setup
3236
# https://guix.gnu.org/manual/en/html_node/Application-Setup.html
33-
ENV GUIX_LOCPATH="/usr/local/guix/profile" \
34-
LC_ALL="en_US.UTF-8"
37+
ENV GUIX_LOCPATH="/usr/local/guix/profile"
3538

3639
RUN guix_file_name=guix-binary-${guix_version}.$(uname -m)-linux.tar.xz && \
3740
eval "guix_checksum=\${guix_checksum_$(uname -m)}" && \
@@ -74,18 +77,19 @@ RUN usermod -aG sudo ${USERNAME} && \
7477
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
7578

7679
# Copy required files to container
77-
COPY --from=docker_root ./motd.txt /etc/motd
78-
COPY --from=docker_root ./scripts/entrypoint /usr/local/bin/entrypoint
79-
COPY --from=docker_root ./scripts/guix-check /usr/local/bin/guix-check
80-
COPY --from=docker_root ./scripts/guix-start /usr/local/bin/guix-start
80+
COPY --from=docker_root ./motd.txt /etc/motd
81+
COPY --from=docker_root ./scripts/entrypoint /usr/local/bin/entrypoint
82+
COPY --from=docker_root ./scripts/guix-check /usr/local/bin/guix-check
83+
COPY --from=docker_root ./scripts/guix-start /usr/local/bin/guix-start
84+
COPY --from=docker_root ./scripts/setup-sdk /usr/local/bin/setup-sdk
8185

8286
# Create directories for mounting to save/restore cache and grant necessary permissions
8387
RUN mkdir -p \
8488
/home/${USERNAME}/.cache \
85-
/src/dash/depends/{built,sources,work} && \
89+
/src/dash/depends/{built,sources,work}; \
8690
chown -R ${USER_ID}:${GROUP_ID} \
8791
/home/${USERNAME}/.cache \
88-
/src
92+
/src;
8993

9094
WORKDIR "/src/dash"
9195

contrib/containers/guix/docker-compose.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
version: "3.9"
21
services:
32
guix_ubuntu:
43
build:

contrib/containers/guix/scripts/guix-start

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,10 @@ if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPAC
99
exit 1
1010
fi
1111

12-
XCODE_VERSION="15.0"
13-
XCODE_RELEASE="15A240d"
14-
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
15-
XCODE_SOURCE="${XCODE_SOURCE:-https://bitcoincore.org/depends-sources/sdks}"
16-
1712
export SDK_PATH="${SDK_PATH:-${WORKSPACE_PATH}/depends/SDKs}"
13+
export SDK_SRCS="${SDK_PATH:-${WORKSPACE_PATH}/depends/sdk-sources}"
1814

19-
# Check if macOS SDK is present, if not, download it
20-
if [[ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]]; then
21-
echo "Preparing macOS SDK..."
22-
mkdir -p "${SDK_PATH}"
23-
curl -L "${XCODE_SOURCE}/${XCODE_ARCHIVE}.tar.gz" | tar -xz -C "${SDK_PATH}"
24-
fi
15+
./contrib/containers/guix/scripts/setup-sdk
2516

2617
# Add safe.directory option only when WORKSPACE_PATH was specified via cmd-line arguments (happens in CI)
2718
if [[ -n "${1}" ]]; then
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/usr/bin/env bash
2+
# Copyright (c) 2024 The Dash Core developers
3+
# Distributed under the MIT software license, see the accompanying
4+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
5+
6+
export LC_ALL=C.UTF-8
7+
8+
set -eo pipefail
9+
10+
SDK_URL="${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}"
11+
SDK_PATH="${SDK_PATH:-depends/SDKs}"
12+
SDK_SRCS="${SDK_SOURCES:-depends/sdk-sources}"
13+
XCODE_VERSION="${XCODE_VERSION:-15.0}"
14+
XCODE_RELEASE="${XCODE_RELEASE:-15A240d}"
15+
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
16+
XCODE_AR_PATH="${SDK_SRCS}/${XCODE_ARCHIVE}.tar.gz"
17+
18+
if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then
19+
if [ ! -f "${XCODE_AR_PATH}" ]; then
20+
echo "Downloading macOS SDK..."
21+
mkdir -p "${SDK_SRCS}"
22+
curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar.gz" -o "${XCODE_AR_PATH}"
23+
fi
24+
echo "Extracting macOS SDK..."
25+
mkdir -p "${SDK_PATH}"
26+
tar -C "${SDK_PATH}" -xf "${XCODE_AR_PATH}"
27+
fi

0 commit comments

Comments
 (0)