MacOS 15 dependency issue - Crash in Swiftlint 0.59.0
Description
There is a crash in Swiftlint 0.59.0, see here: https://github.com/realm/SwiftLint/issues/6052
This dependency was updated in the MacOS 15 image 3 days ago, which started breaking my build.
Platforms affected
- [ ] Azure DevOps
- [ ] GitHub Actions - Standard Runners
- [ ] GitHub Actions - Larger Runners
Runner images affected
- [ ] Ubuntu 20.04
- [ ] Ubuntu 22.04
- [ ] Ubuntu 24.04
- [ ] macOS 13
- [ ] macOS 13 Arm64
- [ ] macOS 14
- [ ] macOS 14 Arm64
- [x] macOS 15
- [ ] macOS 15 Arm64
- [ ] Windows Server 2019
- [ ] Windows Server 2022
- [ ] Windows Server 2025
Image version and build link
20250408.1132
Is it regression?
20250331.1080
Expected behavior
Swiftlint runs without crashing
Actual behavior
Swiftlint error:
parser: expected all keys to be unique but found the following duplicated key(s):
Repro steps
Run swiftlint on your project
Hi @andrewclaus - We will look into the issue and keep you posted with the updates. Thank you.
Hi @andrewclaus,
I was able to successfully reproduce the issue. Starting from image version 20250408.1132, the SwiftLint version was upgraded to 0.59.0. I also tested this with 0.59.1, and both versions are crashing when the configuration .swiftlint.yml contains duplicate keys and SwiftLint is run from the root directory.It may be due to strict validation to catch duplicate keys in the newer versions/ may be a bug from their end.
In earlier image versions like 20250331.1080, the SwiftLint version was 0.58.2, and it handled the same duplicate key issue by just showing a warning — no crash. So this clearly shows it's a change in behavior from SwiftLint, not an issue with the runner itself.
Suggestion: If your config file has duplicate keys, try running SwiftLint from inside the subdirectory containing the config instead of from the root — this avoids the crash(for version 0.59.0) / avoid any duplicate keys in .swiftlint.yml
Hi @andrewclaus ,Just checking in—since this issue is due to changes in the newer SwiftLint versions (not the runner) , are we okay to close this issue?
Hi @andrewclaus,
As we discussed earlier, the issue you're seeing is caused by recent SwiftLint versions 0.59.0 and 0.59.1, which have dropped support for duplicate keys in configuration files. This change is likely causing your workflow to fail if your config contains duplicates.
The issue does not occur with SwiftLint v0.58.2, which still supports duplicate keys. You can resolve the problem by downgrading SwiftLint in your workflow using a pinned Homebrew formula.
Here's a step you can add to your GitHub Actions workflow to install SwiftLint 0.58.2:
- name: Install SwiftLint 0.58.2 from pinned Homebrew formula
run: |
echo "Installing SwiftLint 0.58.2 via pinned formula..."
swiftlint_commit="f46d29944b415df9f1eedad85e4fde41a948c7c0"
swiftlint_rb_link="https://raw.githubusercontent.com/Homebrew/homebrew-core/$swiftlint_commit/Formula/s/swiftlint.rb"
curl -sSL "$swiftlint_rb_link" -o swiftlint.rb
brew install --formula ./swiftlint.rb
This should restore compatibility with your existing .swiftlint.yml configuration and get your workflow running again.