beeware / briefcase

Tools to support converting a Python project into a standalone native application.

Home Page:https://briefcase.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Code Signing Error

somehitDev opened this issue · comments

Describe the bug

I'm using macbook pro 13inch(M1) with sonoma.
image

When using QtWebEngineCore with briefcase, code signing failed.
I fixed manually line 538 of brieacase/platforms/macOS/__init__.py like below, and worked fine.

image

I think we need additional option for --deep or just add into process_command.

Steps to reproduce

  1. run build command
briefcase dev
  1. raise exception(copy all log into logs section)

Expected behavior

build complete and no other exceptions

Screenshots

No response

Environment

  • Operating System: Mac M1(Sonoma)
  • Python version: Python 3.11
  • Software versions:
    • Briefcase: 0.3.19
    • PySide6: 6.7.2

Logs

│ /Volumes/Dev/04_study_test/01_TEST/python/pyside6_webview_svelte/env/lib/python3.11/site-packages/briefcase/platforms/macOS/__init__.py:573 in sign_file                         │
│                                                                                                                                                                                  │
│    570 │   │   │   │   )                                                                                                                                                         │
│    571 │   │   │   │   return                                                                                                                                                    │
│    572 │   │   │   else:                                                                                                                                                         │
│ ❱  573 │   │   │   │   raise BriefcaseCommandError(f"Unable to code sign {path}.")                                                                                               │
│    574 │                                                                                                                                                                         │
│    575 │   def sign_app(self, app: AppConfig, identity: SigningIdentity):                                                                                                        │
│    576 │   │   """Sign an entire app with a specific identity.                                                                                                                   │
│                                                                                                                                                                                  │
│ ╭─────────────────────────────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────────────────────────────╮ │
│ │    entitlements = PosixPath('/Volumes/Dev/00_ongoing/SHLEE/templates/pyside6-svelte-template/build/pyside6-svelte-template/macos/app/Entitlements.plist')                    │ │
│ │          errors = '/Volumes/Dev/00_ongoing/SHLEE/templates/pyside6-svelte-template/build/pyside6-sv'+715                                                                     │ │
│ │        identity = <AdhocSigningIdentity>                                                                                                                                     │ │
│ │         options = None                                                                                                                                                       │ │
│ │            path = PosixPath('/Volumes/Dev/00_ongoing/SHLEE/templates/pyside6-svelte-template/build/pyside6-svelte-template/macos/app/PySide6 Webview                         │ │
│ │                   Template.app/Contents/Resources/app_packages/PySide6/Qt/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore')                                         │ │
│ │ process_command = [                                                                                                                                                          │ │
│ │                   │   'codesign',                                                                                                                                            │ │
│ │                   │   PosixPath('/Volumes/Dev/00_ongoing/SHLEE/templates/pyside6-svelte-template/build/pyside6-svelte-template/macos/app/PySide6 Webview                     │ │
│ │                   Template.app/Contents/Resources/app_packages/PySide6/Qt/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore'),                                        │ │
│ │                   │   '--sign',                                                                                                                                              │ │
│ │                   │   '-',                                                                                                                                                   │ │
│ │                   │   '--force',                                                                                                                                             │ │
│ │                   │   '--entitlements',                                                                                                                                      │ │
│ │                   │   PosixPath('/Volumes/Dev/00_ongoing/SHLEE/templates/pyside6-svelte-template/build/pyside6-svelte-template/macos/app/Entitlements.plist')                │ │
│ │                   ]                                                                                                                                                          │ │
│ │            self = <briefcase.platforms.macOS.app.macOSAppBuildCommand object at 0x106362190>                                                                                 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
BriefcaseCommandError: Unable to code sign /Volumes/Dev/00_ongoing/SHLEE/templates/pyside6-svelte-template/build/pyside6-svelte-template/macos/app/PySide6 Webview Template.app/Contents/Resources/app_packages/PySide6/Qt/lib/QtWebEngineCore.framework/Versions/A/QtWebEngineCore.

Additional context

No response

I was able to reproduce this error. Be sure that PySide-Addons is being packaged.

briefcase.2024_06_30-10_13_00.package.log

Regarding the specific suggestion: Briefcase had support for the --deep option; however, that option is officially deprecated by macOS, so it was removed recently (see #1221).

It would be interesting to see if moving the frameworks from the Resources folder to the Frameworks folder (which is where Frameworks should live) resolves the issue. If it does, a macOS processing step that moves frameworks wouldn't be too difficult to add.

Another possibility is to explicitly not sign Frameworks (on the basis that they should already be signed by the original distributor).