Skip to content

Commit c90461e

Browse files
fanquakePastaPastaPasta
authored andcommitted
build: use macOS 14 SDK (Xcode 15.0)
# Conflicts: # ci/test/00_setup_env_mac.sh # contrib/macdeploy/README.md # contrib/macdeploy/gen-sdk # depends/hosts/darwin.mk
1 parent 3608e16 commit c90461e

File tree

5 files changed

+29
-34
lines changed

5 files changed

+29
-34
lines changed

ci/test/00_setup_env_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export LC_ALL=C.UTF-8
99
export CONTAINER_NAME=ci_macos_cross
1010
export HOST=x86_64-apple-darwin
1111
export PACKAGES="cmake libcap-dev libz-dev libbz2-dev python3-dev python3-setuptools"
12-
export XCODE_VERSION=12.2
13-
export XCODE_BUILD_ID=12B45b
12+
export XCODE_VERSION=15.0
13+
export XCODE_BUILD_ID=15A240d
1414
export RUN_UNIT_TESTS=false
1515
export RUN_INTEGRATION_TESTS=false
1616
export GOAL="all deploy"

contrib/devtools/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ def check_MACHO_min_os(binary) -> bool:
224224
return False
225225

226226
def check_MACHO_sdk(binary) -> bool:
227-
if binary.build_version.sdk == [11, 0, 0]:
227+
if binary.build_version.sdk == [14, 0, 0]:
228228
return True
229229
return False
230230

contrib/macdeploy/README.md

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -12,50 +12,49 @@ When complete, it will have produced `Dash-Qt.dmg`.
1212

1313
### Step 1: Obtaining `Xcode.app`
1414

