From 4fcc7b4bf9a236827ada48dc1a4b95c38df37567 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sun, 1 Mar 2026 20:56:45 +0700 Subject: [PATCH 1/8] Revert "build: update to macOS 15.0 SDK from Xcode 16.0" This reverts commit 7e9df775fd883fa61e5d0a8fa180c884e6ff4b8c. --- ci/test/00_setup_env.sh | 2 +- ci/test/00_setup_env_mac.sh | 6 +++--- contrib/containers/guix/scripts/setup-sdk | 6 +++--- contrib/guix/README.md | 2 +- contrib/guix/symbol-check.py | 4 ++-- contrib/macdeploy/README.md | 14 +++++++------- depends/hosts/darwin.mk | 6 +++--- 7 files changed, 20 insertions(+), 20 deletions(-) diff --git a/ci/test/00_setup_env.sh b/ci/test/00_setup_env.sh index 626394cb5d7b..4207615a1a94 100755 --- a/ci/test/00_setup_env.sh +++ b/ci/test/00_setup_env.sh @@ -71,7 +71,7 @@ export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST} # Folder where the build is done (dist and out-of-tree build). export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build-ci} export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/releases/$HOST} -export SDK_URL=${SDK_URL:-https://s3.us-west-2.amazonaws.com/dash-depends-sources} +export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks} export DOCKER_PACKAGES=${DOCKER_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps} export GOAL=${GOAL:-install} export DIR_QA_ASSETS=${DIR_QA_ASSETS:-${BASE_SCRATCH_DIR}/qa-assets} diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index 244ec7138044..ca04e916fc2a 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -8,9 +8,9 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross export HOST=x86_64-apple-darwin -export PACKAGES="clang cmake lld llvm zip" -export XCODE_VERSION=16.0 -export XCODE_BUILD_ID=16A242d +export PACKAGES="clang cmake lld llvm zip" +export XCODE_VERSION=15.0 +export XCODE_BUILD_ID=15A240d export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="all deploy" diff --git a/contrib/containers/guix/scripts/setup-sdk b/contrib/containers/guix/scripts/setup-sdk index 8034fa63d581..cd2bb64e966e 100755 --- a/contrib/containers/guix/scripts/setup-sdk +++ b/contrib/containers/guix/scripts/setup-sdk @@ -7,11 +7,11 @@ export LC_ALL=C.UTF-8 set -eo pipefail -SDK_URL="${SDK_URL:-https://s3.us-west-2.amazonaws.com/dash-depends-sources}" +SDK_URL="${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}" SDK_PATH="${SDK_PATH:-depends/SDKs}" SDK_SOURCES="${SDK_SOURCES:-depends/sdk-sources}" -XCODE_VERSION="${XCODE_VERSION:-16.0}" -XCODE_RELEASE="${XCODE_RELEASE:-16A242d}" +XCODE_VERSION="${XCODE_VERSION:-15.0}" +XCODE_RELEASE="${XCODE_RELEASE:-15A240d}" XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers" XCODE_AR_HASH="${XCODE_AR_HASH:-bce59aa16560f182e44200a0b9539bd637c8b5c7089fbff13b0712730ce162ff}" XCODE_AR_PATH="${SDK_SOURCES}/${XCODE_ARCHIVE}.tar.gz" diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 366ba7dfc951..5e468c783977 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -249,7 +249,7 @@ details. Set the path where _extracted_ SDKs can be found. This is passed through to the depends tree. Note that this is should be set to the _parent_ directory of the actual SDK (e.g. `SDK_PATH=$HOME/Downloads/macOS-SDKs` instead of - `$HOME/Downloads/macOS-SDKs/Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers`). + `$HOME/Downloads/macOS-SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers`). The path that this environment variable points to **must be a directory**, and **NOT a symlink to a directory**. diff --git a/contrib/guix/symbol-check.py b/contrib/guix/symbol-check.py index b2dc20cb5266..bca9029b24d8 100755 --- a/contrib/guix/symbol-check.py +++ b/contrib/guix/symbol-check.py @@ -235,12 +235,12 @@ def check_MACHO_libraries(binary) -> bool: return ok def check_MACHO_min_os(binary) -> bool: - if binary.build_version.minos == [14, 0, 0]: + if binary.build_version.minos == [14,0,0]: return True return False def check_MACHO_sdk(binary) -> bool: - if binary.build_version.sdk == [15, 0, 0]: + if binary.build_version.sdk == [14, 0, 0]: return True return False diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index 86d122f6dfae..cf32a07602d3 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -15,14 +15,14 @@ When complete, it will have produced `Dash-Core.zip`. A free Apple Developer Account is required to proceed. Our macOS SDK can be extracted from -[Xcode_16.xip](https://download.developer.apple.com/Developer_Tools/Xcode_16/Xcode_16.xip). +[Xcode_15.xip](https://download.developer.apple.com/Developer_Tools/Xcode_15/Xcode_15.xip). Alternatively, after logging in to your account go to 'Downloads', then 'More' -and search for [`Xcode 16`](https://developer.apple.com/download/all/?q=Xcode%2016). +and search for [`Xcode 15`](https://developer.apple.com/download/all/?q=Xcode%2015). An Apple ID and cookies enabled for the hostname are needed to download this. -The `sha256sum` of the downloaded XIP archive should be `4a26c3d102a55c7222fb145e0ee1503249c9c26c6e02dc64d783c8810b37b1e3`. +The `sha256sum` of the downloaded XIP archive should be `4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e`. To extract the `.xip` on Linux: @@ -33,13 +33,13 @@ git clone https://github.com/bitcoin-core/apple-sdk-tools.git # Unpack the .xip and place the resulting Xcode.app in your current # working directory -python3 apple-sdk-tools/extract_xcode.py -f Xcode_16.xip | cpio -d -i +python3 apple-sdk-tools/extract_xcode.py -f Xcode_15.xip | cpio -d -i ``` On macOS: ```bash -xip -x Xcode_16.xip +xip -x Xcode_15.xip ``` ### Step 2: Generating the SDK tarball from `Xcode.app` @@ -51,8 +51,8 @@ path to `Xcode.app` (extracted in the previous stage) as the first argument. ./contrib/macdeploy/gen-sdk '/path/to/Xcode.app' ``` -The generated archive should be: `Xcode-16.0-16A242d-extracted-SDK-with-libcxx-headers.tar.gz`. -The `sha256sum` should be `bce59aa16560f182e44200a0b9539bd637c8b5c7089fbff13b0712730ce162ff`. +The generated archive should be: `Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz`. +The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d`. ## Deterministic macOS App Notes diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index eb5e3d15b3d7..502ba827e245 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,7 +1,7 @@ OSX_MIN_VERSION=14.0 -OSX_SDK_VERSION=15.0 -XCODE_VERSION=16.0 -XCODE_BUILD_ID=16A242d +OSX_SDK_VERSION=14.0 +XCODE_VERSION=15.0 +XCODE_BUILD_ID=15A240d LLD_VERSION=711 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers From eda7eb87da178897a7dda918994fd9add56371f2 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sun, 1 Mar 2026 20:58:31 +0700 Subject: [PATCH 2/8] Revert "fix(build): include resource directory in search path for include resolution" This reverts commit 1f64bad38c757be358a9b6d9fe70c9e56dc7a7a5. --- depends/hosts/darwin.mk | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 502ba827e245..5c69b4287966 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -13,10 +13,8 @@ OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with- # distro releases. # # Source: https://lists.gnu.org/archive/html/bug-make/2017-11/msg00017.html -clang_prog:=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang") -clangxx_prog:=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++") - -clang_resource_dir:=$(shell $(SHELL) $(.SHELLFLAGS) "$(clang_prog) -print-resource-dir") +clang_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang") +clangxx_prog=$(shell $(SHELL) $(.SHELLFLAGS) "command -v clang++") darwin_AR=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-ar") darwin_DSYMUTIL=$(shell $(SHELL) $(.SHELLFLAGS) "command -v dsymutil") @@ -54,14 +52,12 @@ darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip") # non-determinism issues with the Identifier field. darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clang_prog) --target=$(host) \ - -isysroot$(OSX_SDK) -nostdinc \ - -isystem$(clang_resource_dir)/include \ + -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clangxx_prog) --target=$(host) \ - -isysroot$(OSX_SDK) -nostdinc -nostdinc++ \ + -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include/c++/v1 \ - -isystem$(clang_resource_dir)/include \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) From b68d7a31c505368ba6ff735b541390d2d875022f Mon Sep 17 00:00:00 2001 From: merge-script Date: Mon, 2 Feb 2026 10:45:06 +0000 Subject: [PATCH 3/8] Merge bitcoin/bitcoin#34036: contrib: update macOS SDK to Xcode-26.1.1-17B100 a89e1618dd8c2ae655093c947fc3f51a34aad1a0 contrib: update macOS SDK to Xcode-26.1.1-17B100 (fanquake) 57a778ed25264686e2da821b3d5caa249f079657 depends: use -Xclang -fno-cxx-modules in macOS cross build (fanquake) Pull request description: Updates the macOS SDK used for Guix builds to `Xcode-26.1.1-17B100`. Closes #34034. ACKs for top commit: hebasto: ACK a89e1618dd8c2ae655093c947fc3f51a34aad1a0. sedited: ACK a89e1618dd8c2ae655093c947fc3f51a34aad1a0 janb84: concept ACK a89e1618dd8c2ae655093c947fc3f51a34aad1a0 Tree-SHA512: 4f8f9afee6fca594a0d30fbb3c150f5ed120b40f707954678ff69951bc806acc154aed4b5986d8642160f7b37523933c87c5734f296ff881555093188e29549e --- ci/test/00_setup_env_mac.sh | 4 ++-- contrib/containers/guix/scripts/setup-sdk | 6 +++--- contrib/guix/README.md | 2 +- contrib/macdeploy/README.md | 14 +++++++------- depends/hosts/darwin.mk | 14 ++++++++++---- 5 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ci/test/00_setup_env_mac.sh b/ci/test/00_setup_env_mac.sh index ca04e916fc2a..1c1a738e107d 100755 --- a/ci/test/00_setup_env_mac.sh +++ b/ci/test/00_setup_env_mac.sh @@ -9,8 +9,8 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_macos_cross export HOST=x86_64-apple-darwin export PACKAGES="clang cmake lld llvm zip" -export XCODE_VERSION=15.0 -export XCODE_BUILD_ID=15A240d +export XCODE_VERSION=26.1.1 +export XCODE_BUILD_ID=17B100 export RUN_UNIT_TESTS=false export RUN_FUNCTIONAL_TESTS=false export GOAL="all deploy" diff --git a/contrib/containers/guix/scripts/setup-sdk b/contrib/containers/guix/scripts/setup-sdk index cd2bb64e966e..c5124a92322c 100755 --- a/contrib/containers/guix/scripts/setup-sdk +++ b/contrib/containers/guix/scripts/setup-sdk @@ -10,10 +10,10 @@ set -eo pipefail SDK_URL="${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}" SDK_PATH="${SDK_PATH:-depends/SDKs}" SDK_SOURCES="${SDK_SOURCES:-depends/sdk-sources}" -XCODE_VERSION="${XCODE_VERSION:-15.0}" -XCODE_RELEASE="${XCODE_RELEASE:-15A240d}" +XCODE_VERSION="${XCODE_VERSION:-26.1.1}" +XCODE_RELEASE="${XCODE_RELEASE:-17B100}" XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers" -XCODE_AR_HASH="${XCODE_AR_HASH:-bce59aa16560f182e44200a0b9539bd637c8b5c7089fbff13b0712730ce162ff}" +XCODE_AR_HASH="${XCODE_AR_HASH:-f4c65b01e2807372b61553c71036dbfef492d7c79d4c380a5afb61aa1018e555}" XCODE_AR_PATH="${SDK_SOURCES}/${XCODE_ARCHIVE}.tar.gz" if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 5e468c783977..34e675b6d16e 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -249,7 +249,7 @@ details. Set the path where _extracted_ SDKs can be found. This is passed through to the depends tree. Note that this is should be set to the _parent_ directory of the actual SDK (e.g. `SDK_PATH=$HOME/Downloads/macOS-SDKs` instead of - `$HOME/Downloads/macOS-SDKs/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers`). + `$HOME/Downloads/macOS-SDKs/Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers`). The path that this environment variable points to **must be a directory**, and **NOT a symlink to a directory**. diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index cf32a07602d3..8d163751e473 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -15,14 +15,14 @@ When complete, it will have produced `Dash-Core.zip`. A free Apple Developer Account is required to proceed. Our macOS SDK can be extracted from -[Xcode_15.xip](https://download.developer.apple.com/Developer_Tools/Xcode_15/Xcode_15.xip). +[Xcode_26.1.1_Apple_silicon.xip](https://download.developer.apple.com/Developer_Tools/Xcode_26.1.1/Xcode_26.1.1_Apple_silicon.xip). Alternatively, after logging in to your account go to 'Downloads', then 'More' -and search for [`Xcode 15`](https://developer.apple.com/download/all/?q=Xcode%2015). +and search for [`Xcode 26.1.1`](https://developer.apple.com/download/all/?q=Xcode%2026.1.1). An Apple ID and cookies enabled for the hostname are needed to download this. -The `sha256sum` of the downloaded XIP archive should be `4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e`. +The `sha256sum` of the downloaded XIP archive should be `f4c65b01e2807372b61553c71036dbfef492d7c79d4c380a5afb61aa1018e555`. To extract the `.xip` on Linux: @@ -33,13 +33,13 @@ git clone https://github.com/bitcoin-core/apple-sdk-tools.git # Unpack the .xip and place the resulting Xcode.app in your current # working directory -python3 apple-sdk-tools/extract_xcode.py -f Xcode_15.xip | cpio -d -i +python3 apple-sdk-tools/extract_xcode.py -f Xcode_26.1.1_Apple_silicon.xip | cpio -d -i ``` On macOS: ```bash -xip -x Xcode_15.xip +xip -x Xcode_26.1.1_Apple_silicon.xip ``` ### Step 2: Generating the SDK tarball from `Xcode.app` @@ -51,8 +51,8 @@ path to `Xcode.app` (extracted in the previous stage) as the first argument. ./contrib/macdeploy/gen-sdk '/path/to/Xcode.app' ``` -The generated archive should be: `Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz`. -The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d`. +The generated archive should be: `Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers.tar`. +The `sha256sum` should be `9600fa93644df674ee916b5e2c8a6ba8dacf631996a65dc922d003b98b5ea3b1`. ## Deterministic macOS App Notes diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index 5c69b4287966..db35d4c709ce 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,7 +1,7 @@ OSX_MIN_VERSION=14.0 -OSX_SDK_VERSION=14.0 -XCODE_VERSION=15.0 -XCODE_BUILD_ID=15A240d +OSX_SDK_VERSION=15.0 +XCODE_VERSION=26.1.1 +XCODE_BUILD_ID=17B100 LLD_VERSION=711 OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers @@ -50,6 +50,12 @@ darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip") # # Disable adhoc codesigning (for now) when using LLVM tooling, to avoid # non-determinism issues with the Identifier field. +# +# -Xclang -fno-cxx-modules +# +# Disable C++ modules. We don't use these, and modules cause definition issues +# in the SDK, where __has_feature(modules) is used to define USE_CLANG_TYPES, +# which is in turn used as an include guard. darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clang_prog) --target=$(host) \ -isysroot$(OSX_SDK) -nostdlibinc \ @@ -61,7 +67,7 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clangxx_prog) --target= -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) -darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) +darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) -Xclang -fno-cxx-modules darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION) ifneq ($(build_os),darwin) From 153959e3da3d410ef8ed8474dacde606afe9d57c Mon Sep 17 00:00:00 2001 From: merge-script Date: Thu, 27 Nov 2025 15:03:46 +0000 Subject: [PATCH 4/8] Merge bitcoin/bitcoin#32009: contrib: turn off compression of macOS SDK to fix determinism (across distros) 3e01b5d0e7be3dabe7f52d70e577f03f31505ad9 contrib: rename gen-sdk to gen-sdk.py (fanquake) c1213a35abed01a97a9c52954919158f91f974d2 macdeploy: disable compression in macOS gen-sdk script (fanquake) a33d03454508187abed764e55351ffcececc4c6e contrib: more selectively pick files for macOS SDK (fanquake) Pull request description: This includes three changes. The first is to more selectively pick files for inclusion into our macOS SDK tarball (skip manpages, binaries etc), which is nice because it redues the size of the tarball (from ~80mb to 20mb), and makes the size increase that happens with the next commit, less-bad. The second change removes compression of the tarball. Starting with Python 3.11, Pythons gzip might delegate to zlib. Depending on the OS, i.e Ubuntu vs Fedora, the underlying zlib implementation might differ, resulting in different output. For now, or until a better solution exists, remove compression. This results in the SDK increasing in size to ~157mb. Which is not unreasonable, to regain determinism (and would be significantly worse without the previous commit). See: https://docs.python.org/3/library/gzip.html#gzip.compress The third renames `gen-sdk` to `gen-sdk.py`, so that it will be linted, along with the rest of our Python files. Fixes #31873. We could probably also put this into 30.x. ACKs for top commit: stickies-v: ACK 3e01b5d0e7 modulo the new .tar SDK being uploaded davidgumberg: Tested ACK 3e01b5d0e7be3d Tree-SHA512: 272164a98e0e6f10822870162c1b3a405693c2f64d3ed085a2d2243a48641d940704b5ef6022256915ac9cf383e87a4f8d4dc2ec4eaa9d25e2abd30f5498778b --- contrib/containers/guix/scripts/setup-sdk | 4 +-- contrib/guix/README.md | 2 +- contrib/macdeploy/README.md | 4 +-- contrib/macdeploy/{gen-sdk => gen-sdk.py} | 37 +++++++++++------------ 4 files changed, 22 insertions(+), 25 deletions(-) rename contrib/macdeploy/{gen-sdk => gen-sdk.py} (74%) diff --git a/contrib/containers/guix/scripts/setup-sdk b/contrib/containers/guix/scripts/setup-sdk index c5124a92322c..07da61769e7e 100755 --- a/contrib/containers/guix/scripts/setup-sdk +++ b/contrib/containers/guix/scripts/setup-sdk @@ -14,13 +14,13 @@ XCODE_VERSION="${XCODE_VERSION:-26.1.1}" XCODE_RELEASE="${XCODE_RELEASE:-17B100}" XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers" XCODE_AR_HASH="${XCODE_AR_HASH:-f4c65b01e2807372b61553c71036dbfef492d7c79d4c380a5afb61aa1018e555}" -XCODE_AR_PATH="${SDK_SOURCES}/${XCODE_ARCHIVE}.tar.gz" +XCODE_AR_PATH="${SDK_SOURCES}/${XCODE_ARCHIVE}.tar" if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then if [ ! -f "${XCODE_AR_PATH}" ]; then echo "Downloading macOS SDK..." mkdir -p "${SDK_SOURCES}" - curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar.gz" -o "${XCODE_AR_PATH}" + curl --location --fail "${SDK_URL}/${XCODE_ARCHIVE}.tar" -o "${XCODE_AR_PATH}" fi echo "Verifying macOS SDK..." if [ "$(sha256sum "${XCODE_AR_PATH}" | cut -d' ' -f1)" != "${XCODE_AR_HASH}" ]; then diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 34e675b6d16e..cb7eb134a2e6 100644 --- a/contrib/guix/README.md +++ b/contrib/guix/README.md @@ -37,7 +37,7 @@ You can then either point to the SDK using the `SDK_PATH` environment variable: ```sh # Extract the SDK tarball to /path/to/parent/dir/of/extracted/SDK/Xcode---extracted-SDK-with-libcxx-headers -tar -C /path/to/parent/dir/of/extracted/SDK -xaf /path/to/Xcode---extracted-SDK-with-libcxx-headers.tar.gz +tar -C /path/to/parent/dir/of/extracted/SDK -xaf /path/to/Xcode---extracted-SDK-with-libcxx-headers.tar # Indicate where to locate the SDK tarball export SDK_PATH=/path/to/parent/dir/of/extracted/SDK diff --git a/contrib/macdeploy/README.md b/contrib/macdeploy/README.md index 8d163751e473..addfe5891358 100644 --- a/contrib/macdeploy/README.md +++ b/contrib/macdeploy/README.md @@ -44,11 +44,11 @@ xip -x Xcode_26.1.1_Apple_silicon.xip ### Step 2: Generating the SDK tarball from `Xcode.app` -To generate the SDK, run the script [`gen-sdk`](./gen-sdk) with the +To generate the SDK, run the script [`gen-sdk.py`](./gen-sdk.py) with the path to `Xcode.app` (extracted in the previous stage) as the first argument. ```bash -./contrib/macdeploy/gen-sdk '/path/to/Xcode.app' +./contrib/macdeploy/gen-sdk.py '/path/to/Xcode.app' ``` The generated archive should be: `Xcode-26.1.1-17B100-extracted-SDK-with-libcxx-headers.tar`. diff --git a/contrib/macdeploy/gen-sdk b/contrib/macdeploy/gen-sdk.py similarity index 74% rename from contrib/macdeploy/gen-sdk rename to contrib/macdeploy/gen-sdk.py index 86a6262b5ce4..d92da060359c 100755 --- a/contrib/macdeploy/gen-sdk +++ b/contrib/macdeploy/gen-sdk.py @@ -2,9 +2,7 @@ import argparse import plistlib import pathlib -import sys import tarfile -import gzip import os import contextlib @@ -22,12 +20,12 @@ def run(): parser = argparse.ArgumentParser( description=__doc__, formatter_class=argparse.RawTextHelpFormatter) - parser.add_argument('xcode_app', metavar='XCODEAPP', nargs=1) - parser.add_argument("-o", metavar='OUTSDKTGZ', nargs=1, dest='out_sdktgz', required=False) + parser.add_argument('xcode_app', metavar='XCODEAPP', type=pathlib.Path) + parser.add_argument("-o", metavar='OUTSDKTAR', dest='out_sdkt', type=pathlib.Path, required=False) args = parser.parse_args() - xcode_app = pathlib.Path(args.xcode_app[0]).resolve() + xcode_app = args.xcode_app.resolve() assert xcode_app.is_dir(), "The supplied Xcode.app path '{}' either does not exist or is not a directory".format(xcode_app) xcode_app_plist = xcode_app.joinpath("Contents/version.plist") @@ -47,11 +45,7 @@ def run(): out_name = "Xcode-{xcode_version}-{xcode_build_id}-extracted-SDK-with-libcxx-headers".format(xcode_version=xcode_version, xcode_build_id=xcode_build_id) - if args.out_sdktgz: - out_sdktgz_path = pathlib.Path(args.out_sdktgz_path) - else: - # Construct our own out_sdktgz if not specified on the command line - out_sdktgz_path = pathlib.Path("./{}.tar.gz".format(out_name)) + out_sdkt_path = args.out_sdkt or pathlib.Path("./{}.tar".format(out_name)) def tarfp_add_with_base_change(tarfp, dir_to_add, alt_base_dir): """Add all files in dir_to_add to tarfp, but prepent alt_base_dir to the files' @@ -68,6 +62,8 @@ def tarfp_add_with_base_change(tarfp, dir_to_add, alt_base_dir): """ def change_tarinfo_base(tarinfo): + if tarinfo.name and tarinfo.name.endswith((".swiftmodule", ".modulemap")): + return None if tarinfo.name and tarinfo.name.startswith("./"): tarinfo.name = str(pathlib.Path(alt_base_dir, tarinfo.name)) if tarinfo.linkname and tarinfo.linkname.startswith("./"): @@ -81,16 +77,17 @@ def change_tarinfo_base(tarinfo): return tarinfo with cd(dir_to_add): # recursion already adds entries in sorted order - tarfp.add(".", recursive=True, filter=change_tarinfo_base) - - print("Creating output .tar.gz file...") - with out_sdktgz_path.open("wb") as fp: - with gzip.GzipFile(fileobj=fp, mode='wb', compresslevel=9, mtime=0) as gzf: - with tarfile.open(mode="w", fileobj=gzf, format=tarfile.GNU_FORMAT) as tarfp: - print("Adding MacOSX SDK {} files...".format(sdk_version)) - tarfp_add_with_base_change(tarfp, sdk_dir, out_name) - print("Done! Find the resulting gzipped tarball at:") - print(out_sdktgz_path.resolve()) + tarfp.add("./usr/include", recursive=True, filter=change_tarinfo_base) + tarfp.add("./usr/lib", recursive=True, filter=change_tarinfo_base) + tarfp.add("./System/Library/Frameworks", recursive=True, filter=change_tarinfo_base) + + print("Creating output .tar file...") + with out_sdkt_path.open("wb") as fp: + with tarfile.open(mode="w", fileobj=fp, format=tarfile.PAX_FORMAT) as tarfp: + print("Adding MacOSX SDK {} files...".format(sdk_version)) + tarfp_add_with_base_change(tarfp, sdk_dir, out_name) + print("Done! Find the resulting tarball at:") + print(out_sdkt_path.resolve()) if __name__ == '__main__': run() From 3dc462454f30c625748798c4b9d5f429bc0dff06 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sun, 1 Mar 2026 21:48:22 +0700 Subject: [PATCH 5/8] fix: hash of archive and extra debug output --- contrib/containers/guix/scripts/setup-sdk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/contrib/containers/guix/scripts/setup-sdk b/contrib/containers/guix/scripts/setup-sdk index 07da61769e7e..1dd8e6dc4597 100755 --- a/contrib/containers/guix/scripts/setup-sdk +++ b/contrib/containers/guix/scripts/setup-sdk @@ -13,7 +13,7 @@ SDK_SOURCES="${SDK_SOURCES:-depends/sdk-sources}" XCODE_VERSION="${XCODE_VERSION:-26.1.1}" XCODE_RELEASE="${XCODE_RELEASE:-17B100}" XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers" -XCODE_AR_HASH="${XCODE_AR_HASH:-f4c65b01e2807372b61553c71036dbfef492d7c79d4c380a5afb61aa1018e555}" +XCODE_AR_HASH="${XCODE_AR_HASH:-9600fa93644df674ee916b5e2c8a6ba8dacf631996a65dc922d003b98b5ea3b1}" XCODE_AR_PATH="${SDK_SOURCES}/${XCODE_ARCHIVE}.tar" if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then @@ -25,6 +25,7 @@ if [ ! -d "${SDK_PATH}/${XCODE_ARCHIVE}" ]; then echo "Verifying macOS SDK..." if [ "$(sha256sum "${XCODE_AR_PATH}" | cut -d' ' -f1)" != "${XCODE_AR_HASH}" ]; then echo "ERROR: Checksum mismatch for ${XCODE_AR_PATH}" + sha256sum "${XCODE_AR_PATH}" exit 1 fi echo "Extracting macOS SDK..." From e4ad957bea3e30256a3afedd4fc0f3013f8e8720 Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Sun, 1 Mar 2026 21:51:59 +0700 Subject: [PATCH 6/8] fix: minimum sdk & minumum xcode are not the same --- depends/hosts/darwin.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index db35d4c709ce..ef34e06093ad 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -1,5 +1,5 @@ OSX_MIN_VERSION=14.0 -OSX_SDK_VERSION=15.0 +OSX_SDK_VERSION=14.0 XCODE_VERSION=26.1.1 XCODE_BUILD_ID=17B100 LLD_VERSION=711 From 63e9f7c8e01fd29c26082e7132036301724eadb3 Mon Sep 17 00:00:00 2001 From: Ava Chow Date: Wed, 30 Jul 2025 13:56:14 -0700 Subject: [PATCH 7/8] Merge bitcoin/bitcoin#32584: depends: hard-code necessary c(xx)flags rather than setting them per-host 9954d6c833381a44e1ea34d182ffe4d61b65d2ba depends: hard-code necessary c(xx)flags rather than setting them per-host (Cory Fields) Pull request description: The per-host flag variables hold platform-specific defaults that are ignored when flag environment variables are set, so it was wrong for them to contain -std options relied on by package definitions. Additionally, these flags (-pipe and -std=xx) will no longer be passed into the CMake build, meaning less duplication in the build summary. Pulled out of #31920. ACKs for top commit: achow101: ACK 9954d6c833381a44e1ea34d182ffe4d61b65d2ba ryanofsky: Code review ACK 9954d6c833381a44e1ea34d182ffe4d61b65d2ba. No changes since last review other than improving the commit message. Change overall makes sense because it deduplicates host definitions, stops dropping `-std` flags from package builds when custom CFLAGS/CXXFLAGS environment variables are set, and stops passing duplicate flags to cmake that have no effect. theuni: ACK 9954d6c833381a44e1ea34d182ffe4d61b65d2ba Tree-SHA512: 62a2a21b741893cf708ca71fb5f0626c30d52685c845f9016f428a5e38fc8515acd4bf2c83635d6505b63830d1c296472026ec3d341c8069f1e490a991b6b5ef --- depends/funcs.mk | 6 ++++-- depends/hosts/darwin.mk | 4 ++-- depends/hosts/freebsd.mk | 4 ++-- depends/hosts/linux.mk | 4 ++-- depends/hosts/mingw32.mk | 4 ++-- depends/hosts/netbsd.mk | 4 ++-- depends/hosts/openbsd.mk | 4 ++-- 7 files changed, 16 insertions(+), 14 deletions(-) diff --git a/depends/funcs.mk b/depends/funcs.mk index ec514600b7fb..566f83a9868e 100644 --- a/depends/funcs.mk +++ b/depends/funcs.mk @@ -8,9 +8,11 @@ $(1)_ar=$$($$($(1)_type)_AR) $(1)_ranlib=$$($$($(1)_type)_RANLIB) $(1)_nm=$$($$($(1)_type)_NM) $(1)_cflags=$$($$($(1)_type)_CFLAGS) \ - $$($$($(1)_type)_$$(release_type)_CFLAGS) + $$($$($(1)_type)_$$(release_type)_CFLAGS) \ + -pipe -std=$(C_STANDARD) $(1)_cxxflags=$$($$($(1)_type)_CXXFLAGS) \ - $$($$($(1)_type)_$$(release_type)_CXXFLAGS) + $$($$($(1)_type)_$$(release_type)_CXXFLAGS) \ + -pipe -std=$(CXX_STANDARD) $(1)_ldflags=$$($$($(1)_type)_LDFLAGS) \ $$($$($(1)_type)_$$(release_type)_LDFLAGS) \ -L$$($($(1)_type)_prefix)/lib diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index ef34e06093ad..a5d3930e5608 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -66,8 +66,8 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clangxx_prog) --target= -iwithsysroot/usr/include/c++/v1 \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks -darwin_CFLAGS=-pipe -std=$(C_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) -darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) -Xclang -fno-cxx-modules +darwin_CFLAGS=-mmacos-version-min=$(OSX_MIN_VERSION) +darwin_CXXFLAGS=-mmacos-version-min=$(OSX_MIN_VERSION) -Xclang -fno-cxx-modules darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION) ifneq ($(build_os),darwin) diff --git a/depends/hosts/freebsd.mk b/depends/hosts/freebsd.mk index 009d215f82f8..b69535cc800e 100644 --- a/depends/hosts/freebsd.mk +++ b/depends/hosts/freebsd.mk @@ -1,5 +1,5 @@ -freebsd_CFLAGS=-pipe -std=$(C_STANDARD) -freebsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD) +freebsd_CFLAGS= +freebsd_CXXFLAGS= freebsd_release_CFLAGS=-O2 freebsd_release_CXXFLAGS=$(freebsd_release_CFLAGS) diff --git a/depends/hosts/linux.mk b/depends/hosts/linux.mk index e2f34265d153..41958f9978be 100644 --- a/depends/hosts/linux.mk +++ b/depends/hosts/linux.mk @@ -1,5 +1,5 @@ -linux_CFLAGS=-pipe -std=$(C_STANDARD) -linux_CXXFLAGS=-pipe -std=$(CXX_STANDARD) +linux_CFLAGS= +linux_CXXFLAGS= ifneq ($(LTO),) linux_AR = $(host_toolchain)gcc-ar diff --git a/depends/hosts/mingw32.mk b/depends/hosts/mingw32.mk index 48db7fe863dd..d838e40ed4eb 100644 --- a/depends/hosts/mingw32.mk +++ b/depends/hosts/mingw32.mk @@ -2,8 +2,8 @@ ifneq ($(shell $(SHELL) $(.SHELLFLAGS) "command -v $(host)-g++-posix"),) mingw32_CXX := $(host)-g++-posix endif -mingw32_CFLAGS=-pipe -std=$(C_STANDARD) -mingw32_CXXFLAGS=-pipe -std=$(CXX_STANDARD) +mingw32_CFLAGS= +mingw32_CXXFLAGS= ifneq ($(LTO),) mingw32_AR = $(host_toolchain)gcc-ar diff --git a/depends/hosts/netbsd.mk b/depends/hosts/netbsd.mk index d2b79f9d5bf3..0e1256c34e89 100644 --- a/depends/hosts/netbsd.mk +++ b/depends/hosts/netbsd.mk @@ -1,5 +1,5 @@ -netbsd_CFLAGS=-pipe -std=$(C_STANDARD) -netbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD) +netbsd_CFLAGS= +netbsd_CXXFLAGS= ifneq ($(LTO),) netbsd_AR = $(host_toolchain)gcc-ar diff --git a/depends/hosts/openbsd.mk b/depends/hosts/openbsd.mk index 53595689b62e..5ab3f53eae64 100644 --- a/depends/hosts/openbsd.mk +++ b/depends/hosts/openbsd.mk @@ -1,5 +1,5 @@ -openbsd_CFLAGS=-pipe -std=$(C_STANDARD) -openbsd_CXXFLAGS=-pipe -std=$(CXX_STANDARD) +openbsd_CFLAGS= +openbsd_CXXFLAGS= openbsd_release_CFLAGS=-O2 openbsd_release_CXXFLAGS=$(openbsd_release_CFLAGS) From 2c779e34aa38497080b1a8e07c1fe4c9077dc3bd Mon Sep 17 00:00:00 2001 From: Konstantin Akimov Date: Mon, 2 Mar 2026 03:31:12 +0700 Subject: [PATCH 8/8] docs: TODO to reapply reverted part of bitcoin#30451 See #7184 (d201e4396c85d24e9bd79b3ace8356759001747a) --- depends/hosts/darwin.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk index a5d3930e5608..977931c14855 100644 --- a/depends/hosts/darwin.mk +++ b/depends/hosts/darwin.mk @@ -57,10 +57,14 @@ darwin_STRIP=$(shell $(SHELL) $(.SHELLFLAGS) "command -v llvm-strip") # in the SDK, where __has_feature(modules) is used to define USE_CLANG_TYPES, # which is in turn used as an include guard. +# TODO: remove C_INCLUDE_PATH when it is indeed useless +# https://github.com/bitcoin/bitcoin/pull/30451 has been partiall reverted in #7184 and should be re-applied darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clang_prog) --target=$(host) \ -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include -iframeworkwithsysroot/System/Library/Frameworks +# TODO: remove C_INCLUDE_PATH when it is indeed useless +# https://github.com/bitcoin/bitcoin/pull/30451 has been partiall reverted in #7184 and should be re-applied darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH $(clangxx_prog) --target=$(host) \ -isysroot$(OSX_SDK) -nostdlibinc \ -iwithsysroot/usr/include/c++/v1 \