Skip to content

build: fix native macOS deployment#34787

Merged
sedited merged 3 commits intobitcoin:masterfrom
fanquake:ci_test_macos_codesigning
Mar 13, 2026
Merged

build: fix native macOS deployment#34787
sedited merged 3 commits intobitcoin:masterfrom
fanquake:ci_test_macos_codesigning

Conversation

@fanquake
Copy link
Member

@fanquake fanquake commented Mar 10, 2026

Fix bundle format.
Add a CI check that codesigning works.
Fixes #34744.

@DrahtBot DrahtBot added the Tests label Mar 10, 2026
@DrahtBot
Copy link
Contributor

DrahtBot commented Mar 10, 2026

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK Sjors, hebasto, sedited

If your review is incorrectly listed, please copy-paste <!--meta-tag:bot-skip--> into the comment that the bot should ignore.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #31349 (ci: detect outbound internet traffic generated while running tests by vasild)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

@fanquake
Copy link
Member Author

fanquake commented Mar 10, 2026

This does fail the same as #34744. https://github.com/bitcoin/bitcoin/actions/runs/22903729732/job/66456660437?pr=34787#step:9:2202:

/Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch/build-aarch64-apple-darwin24.6.0/deploy/Bitcoin-Qt.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch/build-aarch64-apple-darwin24.6.0/deploy/Bitcoin-Qt.app/Contents/Frameworks/QtGui.framework

@fanquake fanquake force-pushed the ci_test_macos_codesigning branch from ab681c4 to 80e5092 Compare March 10, 2026 17:24
@fanquake
Copy link
Member Author

Pushed a commit that should fix #34744, so CI should pass:

codesign --verify /Users/runner/work/bitcoin/bitcoin/repo_archive/ci/scratch/build-aarch64-apple-darwin24.6.0/deploy/Bitcoin-Qt.app
+ '[' true = true ']'

Calling shutil.make_archive(), does not preserve symlinks when using the
zip format, see python/cpython#139679.

Call `zip` using subprocess instead. This code is only run when using a
macos machine, and I think it's safe to assume that zip is available, same
as codesign, and all other tools we call in this script.
Rather than looking for /translations, which might not exist (it doesn't
in a recent brew installed qt on macOS). i.e:
```bash
ls /opt/homebrew/opt/qtbase/share/qt
doc
libexec
metatypes
mkspecs
modules
plugins
sbom
```
@fanquake fanquake force-pushed the ci_test_macos_codesigning branch from 80e5092 to d03e3be Compare March 11, 2026 10:38
@fanquake fanquake changed the title ci: check macos bundle structure and codesigning build: fix native macOS deployment Mar 11, 2026
@fanquake fanquake marked this pull request as ready for review March 11, 2026 10:56
@fanquake
Copy link
Member Author

Fixed the native fuzz CI.

@Sjors
Copy link
Member

Sjors commented Mar 11, 2026

tACK d03e3be

The generated Bitcoin-Qt.app still works and bitcoin-macos-app.zip now works fork me too, when opened from Finder. codesign --verify is happy too.

macOS 26.3.1 (M4)
qt 6.10.2 via homebrew

re 66d80d5:

Rather than looking for /translations, which might not exist (it doesn't
in a recent brew installed qt on macOS)

Indeed it doesn't for me, whereas plugins does.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d03e3be, tested on macOS Tahoe 26.3.1.

The second commit 66d80d5 additionally fixes the issue with plugins. However, Qt's translations remain missed from the bundle (can be amended in a follow-up).

A bit unrelated to this PR, but we use different approaches when creating a zipped bundle: the contrib/macdeploy/macdeployqtplus Python script when building on macOS, and the cmake/script/macos_zip.sh shell script when cross-compiling on Linux. Could both these approches converge at some point?

@fanquake
Copy link
Member Author

Guix Build (x86_64):

