|
| 1 | +id: runner-environment-509 |
| 2 | +title: 'macos-15 (Arm64) Missing SwiftLint Despite Readme Listing It as Installed' |
| 3 | +category: runner-environment |
| 4 | +severity: error |
| 5 | +tags: |
| 6 | + - macos-15 |
| 7 | + - arm64 |
| 8 | + - swiftlint |
| 9 | + - swift |
| 10 | + - homebrew |
| 11 | + - tool-not-found |
| 12 | + - runner-readme |
| 13 | +patterns: |
| 14 | + - regex: 'swiftlint.*command not found|command not found.*swiftlint' |
| 15 | + flags: 'i' |
| 16 | + - regex: 'No such file or directory.*swiftlint|swiftlint.*No such file or directory' |
| 17 | + flags: 'i' |
| 18 | + - regex: 'which swiftlint.*$|swiftlint: not found' |
| 19 | + flags: 'im' |
| 20 | +error_messages: |
| 21 | + - "/Users/runner/work/_temp/....sh: line 2: swiftlint: command not found" |
| 22 | + - "ls: /opt/homebrew/bin/swiftlint: No such file or directory" |
| 23 | + - "ls: /usr/local/bin/swiftlint: No such file or directory" |
| 24 | +root_cause: | |
| 25 | + The macOS-15 runner image comes in two architecture variants: `macos-15` (Arm64, the default |
| 26 | + when you specify `runs-on: macos-15`) and `macos-15-intel` (Intel/x86_64). These two variants |
| 27 | + do NOT have identical toolsets. |
| 28 | +
|
| 29 | + SwiftLint is preinstalled on `macos-15-intel` but is NOT preinstalled on `macos-15` (Arm64). |
| 30 | + The official Readme linked from search engines and the runner-images repository |
| 31 | + (`images/macos/macos-15-Readme.md`) documents the Intel variant's software list. This creates |
| 32 | + a documentation mismatch: the Readme confirms SwiftLint is "installed", but workflows |
| 33 | + targeting the default `macos-15` label (which resolves to Arm64) will fail with |
| 34 | + "command not found". |
| 35 | +
|
| 36 | + This affects any workflow that: |
| 37 | + - Runs `swiftlint` directly (e.g., `run: swiftlint .`) |
| 38 | + - Uses a SwiftLint GitHub Action that expects the binary to be pre-available |
| 39 | + - Migrated from `macos-14` or `macos-latest` (previously Intel) to `macos-15` (now Arm64) |
| 40 | +
|
| 41 | + Source: runner-images#14239 (June 15, 2026, open) |
| 42 | +fix: | |
| 43 | + Install SwiftLint explicitly in your workflow using Homebrew before running it. This is the |
| 44 | + recommended approach for Arm64 runners and ensures a pinnable, reproducible version: |
| 45 | +
|
| 46 | + Option 1 (install via brew): Add a step to install SwiftLint with `brew install swiftlint`. |
| 47 | + Option 2 (use mint): Use Mint package manager to install a pinned version. |
| 48 | + Option 3 (Intel runner): Use `macos-15-intel` if your workflow specifically requires the |
| 49 | + Intel variant and you need the preinstalled SwiftLint without additional setup. |
| 50 | +
|
| 51 | + Note: Installing via Homebrew on Arm64 runners adds ~30–90 seconds to workflow time. |
| 52 | +fix_code: |
| 53 | + - language: yaml |
| 54 | + label: "Install SwiftLint via Homebrew on macos-15 (Arm64)" |
| 55 | + code: | |
| 56 | + jobs: |
| 57 | + lint: |
| 58 | + runs-on: macos-15 # Arm64 — SwiftLint not preinstalled |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + - name: Install SwiftLint |
| 62 | + run: brew install swiftlint |
| 63 | + - name: Run SwiftLint |
| 64 | + run: swiftlint . |
| 65 | + - language: yaml |
| 66 | + label: "Pin SwiftLint version with brew install --formula" |
| 67 | + code: | |
| 68 | + jobs: |
| 69 | + lint: |
| 70 | + runs-on: macos-15 |
| 71 | + steps: |
| 72 | + - uses: actions/checkout@v4 |
| 73 | + - name: Install pinned SwiftLint |
| 74 | + run: | |
| 75 | + brew install swiftlint |
| 76 | + swiftlint version |
| 77 | + - name: Lint |
| 78 | + run: swiftlint lint --reporter github-actions-logging |
| 79 | + - language: yaml |
| 80 | + label: "Use norio-nomura/action-swiftlint action (installs SwiftLint automatically)" |
| 81 | + code: | |
| 82 | + jobs: |
| 83 | + lint: |
| 84 | + runs-on: macos-15 |
| 85 | + steps: |
| 86 | + - uses: actions/checkout@v4 |
| 87 | + - name: SwiftLint |
| 88 | + uses: norio-nomura/action-swiftlint@3.2.1 |
| 89 | +prevention: |
| 90 | + - "Never assume tool availability based on the runner-images Readme without confirming which |
| 91 | + architecture variant the Readme describes. The macos-15-Readme.md covers Intel (macos-15-intel), |
| 92 | + not the default Arm64 runner." |
| 93 | + - "Explicitly install tools you depend on rather than relying on preinstalled versions — this |
| 94 | + also gives you control over the version and avoids silent upgrades breaking your workflow." |
| 95 | + - "When migrating from macOS Intel runners (macos-14, macos-latest prior to macos-26) to |
| 96 | + macos-15 or macos-26, audit your toolchain assumptions: Arm64 and Intel images do not have |
| 97 | + identical preinstalled software." |
| 98 | + - "Add a toolchain validation step early in your workflow (`which swiftlint && swiftlint version`) |
| 99 | + to fail fast with a clear message rather than failing deep in your lint/build steps." |
| 100 | +docs: |
| 101 | + - url: "https://github.com/actions/runner-images/issues/14239" |
| 102 | + label: "runner-images#14239: macos-15 runner claims swiftlint is installed but it is not found (June 2026)" |
| 103 | + - url: "https://github.com/actions/runner-images/blob/main/images/macos/macos-15-Readme.md" |
| 104 | + label: "macos-15 (Intel) runner image installed software Readme" |
| 105 | + - url: "https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners#standard-github-hosted-runners-for-public-repositories" |
| 106 | + label: "GitHub Docs: GitHub-hosted runner hardware and OS specifications" |
0 commit comments