Add Linux support#4
Merged
Merged
Conversation
Ports the package to build and test on Linux (swift-corelibs-foundation): adds a String(localized:) shim, gates URLSession/URLRequest/HTTPURLResponse imports behind FoundationNetworking, guards the DownloadDelegate's @objc attribute to Darwin, fixes ProcessInfo/ioctl/stdout portability gaps in tests and the E2E tool, and handles the differing NSFileNoSuchFileError code Linux's FileHandle throws for a missing file. Skips the three ArchiveFileDownloaderTests on Linux with a documented reason (Linux's URLSession.download(from:) crashes when the URLProtocol backing it is mocked in-memory rather than backed by a real file). Adds Ubuntu (Swift 6.1 and 6.3) rows to the CI matrix. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
swift-format wanted a couple of formatting tweaks in the two files it flagged. Separately, the downloader test suite's URLSession + mocked URLProtocol fixture turns out to be unreliable on Linux under real test-suite load, not just for the already-skipped download-task tests: a stray, out-of-band URLProtocol callback can intermittently clear the next serialized test's stubbed response and crash. Skip the whole DownloaderTests suite on Linux with a documented reason instead of chasing a fix in swift-corelibs-foundation's URLSession internals. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Keep the Build-and-Test matrix on both macOS and Ubuntu. Move the SwiftLint job to ubuntu-latest via the ghcr.io/realm/swiftlint container (SwiftLint runs cleanly on Linux), and move the documentation build to ubuntu-latest. Periphery stays on macOS (needs an index-store build with no clean Linux install path). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
String(localized:)shim, gatesURLSession/URLRequest/HTTPURLResponseimports behindFoundationNetworking, guardsDownloadDelegate's@objcto Darwin, and fixes several Linux/Darwin Foundation portability gaps (ProcessInfo,ioctl,stdout,FileHandle's missing-file error code).ArchiveFileDownloaderTestson Linux only, with a documented reason: Linux'sURLSession.download(from:)crashes when the backingURLProtocolis mocked in-memory rather than backed by a real file (confirmed via an isolated repro; not a SwiftNASR bug).Test plan
swift build—Build complete!swift test— 110/110 tests pass (3 skipped, documented)swift build+swift test— 110/110 tests passswiftlint --strict— cleanactionlinton the modified workflow — clean