Skip to content

macOS: Bundle format unrecognized, invalid, or unsuitable #34744

Closed

Description

@hebasto

The master branch (@ 7e91060) on macOS Tahoe 26.2 (Apple M1):

% cmake -B build -DBUILD_GUI=ON
% cmake --build build -j 10
% cmake --build build -t deploy
% unzip build/bitcoin-macos-app.zip -d build/deploy
% codesign --verify build/deploy/Bitcoin-Qt.app
build/deploy/Bitcoin-Qt.app: bundle format unrecognized, invalid, or unsuitable
In subcomponent: /Users/hebasto/git/bitcoin/build/deploy/Bitcoin-Qt.app/Contents/Frameworks/QtDBus.framework
% brew info qt | head -1
==> qt: stable 6.10.2 (bottled)

Activity

  1. pinheadmz commented on Mar 5, 2026

    @pinheadmz
    Member

    Which version of Bitcoin?

  2. fanquake commented on Mar 5, 2026

    @fanquake
    Member

    What are the steps to reproduce?
    What version of the code?
    What version of Qt in brew (if used)?

  3. hebasto commented on Mar 5, 2026

    @hebasto
    MemberAuthor

    The issue has been updated with more details.

  4. pinheadmz commented on Mar 5, 2026

    @pinheadmz
    Member

    Does the cmake macOS deploy target do code signing? Like. What's codesign --verify expected to do before a signed release?

  5. hebasto commented on Mar 5, 2026

    @hebasto
    MemberAuthor

    Does the cmake macOS deploy target do code signing?

    if platform.system() == "Darwin":
    subprocess.check_call(f"codesign --deep --force --sign - {target}", shell=True)

  6. hebasto commented on Mar 5, 2026

    @hebasto
    MemberAuthor

    Here is a culprit:

    shutil.make_archive('{}'.format(name), format='zip', root_dir='dist', base_dir='Bitcoin-Qt.app')

    where symlinks are not preserved.

  7. fanquake commented on Mar 5, 2026

    @fanquake
    Member

    where symlinks are not preserved.

    Should they be? Isn't macdeployqtplus meant to create a standalone tarball (which is why the libraries are copied into the bundle in the first place). If not, then why copy the dylibs at all?

  8. hebasto commented on Mar 5, 2026

    @hebasto
    MemberAuthor

    where symlinks are not preserved.

    Should they be? Isn't macdeployqtplus meant to create a standalone tarball (which is why the libraries are copied into the bundle in the first place). If not, then why copy the dylibs at all?

    Quoting from Placing content in a bundle:

    The final structure looks like this:

    CoreWaffleVarnishing.framework/
      CoreWaffleVarnishing -> Versions/Current/CoreWaffleVarnishing
      Resources -> Versions/Current/Resources
      Versions/
        Current -> A
        A/
          CoreWaffleVarnishing
          Resources/
            Info.plist
            … other resources …
    
  9. fanquake commented on Mar 10, 2026

    @fanquake
    Member

    Ok. So if this is broken, should it be on the v31 milestone? Looks like it might have been broken for a while, so maybe not? Opened #34787 to check the CI. Any fix here should likely add a similar test, to prevent silent breakage.

  10. added this to the 31.0 milestone on Mar 10, 2026
  11. fanquake commented on Mar 10, 2026

    @fanquake
    Member

    Now a (mostly untested) fix for this in #34787.

  12. Sjors commented on Mar 11, 2026

    @Sjors
    Member

    Looks like it might have been broken for a while, so maybe not?

    When building locally on macOS 26.3.1 (M4) and opening the build folder in Finder, Bitcoin-Qt.app works but bitcoin-macos-app.zip doesn't. I've noticed that before, but I assumed the latter was only supposed to work in guix builds.

    Starting from the terminal also fails:

    % build/Bitcoin-Qt\ 2.app/Contents/MacOS/Bitcoin-Qt
    qt.qpa.plugin: Could not find the Qt platform plugin "cocoa" in ""
    This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
    
    zsh: abort      build/Bitcoin-Qt\ 2.app/Contents/MacOS/Bitcoin-Qt

    I can also reproduce the "bundle format unrecognized" with the steps in the PR description. Will test the fix.

  13. added a commit that references this issue on Mar 13, 2026
    390e7d6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions