You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Linux binary fails on Ubuntu 26.04: libxml2.so.2 not found #6966
The dynamically linked Linux binary swiftlint from the release archives (swiftlint_linux_amd64.zip, 0.65.1) doesn't start on Ubuntu 26.04, which GitHub Actions now uses for ubuntu-latest:
$ swiftlint lint --strict --reporter github-actions-logging
swiftlint: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory
Ubuntu 26.04 ships a newer libxml2 with a different soname, so libxml2.so.2 no longer exists there. As far as I can tell, the dependency comes in through FoundationXML, which is linked statically with -static-stdlib in make spm_linux_build and is pulled in by SWXMLHash (via SourceKitten). The binary is built on Ubuntu 24.04 (noble), so it's bound to that libxml2 soname.
swiftlint-static from the same archive works, because it has no dynamic dependencies, but it disables all rules that need SourceKit, so it isn't a full replacement.
Possible directions (I haven't tried any of them):
Link libxml2 statically into the dynamic swiftlint binary.
Additionally publish a build made on Ubuntu 26.04.
The current workaround is to keep the lint job on ubuntu-24.04.
Environment
SwiftLint version: 0.65.1
Xcode version: n/a (Linux)
Installation method used: release archive swiftlint_linux_amd64.zip (installed through mise, aqua backend)
OS: Ubuntu 26.04 (GitHub Actions runner ubuntu-26.04); works on ubuntu-24.04
Configuration file: not relevant, the binary fails before reading it.
SwiftLint depends on SourceKitten but doesn't use its XML parsing. libxml2 comes in because SourceKitten depends on SWXMLHash, which uses FoundationXML, which links libxml2.
When I replaced SWXMLHash in SourceKitten with xylem, an XML library written in pure Swift, SwiftLint no longer linked libxml2 and ran on Ubuntu 26.04.
However, xylem requires Swift 6.3 or later on Linux (and macOS 26, so macOS would have to keep using XMLParser), so I haven't opened a PR. I opened jpsim/SourceKitten#855 instead.
Compared with publishing separate libxml2.so.16 builds as in #6967, I'd appreciate your thoughts on this direction.
Activity
Ran CI SwiftLint from its official Docker image on ubuntu-latest. (#410)
Bumped CI lint pins to local versions and ran SwiftLint from its imag…
zunda-pixel commentedon Dec 2, 2026
SwiftLint depends on SourceKitten but doesn't use its XML parsing. libxml2 comes in because SourceKitten depends on SWXMLHash, which uses FoundationXML, which links libxml2.
When I replaced SWXMLHash in SourceKitten with xylem, an XML library written in pure Swift, SwiftLint no longer linked libxml2 and ran on Ubuntu 26.04.
However, xylem requires Swift 6.3 or later on Linux (and macOS 26, so macOS would have to keep using
XMLParser), so I haven't opened a PR. I opened jpsim/SourceKitten#855 instead.Compared with publishing separate
libxml2.so.16builds as in #6967, I'd appreciate your thoughts on this direction.