ci(build): install Rosetta only when the x86_64 relinker job cannot run x86_64 code #14332

Merged
MarcZX10 merged 1 commit from upstream-pr/14332 into main 2026-11-02 19:48:28 +00:00
MarcZX10 commented 2026-11-01 09:40:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-01T09:40:49Z.


What

The macOS x86_64 relinker job in .github/workflows/build.yml runs sudo softwareupdate --install-rosetta --agree-to-license unconditionally. On pull request #14315's run (41290340866, job 124801037258), that step failed with Rosetta 2 update is not available and exit 1. Every later step was then skipped, so the job reported a failure before it built or tested anything. The message suggests Rosetta was already installed on that runner image; that is inferred from the message, not confirmed on the runner.

The step now runs the install only when an x86_64 binary cannot run:

arch -x86_64 /usr/bin/true || sudo softwareupdate --install-rosetta --agree-to-license

Commit 5c7cfdb30f, one line.

Tested

Linux, Python 3.11.2 for the YAML check, on upstream/main 26fa1212b8 plus this commit. The macOS runner was not available here, so the step's control flow was checked with mocks.

  • Mock run of the old and new step text under bash --noprofile --norc -e -o pipefail, which is the shell GitHub uses for run: on macOS. The mocks are arch, sudo and softwareupdate on PATH. Three cases:
    Case Old step New step
    Rosetta installed, softwareupdate reports it unavailable exit 1, softwareupdate called exit 0, softwareupdate not called
    Rosetta missing, install works exit 0 exit 0
    Rosetta missing, install fails exit 1 exit 1
  • /usr/bin/python3 -c "import yaml; yaml.safe_load(...)" on build.yml: parses, 7 jobs.
  • python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main: clean.

Not run: the workflow on GitHub, and a macOS x86_64 relinker job on a real runner. Whether the runner image already has Rosetta is inferred from the failure message.

Checklist

  • Based on current main
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: n/a
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5106181187 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14332). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-01T09:40:49Z. --- ### What The macOS x86_64 relinker job in `.github/workflows/build.yml` runs `sudo softwareupdate --install-rosetta --agree-to-license` unconditionally. On pull request #14315's run (`41290340866`, job `124801037258`), that step failed with `Rosetta 2 update is not available` and exit 1. Every later step was then skipped, so the job reported a failure before it built or tested anything. The message suggests Rosetta was already installed on that runner image; that is inferred from the message, not confirmed on the runner. The step now runs the install only when an x86_64 binary cannot run: ``` arch -x86_64 /usr/bin/true || sudo softwareupdate --install-rosetta --agree-to-license ``` Commit `5c7cfdb30f`, one line. ### Tested Linux, Python 3.11.2 for the YAML check, on `upstream/main` `26fa1212b8` plus this commit. The macOS runner was not available here, so the step's control flow was checked with mocks. - Mock run of the old and new step text under `bash --noprofile --norc -e -o pipefail`, which is the shell GitHub uses for `run:` on macOS. The mocks are `arch`, `sudo` and `softwareupdate` on `PATH`. Three cases: | Case | Old step | New step | |---|---|---| | Rosetta installed, `softwareupdate` reports it unavailable | exit 1, `softwareupdate` called | exit 0, `softwareupdate` not called | | Rosetta missing, install works | exit 0 | exit 0 | | Rosetta missing, install fails | exit 1 | exit 1 | - `/usr/bin/python3 -c "import yaml; yaml.safe_load(...)"` on `build.yml`: parses, 7 jobs. - `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main`: clean. Not run: the workflow on GitHub, and a macOS x86_64 relinker job on a real runner. Whether the runner image already has Rosetta is inferred from the failure message. ### Checklist - [x] Based on current `main` - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: n/a - [x] AI-assisted: yes
MarcZX10 commented 2026-11-02 06:11:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-02T06:11:50Z.

Review: COMMENTED


Reviewed — no blocking findings

The x86_64 macOS relinker step now installs Rosetta only when arch -x86_64 /usr/bin/true fails. The macOS x86_64 relinker job that ran on this head passed, and its Rosetta step exited without installing anything, so the probe succeeded on that runner. The install branch itself did not run.

What I ran

  • Head 5c7cfdb30f3064d9b7f1f709fdab451054701ec4; base 26fa1212b82f76dd49cf12d65e445d6ff3e0844c. 1 file, one line changed: .github/workflows/build.yml (the Rosetta step for matrix.architectures == 'x86_64').
  • Read the diff. The new step runs arch -x86_64 /usr/bin/true || sudo softwareupdate --install-rosetta --agree-to-license.
  • Hosted: the macOS x86_64 relinker job (relinker (macos-latest, clang++, x86_64), job 124813042057) ran the step at 10:04:05 UTC with no output, which means the probe exited 0. Its CTest run passed 538 of 538, including to_rosetta.
  • Read-only checks from the trusted main checkout: diff check, conventions and PR template, and the stack check all passed. The ABI audit is not applicable.
  • No MarcZX10 review at this head.

