Issue Details
- Number
- 31873
- Title
- guix: Unable to reproduce macOS SDK tarball on Fedora 40
- Description
- On Fedora 40, following the instructions in [`contrib/macdeploy/README.md`](https://github.com/bitcoin/bitcoin/tree/master/contrib/macdeploy#readme) 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`](https://github.com/bitcoin/bitcoin/tree/master/contrib/macdeploy#readme). The steps below assume you have placed this archive at `~/xcode/Xcode_15.xip`.
## Making the bad tarball using Fedora 40
### Container setup
```bash
sha256sum ~/xcode/Xcode_15.xip
# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /home/user/xcode/Xcode_15.xip
docker pull fedora:40
docker run -it \
-v ~/xcode:/xcode \
fedora:40 \
/bin/bash
```
### In the container
```bash
sha256sum /xcode/Xcode_15.xip
# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /xcode/Xcode_15.xip
dnf install cpio git python -y
git clone --depth 1 https://github.com/bitcoin/bitcoin.git
git clone --depth 1 https://github.com/bitcoin-core/apple-sdk-tools.git
python3 apple-sdk-tools/extract_xcode.py -f /xcode/Xcode_15.xip | cpio -d -i
# 23498380 blocks
/bitcoin/contrib/macdeploy/gen-sdk Xcode.app/
# Found Xcode (version: 15.0, build id: 15A240d)
# Found MacOSX SDK (version: 14.0, build id: 23A334)
# Creating output .tar.gz file...
# Adding MacOSX SDK 14.0 files...
# Done! Find the resulting gzipped tarball at:
/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
sha256sum Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
# 5b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
# Wrong hash!
```
## Making a good tarball using Ubuntu 24.04
### Container setup
```bash
sha256sum ~/xcode/Xcode_15.xip
# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /home/user/xcode/Xcode_15.xip
docker pull ubuntu:24.04
docker run -it \
-v ~/xcode:/xcode \
ubuntu:24.04 \
/bin/bash
```
### In the container
```bash
export DEBIAN_FRONTEND=noninteractive # prevents apt from halting to interact
sha256sum /xcode/Xcode_15.xip
# 4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e /xcode/Xcode_15.xip
apt update
apt install cpio git python3 -y
git clone --depth 1 https://github.com/bitcoin/bitcoin.git
git clone --depth 1 https://github.com/bitcoin-core/apple-sdk-tools.git
python3 apple-sdk-tools/extract_xcode.py -f /xcode/Xcode_15.xip | cpio -d -i
# 23498380 blocks
/bitcoin/contrib/macdeploy/gen-sdk Xcode.app/
# Found Xcode (version: 15.0, build id: 15A240d)
# Found MacOSX SDK (version: 14.0, build id: 23A334)
# Creating output .tar.gz file...
# Adding MacOSX SDK 14.0 files...
# Done! Find the resulting gzipped tarball at:
# /Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
sha256sum Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
# 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:
```console
$ sha256sum badsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
5b1a05d3e79fd14f5c8f6d3565762c89a522c7f5e7efbed4353d878410f2d765 badsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
$ sha256sum goodsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d goodsdk/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz
$ 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
Reading packages ...
Comparing packages ...
creating report ...
result: UNCHANGED
```
<details>
<summary> pkgdiff report screenshot </summary>

</details>
## 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
- URL
-
https://github.com/bitcoin/bitcoin/issue/31873
- Closed by
-
Back to List