Add Linux support for SwiftMETAR core library and DecodeWindsAloft#20
Merged
Conversation
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>
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
swift build/swift testgreen onswift:6.3) for theSwiftMETARcore library,DecodeWindsAloftCLI, andSwiftMETARTests.URLSession→FoundationNetworkingconditional import (DecodeMETAR, DecodeTAF, DecodeWindsAloft);XMLParser/XMLParserDelegate→FoundationXMLconditional import (METARXMLParser, TAFXMLParser).LinuxLocalization.swiftshim: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, sincedefaultLocalization: "en"). This letsError.swiftdrop its redundant#if canImport(Darwin)guards.METARFormatting(andDecodeMETAR/DecodeTAF, which depend on it) formatMeasurementvalues withMeasurement.FormatStyleand the\(_, format:)string-interpolation sugar for customFormatStyletypes — neither exists in swift-corelibs-foundation. Rather than reimplement that from scratch,Package.swiftnow only defines those 3 targets/products on non-Linux platforms; all 5 targets still build/test clean on macOS.ubuntu-latest× {Swift 6.1, Swift 6.3} to the test matrix.Test plan
swift build→Build complete!(swift:6.3 container)swift test→ 225 tests / 67 suites passedswift run decode-winds-aloft --helpworksswift build→ all 5 targets (incl. METARFormatting/DecodeMETAR/DecodeTAF) build cleanswift test→ 225 tests / 67 suites passedactionlintclean on the updated workflowCo-Authored-By: Claude Opus 4.8 (1M context) noreply@anthropic.com