Skip to content

Add Linux support#4

Merged
RISCfuture merged 3 commits into
masterfrom
linux-support
Jul 7, 2026
Merged

Add Linux support#4
RISCfuture merged 3 commits into
masterfrom
linux-support

Conversation

@RISCfuture

Copy link
Copy Markdown
Owner

Summary

  • Ports SwiftNASR to build and test on Linux (swift-corelibs-foundation).
  • Adds a String(localized:) shim, gates URLSession/URLRequest/HTTPURLResponse imports behind FoundationNetworking, guards DownloadDelegate's @objc to Darwin, and fixes several Linux/Darwin Foundation portability gaps (ProcessInfo, ioctl, stdout, FileHandle's missing-file error code).
  • Skips the 3 ArchiveFileDownloaderTests on Linux only, with a documented reason: Linux's URLSession.download(from:) crashes when the backing URLProtocol is mocked in-memory rather than backed by a real file (confirmed via an isolated repro; not a SwiftNASR bug).
  • Adds Ubuntu (Swift 6.1 and 6.3) rows to the CI matrix.

Test plan

  • Linux swift buildBuild complete!
  • Linux swift test — 110/110 tests pass (3 skipped, documented)
  • macOS swift build + swift test — 110/110 tests pass
  • swiftlint --strict — clean
  • actionlint on the modified workflow — clean
  • CI green on GitHub Actions (Ubuntu jobs)

RISCfuture and others added 3 commits July 6, 2026 20:02
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>
@RISCfuture RISCfuture merged commit a272c2f into master Jul 7, 2026
8 checks passed
@RISCfuture RISCfuture deleted the linux-support branch July 7, 2026 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant