Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Briefcase 0.3.20 fails to staple the notarization onto my application #2090

Closed
davidfokkema opened this issue Dec 20, 2024 · 14 comments
Closed
Labels
bug A crash or error in behavior.

Comments

@davidfokkema
Copy link
Contributor

Describe the bug

Version 0.3.20 fails in the stapling step during my application build. This is the error message:

Stapling notarization onto dist/Tailor-2.0.6.dev3.dmg...
Processing: /Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg
CloudKit query for Tailor-2.0.6.dev3.dmg (2/12a61f4c3bddb14a83560be9e33402f1a5fe45ee) failed due to "Record not found".
Could not find base64 encoded ticket in response for 2/12a61f4c3bddb14a83560be9e33402f1a5fe45ee
The staple and validate action failed! Error 65.

Version 0.3.19 works fine.

Steps to reproduce

  1. Run briefcase create
  2. Run briefcase build
  3. Run briefcase package -i <developer id>
  4. See error:
    Stapling notarization onto dist/Tailor-2.0.6.dev3.dmg...
    Processing: /Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg
    CloudKit query for Tailor-2.0.6.dev3.dmg (2/12a61f4c3bddb14a83560be9e33402f1a5fe45ee) failed due to "Record not found".
    Could not find base64 encoded ticket in response for 2/12a61f4c3bddb14a83560be9e33402f1a5fe45ee
    The staple and validate action failed! Error 65.
    

Expected behavior

Completes the packaging step successfully.

Screenshots

No response

Environment

  • Operating System: macOS 15.1.1
  • Python version: 3.11.11
  • Software versions:
    • Briefcase: 0.3.20

Logs

<snipped log file because it was too large for GitHub. Log starts in the notarization process where it waits for Apple servers to come back with a reply>

[11:33:56] Current status: In Progress..............................                                                                                               subprocess.py:195
           Current status: Invalid...............................Processing complete                                                                               subprocess.py:195
             id: 9a5da356-ad8d-4b3f-a87a-93c75fde8700                                                                                                              subprocess.py:195
             status: Invalid                                                                                                                                       subprocess.py:195
                                                                                                                                                                   subprocess.py:195
           >>> Return code: 0                                                                                                                                      subprocess.py:827
                                                                                                                                                                     __init__.py:885
           Stapling notarization onto dist/Tailor-2.0.6.dev3.dmg...                                                                                                  __init__.py:886
                                                                                                                                                                   subprocess.py:827
           >>> Running Command:                                                                                                                                    subprocess.py:827
           >>>     xcrun stapler staple /Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg                                                            subprocess.py:827
           >>> Working Directory:                                                                                                                                  subprocess.py:827
           >>>     /Users/david/work/VU/software/tailor                                                                                                            subprocess.py:827
           Processing: /Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg                                                                             subprocess.py:195
           CloudKit query for Tailor-2.0.6.dev3.dmg (2/12a61f4c3bddb14a83560be9e33402f1a5fe45ee) failed due to "Record not found".                                 subprocess.py:195
           Could not find base64 encoded ticket in response for 2/12a61f4c3bddb14a83560be9e33402f1a5fe45ee                                                         subprocess.py:195
           The staple and validate action failed! Error 65.                                                                                                        subprocess.py:195
           >>> Return code: 65                                                                                                                                     subprocess.py:827
                                                                                                                                                                      __main__.py:44
           Unable to staple notarization onto dist/Tailor-2.0.6.dev3.dmg.                                                                                             __main__.py:45
           Saving log... started                                                                                                                                      console.py:391

