On Fedora 40, following the instructions in contrib/macdeploy/README.md
to generate the macOS SDK tarball that is used during GUIX builds, I am not able to reproduce the hash in the readme for the generated tarball. I have reproduced this on two different Fedora 40 machines, and with a Fedora 40 docker image, but the issue does not appear when generating the tarball in an Ubuntu 24.04 docker image, or on a macOS Sequoia arm device, I’ve included reproduction instructions below.
Steps to reproduce
You first have to acquire the Xcode_15.xip
archive according to the instructions in contrib/macdeploy/README.md
. The steps below assume you have placed this archive at ~/xcode/Xcode_15.xip
.
Making the bad tarball using Fedora 40
Container setup
0sha256sum ~/xcode/Xcode_15.xip
1# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /home/user/xcode/Xcode_15.xip
2docker pull fedora:40
3docker run -it \
4 -v ~/xcode:/xcode \
5 fedora:40 \
6 /bin/bash
In the container
0sha256sum /xcode/Xcode_15.xip
1# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /xcode/Xcode_15.xip
2dnf install cpio git python -y
3git clone --depth 1 https://github.com/bitcoin/bitcoin.git
4git clone --depth 1 https://github.com/bitcoin-core/apple-sdk-tools.git
5python3 apple-sdk-tools/extract_xcode.py -f /xcode/Xcode_15.xip | cpio -d -i
6# 23498380 blocks
7/bitcoin/contrib/macdeploy/gen-sdk Xcode.app/
8# Found Xcode (version: 15.0, build id: 15A240d)
9# Found MacOSX SDK (version: 14.0, build id: 23A334)
10# Creating output .tar.gz file...
11# Adding MacOSX SDK 14.0 files...
12# Done! Find the resulting gzipped tarball at:
13/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
14sha256sum Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
15# 5b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
16# Wrong hash!
Making a good tarball using Ubuntu 24.04
Container setup
0sha256sum ~/xcode/Xcode_15.xip
1# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /home/user/xcode/Xcode_15.xip
2docker pull ubuntu:24.04
3docker run -it \
4 -v ~/xcode:/xcode \
5 ubuntu:24.04 \
6 /bin/bash
In the container
0export DEBIAN_FRONTEND=noninteractive # prevents apt from halting to interact
1sha256sum /xcode/Xcode_15.xip
2# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /xcode/Xcode_15.xip
3apt update
4apt install cpio git python3 -y
5git clone --depth 1 https://github.com/bitcoin/bitcoin.git
6git clone --depth 1 https://github.com/bitcoin-core/apple-sdk-tools.git
7python3 apple-sdk-tools/extract_xcode.py -f /xcode/Xcode_15.xip | cpio -d -i
8# 23498380 blocks
9/bitcoin/contrib/macdeploy/gen-sdk Xcode.app/
10# Found Xcode (version: 15.0, build id: 15A240d)
11# Found MacOSX SDK (version: 14.0, build id: 23A334)
12# Creating output .tar.gz file...
13# Adding MacOSX SDK 14.0 files...
14# Done! Find the resulting gzipped tarball at:
15# /Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
16sha256sum Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
17# c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
Further investigation
pkgdiff
pkgdiff
reports the contents of the two tarballs are identical:
0$ sha256sum badsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
15b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 badsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
2$ sha256sum goodsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
3c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d goodsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
4$ pkgdiff badsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz goodsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
5Reading packages ...
6Comparing packages ...
7creating report ...
8result: UNCHANGED
Python and zlib versions
os | python | zlib | pyenv / repo | hash |
---|---|---|---|---|
ubuntu | 3.12.3 | 1.3 | repo | c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d |
fedora | 3.12.8 | 1.3.1.zlib-ng | repo | 5b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 |
ubuntu | 3.12.3 | 1.3 | pyenv | c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d |
fedora | 3.12.3 | 1.3 | pyenv | 5b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 |
ubuntu | 3.12.8 | 1.3.1.zlib-ng | pyenv | 5b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 |
ubuntu | 3.12.3 | 1.3.1.zlib-ng | pyenv | 5b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 |