realm / SwiftLint

A tool to enforce Swift style and conventions.
https://realm.github.io/SwiftLint
MIT License
18.58k stars 2.22k forks source link

SwiftLint 0.56.1 is not available via Homebrew #5735

Closed mildm8nnered closed 3 weeks ago

mildm8nnered commented 1 month ago
% brew info swiftlint
==> swiftlint: stable 0.55.1 (bottled), HEAD
Tool to enforce Swift style and conventions
https://github.com/realm/SwiftLint
Installed
/opt/homebrew/Cellar/swiftlint/0.55.1 (10 files, 45MB) *
  Poured from bottle using the formulae.brew.sh API on 2024-06-02 at 19:56:09
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/s/swiftlint.rb
License: MIT
==> Dependencies
Build: swift ✘
==> Requirements
Required: Xcode >= 8.0 (on macOS) ✔
==> Options
--HEAD
    Install HEAD version
==> Caveats
zsh completions have been installed to:
  /opt/homebrew/share/zsh/site-functions
==> Analytics
install: 37,203 (30 days), 114,856 (90 days), 373,369 (365 days)
install-on-request: 37,203 (30 days), 114,859 (90 days), 373,344 (365 days)
build-error: 1 (30 days)
SimplyDanny commented 1 month ago

The PR to update it got stuck in the macOS 12 build with a for me yet unclear error. I've set up jobs to test macOS versions that SwiftLint still claims to support and that are older than the latest version used in all existing general build tasks. The job for macOS 12 fails as well. So this seems to be a real issue we need to investigate.

Please feel free to support while I'm currently not working on it.

mildm8nnered commented 1 month ago

I can try to take a look, although I'm not that familiar with the home-brew stuff, except as a user.

From the pre-test steps on the failed CI job at https://github.com/Homebrew/homebrew-core/actions/runs/10273598571/job/28428511893?pr=180295 for macOS 12 ARM64, it says Xcode: 14.2

What actually needs to run on macOS12 - I don't think we can actually build on there because we require Xcode 15 I think (e.g. Xcode 14.3.1 fails for me with "package 'swiftlint' is using Swift tools version 5.9.0 but the installed version is 5.8.0".)

SimplyDanny commented 1 month ago

SwiftLint doesn't actually have a dependency on Xcode. The previous release was already built with plain Swift toolchains on macOS 12 and 13 in Homebrew. This is specified in the Homebrew formula for SwiftLint:

depends_on xcode: "8.0"

uses_from_macos "swift"

on_sonoma :or_newer do
  depends_on xcode: ["15.3", :build]
end
on_ventura :or_older do
  depends_on "swift" => :build
end

Perhaps this is a SwiftSyntax issue which I reported in https://github.com/swiftlang/swift-syntax/issues/2784. At least the folks there might be able to help out.

mildm8nnered commented 1 month ago

So that ticket has some responses which sound promising

jessesquires commented 3 weeks ago

Looks like https://github.com/swiftlang/swift-syntax/issues/2784 lead to https://github.com/swiftlang/swift-syntax/pull/2801, which has been merged.

It looks like swift-syntax tagged a new pre-release that includes the change: https://github.com/swiftlang/swift-syntax/releases/tag/600.0.0-prerelease-2024-08-14

Does this unblock update homebrew?

SimplyDanny commented 3 weeks ago

Blocking was that SwiftLint didn't build on macOS 12 (independent of the changes in SwiftSyntax). We excluded the version and now 0.56.1 is available via Homebrew on macOS 13 and 14 at least.