Main thread traceback:
╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/platforms/macOS/__init__.py:889 in notarize                                       │
│                                                                                                                                                                                  │
│    886 │   │   │   self.logger.info(                                                                                                                                             │
│    887 │   │   │   │   f"Stapling notarization onto {filename.relative_to(self.base_path)}..."                                                                                   │
│    888 │   │   │   )                                                                                                                                                             │
│ ❱  889 │   │   │   self.tools.subprocess.run(                                                                                                                                    │
│    890 │   │   │   │   ["xcrun", "stapler", "staple", filename],                                                                                                                 │
│    891 │   │   │   │   check=True,                                                                                                                                               │
│    892 │   │   │   )                                                                                                                                                             │
│                                                                                                                                                                                  │
│ ╭───────────────────────────────────────────── locals ─────────────────────────────────────────────╮                                                                             │
│ │  archive_filename = PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg') │                                                                             │
│ │          filename = PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg') │                                                                             │
│ │          identity = <SigningIdentity id=59A0E2601A2EAFCFF069E790488FBDDACDB6BD81>                │                                                                             │
│ │           profile = 'briefcase-macOS-HWB9PKA687'                                                 │                                                                             │
│ │              self = <briefcase.platforms.macOS.app.macOSAppPackageCommand object at 0x10756da10> │                                                                             │
│ │ store_credentials = False                                                                        │                                                                             │
│ │         submitted = True                                                                         │                                                                             │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                             │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/integrations/subprocess.py:124 in inner                                           │
│                                                                                                                                                                                  │
│   121 │   │   """                                                                                                                                                                │
│   122 │   │   # Just run the command if no dynamic elements are active                                                                                                           │
│   123 │   │   if not sub.tools.input.is_console_controlled:                                                                                                                      │
│ ❱ 124 │   │   │   return sub_method(sub, args, *wrapped_args, **wrapped_kwargs)                                                                                                  │
│   125 │   │                                                                                                                                                                      │
│   126 │   │   remove_dynamic_elements = False                                                                                                                                    │
│   127                                                                                                                                                                            │
│                                                                                                                                                                                  │
│ ╭─────────────────────────────────────────────────────────── locals ────────────────────────────────────────────────────────────╮                                                │
│ │           args = ['xcrun', 'stapler', 'staple', PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg')] │                                                │
│ │            sub = <briefcase.integrations.subprocess.Subprocess object at 0x1084aedd0>                                         │                                                │
│ │   wrapped_args = ()                                                                                                           │                                                │
│ │ wrapped_kwargs = {'check': True}                                                                                              │                                                │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/integrations/subprocess.py:539 in run                                             │
│                                                                                                                                                                                  │
│   536 │   │   # caller sets stream_output=False, then ensure_console_is_safe() will                                                                                              │
│   537 │   │   # disable any dynamic console elements while the command runs.                                                                                                     │
│   538 │   │   if stream_output:                                                                                                                                                  │
│ ❱ 539 │   │   │   return self._run_and_stream_output(args, filter_func=filter_func, **kwargs)                                                                                    │
│   540 │   │                                                                                                                                                                      │
│   541 │   │   # Can't filter non-streamed output.                                                                                                                                │
│   542 │   │   if filter_func:                                                                                                                                                    │
│                                                                                                                                                                                  │
│ ╭─────────────────────────────────────────────────────────── locals ───────────────────────────────────────────────────────────╮                                                 │
│ │          args = ['xcrun', 'stapler', 'staple', PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg')] │                                                 │
│ │   filter_func = None                                                                                                         │                                                 │
│ │        kwargs = {'check': True}                                                                                              │                                                 │
│ │          self = <briefcase.integrations.subprocess.Subprocess object at 0x1084aedd0>                                         │                                                 │
│ │ stream_output = True                                                                                                         │                                                 │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                 │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/integrations/subprocess.py:615 in _run_and_stream_output                          │
│                                                                                                                                                                                  │
│   612 │   │   self._log_return_code(return_code)                                                                                                                                 │
│   613 │   │                                                                                                                                                                      │
│   614 │   │   if check and return_code:                                                                                                                                          │
│ ❱ 615 │   │   │   raise subprocess.CalledProcessError(return_code, args, stderr=stderr)                                                                                          │
│   616 │   │                                                                                                                                                                      │
│   617 │   │   return subprocess.CompletedProcess(args, return_code, stderr=stderr)                                                                                               │
│   618                                                                                                                                                                            │
│                                                                                                                                                                                  │
│ ╭────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────╮                                                   │
│ │        args = ['xcrun', 'stapler', 'staple', PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg')] │                                                   │
│ │       check = True                                                                                                         │                                                   │
│ │ filter_func = None                                                                                                         │                                                   │
│ │      kwargs = {'stdout': -1, 'stderr': -2, 'bufsize': 1}                                                                   │                                                   │
│ │     process = <Popen: returncode: 65 args: ['xcrun', 'stapler', 'staple', '/Users/david/wo...>                             │                                                   │
│ │ return_code = 65                                                                                                           │                                                   │
│ │        self = <briefcase.integrations.subprocess.Subprocess object at 0x1084aedd0>                                         │                                                   │
│ │      stderr = None                                                                                                         │                                                   │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                   │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
CalledProcessError: Command '['xcrun', 'stapler', 'staple', PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg')]' returned non-zero exit status 65.

During handling of the above exception, another exception occurred:

╭─────────────────────────────────────────────────────────────────────── Traceback (most recent call last) ────────────────────────────────────────────────────────────────────────╮
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/__main__.py:29 in main                                                            │
│                                                                                                                                                                                  │
│   26 │   │   │   Path.cwd() / "pyproject.toml",                                                                                                                                  │
│   27 │   │   │   overrides=overrides,                                                                                                                                            │
│   28 │   │   )                                                                                                                                                                   │
│ ❱ 29 │   │   command(**options)                                                                                                                                                  │
│   30 │   except HelpText as e:                                                                                                                                                   │
│   31 │   │   logger.info()                                                                                                                                                       │
│   32 │   │   logger.info(str(e))                                                                                                                                                 │
│                                                                                                                                                                                  │
│ ╭──────────────────────────────────────────────── locals ─────────────────────────────────────────────────╮                                                                      │
│ │       command = <briefcase.platforms.macOS.app.macOSAppPackageCommand object at 0x10756da10>            │                                                                      │
│ │       console = <briefcase.console.Console object at 0x108440490>                                       │                                                                      │
│ │             e = BriefcaseCommandError('Unable to staple notarization onto dist/Tailor-2.0.6.dev3.dmg.') │                                                                      │
│ │ extra_cmdline = ['-i', 'Developer ID Application: David Fokkema (HWB9PKA687)']                          │                                                                      │
│ │        logger = <briefcase.console.Log object at 0x108440810>                                           │                                                                      │
│ │       options = {                                                                                       │                                                                      │
│ │                 │   'update': False,                                                                    │                                                                      │
│ │                 │   'packaging_format': None,                                                           │                                                                      │
│ │                 │   'adhoc_sign': False,                                                                │                                                                      │
│ │                 │   'identity': 'Developer ID Application: David Fokkema (HWB9PKA687)',                 │                                                                      │
│ │                 │   'sign_installer': True,                                                             │                                                                      │
│ │                 │   'installer_identity': None,                                                         │                                                                      │
│ │                 │   'notarize_app': None                                                                │                                                                      │
│ │                 }                                                                                       │                                                                      │
│ │     overrides = {}                                                                                      │                                                                      │
│ │       printer = <briefcase.console.Printer object at 0x105439a50>                                       │                                                                      │
│ │        result = 200                                                                                     │                                                                      │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                      │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/commands/package.py:151 in __call__                                               │
│                                                                                                                                                                                  │
│   148 │   │   else:                                                                                                                                                              │
│   149 │   │   │   state = None                                                                                                                                                   │
│   150 │   │   │   for app_name, app in sorted(self.apps.items()):                                                                                                                │
│ ❱ 151 │   │   │   │   state = self._package_app(                                                                                                                                 │
│   152 │   │   │   │   │   app, update=update, **full_options(state, options)                                                                                                     │
│   153 │   │   │   │   )                                                                                                                                                          │
│   154                                                                                                                                                                            │
│                                                                                                                                                                                  │
│ ╭──────────────────────────────────────── locals ─────────────────────────────────────────╮                                                                                      │
│ │      app = <com.amsphyslab.tailor.tailor v2.0.6.dev3 AppConfig>                         │                                                                                      │
│ │ app_name = 'tailor'                                                                     │                                                                                      │
│ │  options = {                                                                            │                                                                                      │
│ │            │   'packaging_format': None,                                                │                                                                                      │
│ │            │   'adhoc_sign': False,                                                     │                                                                                      │
│ │            │   'identity': 'Developer ID Application: David Fokkema (HWB9PKA687)',      │                                                                                      │
│ │            │   'sign_installer': True,                                                  │                                                                                      │
│ │            │   'installer_identity': None,                                              │                                                                                      │
│ │            │   'notarize_app': None                                                     │                                                                                      │
│ │            }                                                                            │                                                                                      │
│ │     self = <briefcase.platforms.macOS.app.macOSAppPackageCommand object at 0x10756da10> │                                                                                      │
│ │    state = None                                                                         │                                                                                      │
│ │   update = False                                                                        │                                                                                      │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯                                                                                      │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/commands/package.py:99 in _package_app                                            │
│                                                                                                                                                                                  │
│    96 │   │   │   self.dist_path.mkdir(exist_ok=True)                                                                                                                            │
│    97 │   │                                                                                                                                                                      │
│    98 │   │   # Package the app                                                                                                                                                  │
│ ❱  99 │   │   state = self.package_app(app, **full_options(state, options))                                                                                                      │
│   100 │   │                                                                                                                                                                      │
│   101 │   │   filename = self.distribution_path(app).relative_to(self.base_path)                                                                                                 │
│   102 │   │   self.logger.info(f"Packaged {filename}", prefix=app.app_name)                                                                                                      │
│                                                                                                                                                                                  │
│ ╭──────────────────────────────────────────────── locals ────────────────────────────────────────────────╮                                                                       │
│ │              app = <com.amsphyslab.tailor.tailor v2.0.6.dev3 AppConfig>                                │                                                                       │
│ │      binary_file = PosixPath('/Users/david/work/VU/software/tailor/build/tailor/macos/app/Tailor.app') │                                                                       │
│ │          options = {                                                                                   │                                                                       │
│ │                    │   'adhoc_sign': False,                                                            │                                                                       │
│ │                    │   'identity': 'Developer ID Application: David Fokkema (HWB9PKA687)',             │                                                                       │
│ │                    │   'sign_installer': True,                                                         │                                                                       │
│ │                    │   'installer_identity': None,                                                     │                                                                       │
│ │                    │   'notarize_app': None                                                            │                                                                       │
│ │                    }                                                                                   │                                                                       │
│ │ packaging_format = None                                                                                │                                                                       │
│ │             self = <briefcase.platforms.macOS.app.macOSAppPackageCommand object at 0x10756da10>        │                                                                       │
│ │            state = None                                                                                │                                                                       │
│ │    template_file = PosixPath('/Users/david/work/VU/software/tailor/build/tailor/macos/app')            │                                                                       │
│ │           update = False                                                                               │                                                                       │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                       │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/platforms/macOS/__init__.py:993 in package_app                                    │
│                                                                                                                                                                                  │
│    990 │   │   │   )                                                                                                                                                             │
│    991 │   │                                                                                                                                                                     │
│    992 │   │   else:  # Default packaging format is DMG                                                                                                                          │
│ ❱  993 │   │   │   self.package_dmg(                                                                                                                                             │
│    994 │   │   │   │   app,                                                                                                                                                      │
│    995 │   │   │   │   notarize_app=notarize_app,                                                                                                                                │
│    996 │   │   │   │   identity=identity,                                                                                                                                        │
│                                                                                                                                                                                  │
│ ╭───────────────────────────────────────────── locals ──────────────────────────────────────────────╮                                                                            │
│ │         adhoc_sign = False                                                                        │                                                                            │
│ │                app = <com.amsphyslab.tailor.tailor v2.0.6.dev3 AppConfig>                         │                                                                            │
│ │           identity = <SigningIdentity id=59A0E2601A2EAFCFF069E790488FBDDACDB6BD81>                │                                                                            │
│ │ installer_identity = None                                                                         │                                                                            │
│ │             kwargs = {}                                                                           │                                                                            │
│ │       notarize_app = True                                                                         │                                                                            │
│ │               self = <briefcase.platforms.macOS.app.macOSAppPackageCommand object at 0x10756da10> │                                                                            │
│ │     sign_installer = True                                                                         │                                                                            │
│ ╰───────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                            │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/platforms/macOS/__init__.py:1222 in package_dmg                                   │
│                                                                                                                                                                                  │
│   1219 │   │   │   │   f"Notarizing DMG with team ID {identity.team_id}...",                                                                                                     │
│   1220 │   │   │   │   prefix=app.app_name,                                                                                                                                      │
│   1221 │   │   │   )                                                                                                                                                             │
│ ❱ 1222 │   │   │   self.notarize(dist_path, identity=identity)                                                                                                                   │
│   1223                                                                                                                                                                           │
│                                                                                                                                                                                  │
│ ╭───────────────────────────────────────────────── locals ─────────────────────────────────────────────────╮                                                                     │
│ │           app = <com.amsphyslab.tailor.tailor v2.0.6.dev3 AppConfig>                                     │                                                                     │
│ │     dist_path = PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg')             │                                                                     │
│ │  dmg_settings = {                                                                                        │                                                                     │
│ │                 │   'files': [                                                                           │                                                                     │
│ │                 │   │   '/Users/david/work/VU/software/tailor/build/tailor/macos/app/Tailor.app'         │                                                                     │
│ │                 │   ],                                                                                   │                                                                     │
│ │                 │   'symlinks': {'Applications': '/Applications'},                                       │                                                                     │
│ │                 │   'icon_locations': {'Tailor.app': (75, 75), 'Applications': (225, 75)},               │                                                                     │
│ │                 │   'window_rect': ((600, 600), (350, 150)),                                             │                                                                     │
│ │                 │   'icon_size': 64,                                                                     │                                                                     │
│ │                 │   'text_size': 12,                                                                     │                                                                     │
│ │                 │   'icon': '/Users/david/work/VU/software/tailor/src/tailor/resources/tailor.icns'      │                                                                     │
│ │                 }                                                                                        │                                                                     │
│ │ icon_filename = PosixPath('/Users/david/work/VU/software/tailor/src/tailor/resources/tailor.icns')       │                                                                     │
│ │      identity = <SigningIdentity id=59A0E2601A2EAFCFF069E790488FBDDACDB6BD81>                            │                                                                     │
│ │  notarize_app = True                                                                                     │                                                                     │
│ │          self = <briefcase.platforms.macOS.app.macOSAppPackageCommand object at 0x10756da10>             │                                                                     │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                     │
│                                                                                                                                                                                  │
│ /opt/homebrew/Caskroom/miniconda/base/envs/tailor-py311/lib/python3.11/site-packages/briefcase/platforms/macOS/__init__.py:894 in notarize                                       │
│                                                                                                                                                                                  │
│    891 │   │   │   │   check=True,                                                                                                                                               │
│    892 │   │   │   )                                                                                                                                                             │
│    893 │   │   except subprocess.CalledProcessError:                                                                                                                             │
│ ❱  894 │   │   │   raise BriefcaseCommandError(                                                                                                                                  │
│    895 │   │   │   │   f"Unable to staple notarization onto {filename.relative_to(self.base_pat                                                                                  │
│    896 │   │   │   )                                                                                                                                                             │
│    897                                                                                                                                                                           │
│                                                                                                                                                                                  │
│ ╭───────────────────────────────────────────── locals ─────────────────────────────────────────────╮                                                                             │
│ │  archive_filename = PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg') │                                                                             │
│ │          filename = PosixPath('/Users/david/work/VU/software/tailor/dist/Tailor-2.0.6.dev3.dmg') │                                                                             │
│ │          identity = <SigningIdentity id=59A0E2601A2EAFCFF069E790488FBDDACDB6BD81>                │                                                                             │
│ │           profile = 'briefcase-macOS-HWB9PKA687'                                                 │                                                                             │
│ │              self = <briefcase.platforms.macOS.app.macOSAppPackageCommand object at 0x10756da10> │                                                                             │
│ │ store_credentials = False                                                                        │                                                                             │
│ │         submitted = True                                                                         │                                                                             │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯                                                                             │
╰──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
BriefcaseCommandError: Unable to staple notarization onto dist/Tailor-2.0.6.dev3.dmg.

Additional context

No response

@davidfokkema davidfokkema added the bug A crash or error in behavior. label Dec 20, 2024
@davidfokkema
Copy link
Contributor Author

Maybe the stapling fails because the notarization fails? The first few lines of the log seem to indicate that Apple returns an "invalid" response and briefcase fails to register that and tries to staple anyway?

@davidfokkema
Copy link
Contributor Author

For briefcase 0.3.19 it returns:

[11:59:59] Current status: In Progress........................                                                                                                     subprocess.py:195
           Current status: Accepted.........................Processing complete                                                                                    subprocess.py:195
             id: 1dcc346b-05a0-46bf-b161-48575933ab94                                                                                                              subprocess.py:195
             status: Accepted                                                                                                                                      subprocess.py:195
                                                                                                                                                                   subprocess.py:195
           >>> Return code: 0                                                                                                                                      subprocess.py:827
                                                           

@davidfokkema
Copy link
Contributor Author

And briefcase 0.3.20 it returns:

[11:33:56] Current status: In Progress..............................                                                                                               subprocess.py:195
           Current status: Invalid...............................Processing complete                                                                               subprocess.py:195
             id: 9a5da356-ad8d-4b3f-a87a-93c75fde8700                                                                                                              subprocess.py:195
             status: Invalid                                                                                                                                       subprocess.py:195
                                                                                                                                                                   subprocess.py:195
           >>> Return code: 0                                                                                                                                      subprocess.py:827
                                        

@freakboy3742
Copy link
Member

The notarization failing definitely sounds like a plausible underlying cause.

To clarify the reproduction case - are you seeing this on a vanilla empty app? Or can you share the pyproject.toml (and in particular, the list of dependencies) that are packaged with the app?

@davidfokkema
Copy link
Contributor Author

Glad you asked. I tried just now with:

briefcase new
cd helloworld
briefcase create
briefcase build
briefcase package -i <my developer id>

with different results. It works without problems. I will further investigate...

@davidfokkema
Copy link
Contributor Author

davidfokkema commented Dec 20, 2024

This is strange. It is not any extra dependencies, it turns out to be the Python version. Maybe because of the specific wheels that get included in the application? Maybe because of Briefcase's specific stub binary for the different Python versions? This is what I get:

  • Python 3.10 with GUI-Stub-3.10-b9.zip: FAILS
  • Python 3.11 with GUI-Stub-3.11-b9.zip: FAILS
  • Python 3.12 with GUI-Stub-3.12-b9.zip: WORKS
  • Python 3.13 with GUI-Stub-3.13-b9.zip: WORKS

Unfortunately, I might need 3.11 at the latest.

@davidfokkema
Copy link
Contributor Author

Managed to get my app working on 3.12, so for me this not high-priority anymore. Still, it's strange and might be a problem for other people.

@freakboy3742
Copy link
Member

Thanks for those extra details. No idea what is going on - I can't think of any obvious reason why the 3.10/11 stub would be different to the 3.12/13 stub. - but I'm glad you've found an immediate workaround.

Also, for anyone investigating: flagging that this could be a manifestation of #1218.

@freakboy3742
Copy link
Member

Also flagging that #1472 would potentially make this error easier to diagnose.

@freakboy3742
Copy link
Member

I've been able to do a little more diagnosis here:

  1. It's not PySide specific. I can see this on a vanilla Toga HelloWorld app as well.
  2. It's not DMG specific. I get the same error with .zip packaging.
  3. Python 3.10 packaging fails; but Python 3.12 packaging works.
  4. On Python 3.10, you can also fix the problem by bumping the support package revision to b11.

This seems to indicate there was something wrong with the support packages published around the time of Briefcase 0.3.20. The immediate workaround would be to either:

  • upgrade your environment so you're building using Python 3.12 or 3.13; or
  • Add a support_revision definition to the macOS section of your app's config file. The exact version will depend on your Python version:
    • Python 3.9: support_revision = "15"
    • Python 3.10: support_revision = "11"
    • Python 3.11: support_revision = "6"

The latter change (bumping the support revision) is something we should on the development branch anyway, as the support packages are out of date; but if I can get some confirmation from @davidfokkema or @amaretz that it resolves their notarization problem, I can backport the fix to 0.3.20 as well.

I suspect the issue was fixed by this commit. If the support package contains files with extended attributes, that's the sort of thing that might cause errors with notarization that don't report as signing problems. The version of the support package that was being used by 3.12 and 3.13 had this change; 3.11 and earlier did not.

@amaretz
Copy link

amaretz commented Jan 9, 2025 via email

@davidfokkema
Copy link
Contributor Author

I can confirm the notarization fails in Python 3.10, but succeeds with support_revision = "11"!!

@freakboy3742
Copy link
Member

freakboy3742 commented Jan 9, 2025

Ok - on the basis of those reports. I've backported the support package update to 0.3.20. You should be able to remove the support_revision config; if you re-generate a pre-3.12 project, it should now use the updated support package.

Closing this ticket as resolved.

@davidfokkema
Copy link
Contributor Author

I dropped support_revision and can confirm this works perfectly, thank you very much!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug A crash or error in behavior.
Projects
None yet
Development

No branches or pull requests

3 participants