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..1c1a738e107d 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=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 8034fa63d581..1dd8e6dc4597 100755 --- a/contrib/containers/guix/scripts/setup-sdk +++ b/contrib/containers/guix/scripts/setup-sdk @@ -7,24 +7,25 @@ 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:-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_PATH="${SDK_SOURCES}/${XCODE_ARCHIVE}.tar.gz" +XCODE_AR_HASH="${XCODE_AR_HASH:-9600fa93644df674ee916b5e2c8a6ba8dacf631996a65dc922d003b98b5ea3b1}" +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 echo "ERROR: Checksum mismatch for ${XCODE_AR_PATH}" + sha256sum "${XCODE_AR_PATH}" exit 1 fi echo "Extracting macOS SDK..." diff --git a/contrib/guix/README.md b/contrib/guix/README.md index 366ba7dfc951..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 @@ -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-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/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..addfe5891358 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_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 16`](https://developer.apple.com/download/all/?q=Xcode%2016). +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 `4a26c3d102a55c7222fb145e0ee1503249c9c26c6e02dc64d783c8810b37b1e3`. +The `sha256sum` of the downloaded XIP archive should be `f4c65b01e2807372b61553c71036dbfef492d7c79d4c380a5afb61aa1018e555`. To extract the `.xip` on Linux: @@ -33,26 +33,26 @@ 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_26.1.1_Apple_silicon.xip | cpio -d -i ``` On macOS: ```bash -xip -x Xcode_16.xip +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-16.0-16A242d-extracted-SDK-with-libcxx-headers.tar.gz`. -The `sha256sum` should be `bce59aa16560f182e44200a0b9539bd637c8b5c7089fbff13b0712730ce162ff`. +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/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() 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 eb5e3d15b3d7..977931c14855 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=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 @@ -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") @@ -52,20 +50,28 @@ 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. +# 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) -nostdinc \ - -isystem$(clang_resource_dir)/include \ + -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) -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) -darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD) -mmacos-version-min=$(OSX_MIN_VERSION) +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)