Skip to content
2 changes: 1 addition & 1 deletion ci/test/00_setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 3 additions & 3 deletions ci/test/00_setup_env_mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 7 additions & 6 deletions contrib/containers/guix/scripts/setup-sdk
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
4 changes: 2 additions & 2 deletions contrib/guix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<foo>-<bar>-extracted-SDK-with-libcxx-headers
tar -C /path/to/parent/dir/of/extracted/SDK -xaf /path/to/Xcode-<foo>-<bar>-extracted-SDK-with-libcxx-headers.tar.gz
tar -C /path/to/parent/dir/of/extracted/SDK -xaf /path/to/Xcode-<foo>-<bar>-extracted-SDK-with-libcxx-headers.tar

# Indicate where to locate the SDK tarball
export SDK_PATH=/path/to/parent/dir/of/extracted/SDK
Expand Down Expand Up @@ -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**.
Expand Down
4 changes: 2 additions & 2 deletions contrib/guix/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
18 changes: 9 additions & 9 deletions contrib/macdeploy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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

Expand Down
37 changes: 17 additions & 20 deletions contrib/macdeploy/gen-sdk → contrib/macdeploy/gen-sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import argparse
import plistlib
import pathlib
import sys
import tarfile
import gzip
import os
import contextlib

Expand All @@ -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")
Expand All @@ -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'
Expand All @@ -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("./"):
Expand All @@ -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()
6 changes: 4 additions & 2 deletions depends/funcs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
32 changes: 19 additions & 13 deletions depends/hosts/darwin.mk
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")
Expand Down Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions depends/hosts/freebsd.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 2 additions & 2 deletions depends/hosts/linux.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions depends/hosts/mingw32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions depends/hosts/netbsd.mk
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions depends/hosts/openbsd.mk
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
Loading