Skip to content

Pin Swift macOS PR checks to macOS 15 for Xcode 16#3971

Merged
henrymercer merged 3 commits into
mainfrom
henrymercer/macos-runner-migration
Jun 23, 2026
Merged

Pin Swift macOS PR checks to macOS 15 for Xcode 16#3971
henrymercer merged 3 commits into
mainfrom
henrymercer/macos-runner-migration

Conversation

@henrymercer

@henrymercer henrymercer commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

The macos-latest-xlarge label has started resolving to macOS 26, which ships only Xcode 26 (Swift 6.2) and no longer includes Xcode 16. Our Swift-analysing PR checks explicitly select Xcode 16 (xcode-select -s /Applications/Xcode_16.app) because CodeQL CLI versions before 2.24.0 only support Swift up to 6.1. That step now fails on macOS 26, which is why the Multi-language repository check is red.

We still want to exercise the full matrix of supported CodeQL versions (back to 2.19.4) against Swift, so we can't simply move to Xcode 26. Instead, this pins the affected checks to macOS 15, where Xcode 16 is still available:

  • multi-language-autodetect: macos-latest-xlarge -> macos-15-xlarge

This restores the runner that macos-latest-xlarge pointed at before the migration, so it is a known-good configuration. The generated __*.yml workflows were regenerated via npm run update-pr-checks. Once the minimum supported CodeQL version reaches 2.24.0, these checks can drop the Xcode 16 pin and move back to macos-latest.

The nightly-only Swift checks (swift-autobuild, export-file-baseline-information) are intentionally left on macOS 26, since nightly CodeQL supports Swift 6.2 with the default Xcode.

See actions/runner-images#14167.

Risk assessment

For internal use only. Please select the risk level of this change:

  • Low risk: Changes are fully under feature flags, or have been fully tested and validated in pre-production environments and are highly observable, or are documentation or test only.

Which use cases does this change impact?

Environments:

  • Testing/None - This change does not impact any CodeQL workflows in production.

How did/will you validate this change?

  • End-to-end tests - I am depending on PR checks (i.e. tests in pr-checks).

If something goes wrong after this change is released, what are the mitigation and rollback strategies?

  • Development/testing only - This change cannot cause any failures in production.

How will you know if something goes wrong after this change is released?

  • Other - The affected PR checks will fail in CI.

Are there any special considerations for merging or releasing this change?

  • No special considerations - This change can be merged at any time.

Merge / deployment checklist

  • Confirm this change is backwards compatible with existing workflows.
  • Consider adding a changelog entry for this change. N/A - CI/test-only change with no user-facing impact.
  • Confirm the readme and docs have been updated if necessary. N/A

`macos-latest-xlarge` now resolves to macOS 26, which ships only Xcode 26
(Swift 6.2) and no longer includes Xcode 16. The Swift-analysing PR checks
select Xcode 16 because CodeQL CLI versions before 2.24.0 only support Swift
up to 6.1, so `xcode-select -s /Applications/Xcode_16.app` fails on macOS 26.

Pin these checks to macOS 15, where Xcode 16 is still available, so we keep
testing the full matrix of supported CodeQL versions. This also pre-empts the
`swift-custom-build` check failing once plain `macos`/`macos-latest` migrates.

See actions/runner-images#14167.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added the size/XS Should be very easy to review label Jun 23, 2026
Comment thread pr-checks/checks/swift-custom-build.yml Outdated
Comment thread pr-checks/checks/multi-language-autodetect.yml
Rather than pinning every macOS job to macOS 15, only run the older CodeQL CLI
versions (which need Xcode 16, and so macOS 15) there. Newer versions, which
support Swift 6.2, run on the latest macOS runner with its default Xcode, so we
keep exercising the common latest-CLI-on-latest-runner combination.

To express this, `sync.ts` now supports an optional per-OS-entry
`codeql-versions` filter, used by `multi-language-autodetect` to send old
versions to `macos-15-xlarge` and new versions to `macos-latest-xlarge`.