15-
Our current macOS SDK
16-
(`Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz`) can be
15+
Our macOS SDK can be
1716
extracted from
18-
[Xcode_12.2.xip](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip).
17+
[Xcode_15.xip](https://download.developer.apple.com/Developer_Tools/Xcode_15/Xcode_15.xip).
1918
Alternatively, after logging in to your account go to 'Downloads', then 'More'
20-
and look for [`Xcode_12.2`](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip).
19+
and search for [`Xcode 15`](https://developer.apple.com/download/all/?q=Xcode%2015).
20+
2121
An Apple ID and cookies enabled for the hostname are needed to download this.
22-
The `sha256sum` of the archive should be `28d352f8c14a43d9b8a082ac6338dc173cb153f964c6e8fb6ba389e5be528bd0`.
22+
The `sha256sum` of the archive should be `4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e`.
2323

24-
After Xcode version 7.x, Apple started shipping the `Xcode.app` in a `.xip`
25-
archive. This makes the SDK less-trivial to extract on non-macOS machines. One
26-
approach (tested on Debian Buster) is outlined below:
24+
To extract the `.xip` on Linux:
2725

2826
```bash
2927
# Install/clone tools needed for extracting Xcode.app
3028
apt install cpio
3129
git clone https://github.com/bitcoin-core/apple-sdk-tools.git
3230

33-
# Unpack Xcode_12.2.xip and place the resulting Xcode.app in your current
31+
# Unpack the .xip and place the resulting Xcode.app in your current
3432
# working directory
35-
python3 apple-sdk-tools/extract_xcode.py -f Xcode_12.2.xip | cpio -d -i
33+
python3 apple-sdk-tools/extract_xcode.py -f Xcode_15.xip | cpio -d -i
3634
```
3735

38-
On macOS the process is more straightforward:
36+
On macOS:
3937

4038
```bash
41-
xip -x Xcode_12.2.xip
39+
xip -x Xcode_15.xip
4240
```
4341

44-
### Step 2: Generating `Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz` from `Xcode.app`
42+
### Step 2: Generating the SDK tarball from `Xcode.app`
4543

46-
To generate `Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz`, run
47-
the script [`gen-sdk`](./gen-sdk) with the path to `Xcode.app` (extracted in the
48-
previous stage) as the first argument.
44+
To generate the SDK, run the script [`gen-sdk`](./gen-sdk) with the
45+
path to `Xcode.app` (extracted in the previous stage) as the first argument.
4946

5047
```bash
51-
# Generate a Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz from
52-
# the supplied Xcode.app
5348
./contrib/macdeploy/gen-sdk '/path/to/Xcode.app'
5449
```
5550

56-
## Deterministic macOS DMG Notes
57-
Working macOS DMGs are created in Linux by combining a recent `clang`, the Apple
58-
`binutils` (`ld`, `ar`, etc) and DMG authoring tools.
51+
The generated archive should be: `Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz`.
52+
The `sha256sum` should be `70cccc19df2fc1746bfddf939bf7370eb0b3d8f5f7198896358fa1ebde37e9e7`.
53+
54+
## Deterministic macOS App Notes
55+
56+
macOS Applications are created in Linux by combining a recent `clang` and the Apple
57+
`binutils` (`ld`, `ar`, etc).
5958

6059
Apple uses `clang` extensively for development and has upstreamed the necessary
6160
functionality so that a vanilla clang can take advantage. It supports the use of `-F`,

contrib/macdeploy/gen-sdk

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,14 @@ def run():
4747

4848
out_name = "Xcode-{xcode_version}-{xcode_build_id}-extracted-SDK-with-libcxx-headers".format(xcode_version=xcode_version, xcode_build_id=xcode_build_id)
4949

50-
xcode_libcxx_dir = xcode_app.joinpath("Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1")
51-
assert xcode_libcxx_dir.is_dir()
52-
5350
if args.out_sdktgz:
5451
out_sdktgz_path = pathlib.Path(args.out_sdktgz_path)
5552
else:
5653
# Construct our own out_sdktgz if not specified on the command line
5754
out_sdktgz_path = pathlib.Path("./{}.tar.gz".format(out_name))
5855

5956
def tarfp_add_with_base_change(tarfp, dir_to_add, alt_base_dir):
60-
"""Add all files in dir_to_add to tarfp, but prepent MEMBERPREFIX to the file's
57+
"""Add all files in dir_to_add to tarfp, but prepent alt_base_dir to the file's
6158
name
6259
6360
e.g. if the only file under /root/bazdir is /root/bazdir/qux, invoking:
@@ -77,16 +74,15 @@ def run():
7774
tarinfo.linkname = str(pathlib.Path(alt_base_dir, tarinfo.linkname))
7875
return tarinfo
7976
with cd(dir_to_add):
80-
tarfp.add(".", recursive=True, filter=change_tarinfo_base)
77+
tarfp.add("./usr/include", recursive=True, filter=change_tarinfo_base)
78+
tarfp.add("./usr/lib", recursive=True, filter=change_tarinfo_base)
8179

8280
print("Creating output .tar.gz file...")
8381
with out_sdktgz_path.open("wb") as fp:
8482
with gzip.GzipFile(fileobj=fp, mode='wb', compresslevel=9, mtime=0) as gzf:
8583
with tarfile.open(mode="w", fileobj=gzf) as tarfp:
8684
print("Adding MacOSX SDK {} files...".format(sdk_version))
8785
tarfp_add_with_base_change(tarfp, sdk_dir, out_name)
88-
print("Adding libc++ headers...")
89-
tarfp_add_with_base_change(tarfp, xcode_libcxx_dir, "{}/usr/include/c++/v1".format(out_name))
9086
print("Done! Find the resulting gzipped tarball at:")
9187
print(out_sdktgz_path.resolve())
9288

depends/hosts/darwin.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OSX_MIN_VERSION=10.15
2-
OSX_SDK_VERSION=11.0
3-
XCODE_VERSION=12.2
4-
XCODE_BUILD_ID=12B45b
2+
OSX_SDK_VERSION=14.0
3+
XCODE_VERSION=15.0
4+
XCODE_BUILD_ID=15A240d
55
LD64_VERSION=609
66

77
OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers

0 commit comments

Comments
 (0)