Skip to content

Add Linux support for SwiftMETAR core library and DecodeWindsAloft#20

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

Add Linux support for SwiftMETAR core library and DecodeWindsAloft#20
RISCfuture merged 3 commits into
mainfrom
linux-support

Conversation

@RISCfuture

Copy link
Copy Markdown
Owner

Summary

  • Add Linux support (swift build/swift test green on swift:6.3) for the SwiftMETAR core library, DecodeWindsAloft CLI, and SwiftMETARTests.
  • URLSessionFoundationNetworking conditional import (DecodeMETAR, DecodeTAF, DecodeWindsAloft); XMLParser/XMLParserDelegateFoundationXML conditional import (METARXMLParser, TAFXMLParser).
  • Add a small per-module LinuxLocalization.swift shim: String(localized:) isn't implemented by swift-corelibs-foundation, so on Linux it resolves each key to itself (the English text is already the lookup key, since defaultLocalization: "en"). This lets Error.swift drop its redundant #if canImport(Darwin) guards.
  • METARFormatting (and DecodeMETAR/DecodeTAF, which depend on it) format Measurement values with Measurement.FormatStyle and the \(_, format:) string-interpolation sugar for custom FormatStyle types — neither exists in swift-corelibs-foundation. Rather than reimplement that from scratch, Package.swift now only defines those 3 targets/products on non-Linux platforms; all 5 targets still build/test clean on macOS.
  • CI: add ubuntu-latest × {Swift 6.1, Swift 6.3} to the test matrix.

Test plan

  • Linux swift buildBuild complete! (swift:6.3 container)
  • Linux swift test → 225 tests / 67 suites passed
  • Linux swift run decode-winds-aloft --help works
  • macOS native swift build → all 5 targets (incl. METARFormatting/DecodeMETAR/DecodeTAF) build clean
  • macOS native swift test → 225 tests / 67 suites passed
  • actionlint clean on the updated workflow
  • CI green on this PR (Ubuntu + existing macOS matrix)

Co-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com

RISCfuture and others added 3 commits July 6, 2026 19:43
URLSession and XMLParser move to FoundationNetworking/FoundationXML on
Linux, and String(localized:)/LocalizedStringResource aren't
implemented by swift-corelibs-foundation, so a small per-module shim
resolves each key to itself there. METARFormatting (and the
DecodeMETAR/DecodeTAF CLIs that depend on it) format Measurement
values using Measurement.FormatStyle and the \(_, format:) string
interpolation sugar, neither of which swift-corelibs-foundation
implements, so those targets are only defined on Apple platforms;
SwiftMETAR core and DecodeWindsAloft don't use those APIs and now
build and test on Linux.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… shim

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 43bfc1d into main 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