Results

Check Result Note
Diff check passed
Conventions and PR template passed conventions check from the main checkout
Mergeability and dependencies passed stack check passed
Probe succeeds on a runner that already has Rosetta passed hosted: the step printed nothing, and the job's CTest passed 538 of 538
Install branch on a runner without Rosetta not verified no hosted run takes that branch
Probe logic for Intel runners and Apple silicon passed by reading an Intel Mac runs arch -x86_64 natively, so the probe succeeds there too
ABI audit not applicable no export changed
Build and runtime tests (Linux) not applicable workflow change only
Negative controls not run no local build
Hosted CI passed relinkers passed (macOS clang++ and x86_64, ubuntu g++, windows g++, asan); windows and linux skipped
Read-only check output

Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: passed. Hosted: gh api repos/boykopovar/AnyPS5/commits/5c7cfdb30f3064d9b7f1f709fdab451054701ec4/check-runs, and the macOS x86_64 relinker job log.

Negative control

Not run here. A negative control would need a macOS runner without Rosetta, and none is in this run.

Findings

Blocking

None.

Non-blocking

  • The || also installs Rosetta when the probe fails for a reason other than a missing Rosetta. That is acceptable, because installing is the old behaviour, but the step cannot tell the two causes apart.

Sources

Not verified

  • The install branch on a runner without Rosetta.

To get this to a good state

  • Nothing to change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5732699035 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/14332#pullrequestreview-5732699035). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-02T06:11:50Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The x86_64 macOS relinker step now installs Rosetta only when `arch -x86_64 /usr/bin/true` fails. The macOS x86_64 relinker job that ran on this head passed, and its Rosetta step exited without installing anything, so the probe succeeded on that runner. The install branch itself did not run. ## What I ran - Head `5c7cfdb30f3064d9b7f1f709fdab451054701ec4`; base `26fa1212b82f76dd49cf12d65e445d6ff3e0844c`. 1 file, one line changed: `.github/workflows/build.yml` (the Rosetta step for `matrix.architectures == 'x86_64'`). - Read the diff. The new step runs `arch -x86_64 /usr/bin/true || sudo softwareupdate --install-rosetta --agree-to-license`. - Hosted: the macOS x86_64 relinker job (`relinker (macos-latest, clang++, x86_64)`, job 124813042057) ran the step at 10:04:05 UTC with no output, which means the probe exited 0. Its CTest run passed 538 of 538, including `to_rosetta`. - Read-only checks from the trusted main checkout: diff check, conventions and PR template, and the stack check all passed. The ABI audit is not applicable. - No MarcZX10 review at this head. ## Results | Check | Result | Note | | --- | --- | --- | | Diff check | passed | | | Conventions and PR template | passed | conventions check from the main checkout | | Mergeability and dependencies | passed | stack check passed | | Probe succeeds on a runner that already has Rosetta | passed | hosted: the step printed nothing, and the job's CTest passed 538 of 538 | | Install branch on a runner without Rosetta | not verified | no hosted run takes that branch | | Probe logic for Intel runners and Apple silicon | passed by reading | an Intel Mac runs `arch -x86_64` natively, so the probe succeeds there too | | ABI audit | not applicable | no export changed | | Build and runtime tests (Linux) | not applicable | workflow change only | | Negative controls | not run | no local build | | Hosted CI | passed | relinkers passed (macOS clang++ and x86_64, ubuntu g++, windows g++, asan); windows and linux skipped | <details><summary>Read-only check output</summary> Precheck was not run: no PR-head code is run here. Diff check: passed. Conventions: passed. ABI audit: not applicable. Stack check: passed. Hosted: `gh api repos/boykopovar/AnyPS5/commits/5c7cfdb30f3064d9b7f1f709fdab451054701ec4/check-runs`, and the macOS x86_64 relinker job log. </details> ## Negative control Not run here. A negative control would need a macOS runner without Rosetta, and none is in this run. ## Findings **Blocking** None. **Non-blocking** - The `||` also installs Rosetta when the probe fails for a reason other than a missing Rosetta. That is acceptable, because installing is the old behaviour, but the step cannot tell the two causes apart. ## Sources - Workflow: https://github.com/boykopovar/AnyPS5/blob/5c7cfdb30f3064d9b7f1f709fdab451054701ec4/.github/workflows/build.yml (line 331) - Hosted log: macOS x86_64 relinker job 124813042057 ## Not verified - The install branch on a runner without Rosetta. ## To get this to a good state - Nothing to change.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!14332
No description provided.