beeware / beeware/briefcase

The Run command does not detect app startup failures when the app logs are proxied

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

Description

### Describe the bug

As laid out in #1794, PySide apps have been failing to run in CI for at least 2 months. We were alerted to this today because the GitHub Action runner was actually slow enough to fail to find the PID for the app before it seg faults.

Therefore:
- the app PID is passed in to the app streaming logic
- the PID is immediately detected as not existing anymore so app log streaming starts it exit process
- This only checks the status of the process proxying the logs for the app and reports success/failure using its ret code

So, if the app completely crashes, that goes undetected and Briefcase does not report any failures.

### Steps to reproduce

Repro #1794.

### Expected behavior

Briefcase reports an error for an app that fails to start even when the app's logs are being proxied. Currently, the app logs for macOS and Android are proxied.

This may be difficult to get right....but since we already depend on `psutil`, we may be able to query for the return codes for arbitrary processes. Although, a completely different approach would be necessary for Android.

Alternatively, we could consider changing the way CI runs to use `--test` instead which then depends on specific app log output to generate a successful Briefcase exit.

### Screenshots

_No response_

### Environment

- Operating System: Sonoma x86
- Python version: 3.12.1
- Software versions:
- Briefcase: `0.3.19.dev26+g96734be6`

### Logs

_No response_

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the app streaming logic described in this issue and reproduce the behavior using #1794, comparing the macOS and Android cases where logs are proxied. The work is done when Briefcase's Run command reports an app startup failure even if the process proxying the logs exits successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, mobile-dev, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.