898d9f8b8a62e42115d36b1a9fa031e59f7004d052cf95a5e005d408fdc3c8fa  guix-build-d03e3be246f6/output/aarch64-linux-gnu/SHA256SUMS.part
cfe0ca1564750e0d627a2b69e2da28c9d03f2869b2ec1e16aeb966f7fd86fa1c  guix-build-d03e3be246f6/output/aarch64-linux-gnu/bitcoin-d03e3be246f6-aarch64-linux-gnu-debug.tar.gz
588a4601631c26c29826c25514797288d41fa53895e43ef487cce9a57b6c300f  guix-build-d03e3be246f6/output/aarch64-linux-gnu/bitcoin-d03e3be246f6-aarch64-linux-gnu.tar.gz
8128bec5d1403cc567302e6c6193b554a508baf62c93fe34858508a0ff275d08  guix-build-d03e3be246f6/output/arm-linux-gnueabihf/SHA256SUMS.part
3eba808dc310ce9ed2ce0c0fbdf6ca1f48992071ae465e427b6d88673e8e8088  guix-build-d03e3be246f6/output/arm-linux-gnueabihf/bitcoin-d03e3be246f6-arm-linux-gnueabihf-debug.tar.gz
a1321d868e7984fee7ed2d1cff02c8d85045a9eacefc0c8dd93d1a0bc01a4d60  guix-build-d03e3be246f6/output/arm-linux-gnueabihf/bitcoin-d03e3be246f6-arm-linux-gnueabihf.tar.gz
481ed2752180c1a1a4d71f83cb9432c23244a394bc9747ed815e0ed0507165a3  guix-build-d03e3be246f6/output/arm64-apple-darwin/SHA256SUMS.part
6b0a3a1ef41eaa857da8a32d1999cb13c141f738a66dd6b2b12f0a4b4495f94a  guix-build-d03e3be246f6/output/arm64-apple-darwin/bitcoin-d03e3be246f6-arm64-apple-darwin-codesigning.tar.gz
2771de5094d611dbf8d1202825bfb380df0abbcf48dfb52ff8364ec6a64b2f74  guix-build-d03e3be246f6/output/arm64-apple-darwin/bitcoin-d03e3be246f6-arm64-apple-darwin-unsigned.tar.gz
576b43d00f6e4566cc18d6bf6006998849ba0271257ee2d878ba66c945b5684d  guix-build-d03e3be246f6/output/arm64-apple-darwin/bitcoin-d03e3be246f6-arm64-apple-darwin-unsigned.zip
f4ba5e1ea20024c1c280577d1749e18a09b3b85752c4ccadfbcd8b054aafd52d  guix-build-d03e3be246f6/output/dist-archive/bitcoin-d03e3be246f6.tar.gz
513dbd528d70201c1b1e2549665fca8eb4f94fa2ccc8ec6ec4b15805b0fe98e1  guix-build-d03e3be246f6/output/powerpc64-linux-gnu/SHA256SUMS.part
21c03407ffb4e77140875b25b87ff085ad3cc620cc1f8273ff9379c4b0fca522  guix-build-d03e3be246f6/output/powerpc64-linux-gnu/bitcoin-d03e3be246f6-powerpc64-linux-gnu-debug.tar.gz
0ec82388facd8ab7fd11216fba3c175c13808c1c5307a4fa30f5e015136eb1a0  guix-build-d03e3be246f6/output/powerpc64-linux-gnu/bitcoin-d03e3be246f6-powerpc64-linux-gnu.tar.gz
6ba8d485a8dba9d3f78715d591e940e45eec3217d4f9260f74ee13c61ae51242  guix-build-d03e3be246f6/output/riscv64-linux-gnu/SHA256SUMS.part
574d89854a763ce5d8ba4c6bc1d6746373e4448e9ce2ef4150328c0a5d08549c  guix-build-d03e3be246f6/output/riscv64-linux-gnu/bitcoin-d03e3be246f6-riscv64-linux-gnu-debug.tar.gz
70c2d00bd8c10620ab6bac739802827e65c04b9d850f489b3cef36bb07c84db2  guix-build-d03e3be246f6/output/riscv64-linux-gnu/bitcoin-d03e3be246f6-riscv64-linux-gnu.tar.gz
b945f4ab116813efc8b1ca0ad67b6d77ae9cbdee4b3782ae2527ab0e61f534db  guix-build-d03e3be246f6/output/x86_64-apple-darwin/SHA256SUMS.part
09244c40d849a2aef721f4ab457eafa2f3369915f9c4d100133597331f8f5edd  guix-build-d03e3be246f6/output/x86_64-apple-darwin/bitcoin-d03e3be246f6-x86_64-apple-darwin-codesigning.tar.gz
f750a3e8e3e9719963cd7a887218d0d5ada0b40b25eff1c55ec48145e97b380e  guix-build-d03e3be246f6/output/x86_64-apple-darwin/bitcoin-d03e3be246f6-x86_64-apple-darwin-unsigned.tar.gz
420feb5b2be2f9899f780e397d6fa548b775a68ffa1048bf823d7259eaf5a637  guix-build-d03e3be246f6/output/x86_64-apple-darwin/bitcoin-d03e3be246f6-x86_64-apple-darwin-unsigned.zip
94178ba6391b9774474d1803f2bbc719a9890ab0675761cc8a3843afc3b73002  guix-build-d03e3be246f6/output/x86_64-linux-gnu/SHA256SUMS.part
8600fc4560905895d37b7f665c9e97ed964a90852748a7b5f7b0a21a13298667  guix-build-d03e3be246f6/output/x86_64-linux-gnu/bitcoin-d03e3be246f6-x86_64-linux-gnu-debug.tar.gz
726cdc05bf853b33f1b29ab0ec1a0bde466eaa46ad3f333509354a273f6b6cbb  guix-build-d03e3be246f6/output/x86_64-linux-gnu/bitcoin-d03e3be246f6-x86_64-linux-gnu.tar.gz
6759ecaa75826d462c683bf2a288483e64f75657968b53bf6a3b1b0d12325a8f  guix-build-d03e3be246f6/output/x86_64-w64-mingw32/SHA256SUMS.part
60661ddd120e20cd30eb64e96d6c0559e307ff709bc918a20a9327e782cf2b2f  guix-build-d03e3be246f6/output/x86_64-w64-mingw32/bitcoin-d03e3be246f6-win64-codesigning.tar.gz
dabd3b2b6ac6ec0e575cdb31a55cc89922bb7307d0554c20b2f7f6c59e85bcbc  guix-build-d03e3be246f6/output/x86_64-w64-mingw32/bitcoin-d03e3be246f6-win64-debug.zip
cedfa06e24965be5b2b68d3b56c69d0ce79cddfb9b0b944450f58bd1e9762bbe  guix-build-d03e3be246f6/output/x86_64-w64-mingw32/bitcoin-d03e3be246f6-win64-setup-unsigned.exe
91453118a44f751c676c847c17df9ce1bf2f8ee43911019b80eb18d0951f7f97  guix-build-d03e3be246f6/output/x86_64-w64-mingw32/bitcoin-d03e3be246f6-win64-unsigned.zip