`swift-custom-build` only runs `linked`/`default`/`nightly`, which all support
Swift 6.2, so it no longer needs the Xcode 16 step or a macOS 15 pin.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@henrymercer henrymercer marked this pull request as ready for review June 23, 2026 15:40
@henrymercer henrymercer requested a review from a team as a code owner June 23, 2026 15:40
Copilot AI review requested due to automatic review settings June 23, 2026 15:40
@github-actions github-actions Bot added size/S Should be easy to review and removed size/XS Should be very easy to review labels Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

  • Copilot's review of this pull request may be incomplete because some of the changed files are excluded by your Copilot content exclusion settings. See Excluding content from Copilot for details.

Pull request overview

This PR updates the PR-check workflow generation to allow selecting different macOS runner images per CodeQL CLI version, addressing recent macos-latest(-xlarge) migrations that removed Xcode 16 (needed by older CodeQL CLIs for Swift).

Changes:

  • Extend pr-checks/sync.ts job-matrix generation to support per-OS-entry codeql-versions filtering.
  • Update multi-language-autodetect to split macOS runs across macos-latest-xlarge (newer CLIs) and macos-15-xlarge (older CLIs), selecting Xcode 16 only on the macOS 15 runner.
  • Remove the Xcode 16 selection step from swift-custom-build (note: the template currently still targets moving macos-latest unless additionally pinned).
Show a summary per file
File Description
pr-checks/sync.ts Adds codeql-versions support so a single check can map different CodeQL versions to different runner images.
pr-checks/checks/multi-language-autodetect.yml Splits macOS coverage between newer and older CodeQL CLI versions using different runner-image labels; gates Xcode 16 selection to macOS 15.
pr-checks/checks/swift-custom-build.yml Removes explicit Xcode 16 selection step; currently still uses unpinned macos runner selection in the template.

Copilot's findings

Files excluded by content exclusion policy (2)
  • .github/workflows/__multi-language-autodetect.yml
  • .github/workflows/__swift-custom-build.yml
  • Files reviewed: 3/5 changed files
  • Comments generated: 1

Comment thread pr-checks/checks/swift-custom-build.yml
@henrymercer henrymercer requested a review from mbg June 23, 2026 15:58
mbg
mbg previously approved these changes Jun 23, 2026

@mbg mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing those comments! This looks OK to merge, but with one maintenance concern and one question about the included CodeQL versions.

Comment thread pr-checks/checks/multi-language-autodetect.yml Outdated
Comment thread pr-checks/checks/multi-language-autodetect.yml Outdated
Redesign the per-entry codeql-versions filter so an OS entry without a
version list catches all versions not claimed by its siblings. This lets
new CodeQL versions flow to macos-latest-xlarge automatically. Move
v2.23.9 (which supports Swift 6.2) off the macOS 15 list and simplify the
matrix filter logic.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

@mbg mbg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks! Nothing blocking here, just one comment that resulted from my experience reviewing the most recent change. Feel free to merge as-is.

Comment thread pr-checks/sync.ts
// For each OS, collect the CodeQL versions explicitly claimed by entries that specify
// `codeql-versions`. A sibling entry for the same OS that omits `codeql-versions` runs all
// versions not in this set.
const claimedVersionsByOs = new Map<string, Set<string>>();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor: This mapping is indexed by the .os key, which is shared among all siblings. The "claimedVersionsByOs" naming here is therefore a bit confusing because it seems to say something about which OS has claimed which versions. Changing this to e.g. handledVersionsByOS or similar might be slightly clearer.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll leave this as is so we can get the checks passing on main 👍

@henrymercer henrymercer added this pull request to the merge queue Jun 23, 2026
Merged via the queue into main with commit ade8366 Jun 23, 2026
225 checks passed
@henrymercer henrymercer deleted the henrymercer/macos-runner-migration branch June 23, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/S Should be easy to review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants