beeware / beeware/briefcase

Include Xcode signing errors in the log

Open
#1,537 0 comments 0 reactions 0 assignees View on GitHub
bug macOS
Dominant language
Python
Stars
3.3k
Forks
549
Avg merge
1d 4h
Merged PRs (30d)
40

Description

### Describe the bug

When Xcode signing fails, the output to `stderr` is captured in a variable for interrogation....but if an error is ultimately raised, that full error text is not captured on screen or in the log file.

https://github.com/beeware/briefcase/blob/0ab03558121e63f2b190fd6e4a01fca540d1be6a/src/briefcase/platforms/macOS/__init__.py#L376

This is what's in the log file via the stack trace:
```
╭────────────────────────────────────────────────────────── locals ──────────────────────────────────────────────────────────╮
│ entitlements = PosixPath('/Users/user/PycharmProjects/app/app/build/app/macos/app/Entitlements.plist') │
│ errors = '/Library/Developer/CommandLineTools/usr/bin/codesign_allocate: fatal error: file'+379 │
│ identity = '-' │
│ options = None │
│ path = PosixPath('/Users/user/PycharmProjects/app/app/build/app/macos/app/FINS TU.app') │
│ process_command = [ │
│ │ 'codesign', │
│ │ '/Users/user/PycharmProjects/app/app/build/app/macos/app/FINS TU'+4, │
│ │ '--sign', │
│ │ '-', │
│ │ '--force', │
│ │ '--entitlements', │
│ │ '/Users/user/PycharmProjects/app/app/build/app/macos/app/Entitle'+11 │
│ ] │
│ self = │
╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
```

### Steps to reproduce

Not sure how to replicate a code signing issue.

### Expected behavior

Output in `stderr` is included at least in the log file if not on screen for the error condition.

### Screenshots

_No response_

### Environment

- Operating System: monterey
- Python version: 3.10
- Software versions:
- Briefcase: 0.3.16

### Logs

[briefcase.2023_11_12-20_46_21.build.log](https://github.com/beeware/briefcase/files/13330359/briefcase.2023_11_12-20_46_21.build.log)

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start in src/briefcase/platforms/macOS/__init__.py at the signing code around the linked line, where stderr is captured in the errors variable. Trace how the signing failure is raised and verify that the complete stderr output is included in the log or displayed for the error condition.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.