@fanquake fanquake added this to the 31.0 milestone Mar 12, 2026
Copy link
Contributor

@sedited sedited left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK d03e3be

@sedited sedited merged commit 390e7d6 into bitcoin:master Mar 13, 2026
26 checks passed
@fanquake fanquake deleted the ci_test_macos_codesigning branch March 13, 2026 10:46
fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 13, 2026
Calling shutil.make_archive(), does not preserve symlinks when using the
zip format, see python/cpython#139679.

Call `zip` using subprocess instead. This code is only run when using a
macos machine, and I think it's safe to assume that zip is available, same
as codesign, and all other tools we call in this script.

Github-Pull: bitcoin#34787
Rebased-From: ab137cb
fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 13, 2026
Rather than looking for /translations, which might not exist (it doesn't
in a recent brew installed qt on macOS). i.e:
```bash
ls /opt/homebrew/opt/qtbase/share/qt
doc
libexec
metatypes
mkspecs
modules
plugins
sbom
```

Github-Pull: bitcoin#34787
Rebased-From: 66d80d5
fanquake added a commit to fanquake/bitcoin that referenced this pull request Mar 13, 2026
@fanquake fanquake mentioned this pull request Mar 13, 2026
@fanquake
Copy link
Member Author

Backported to 31.x in #34800.

@Sjors
Copy link
Member

Sjors commented Mar 13, 2026

My x86_64 guix hashes match @fanquake's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: Bundle format unrecognized, invalid, or unsuitable

5 participants