Wave 3 (0.6.0): zero-OpenCombine builds on Apple platforms#22
Merged
Conversation
Since #11 every source file selects its backend with #if canImport(Combine): Apple platforms compile against native Combine, so linking OpenCombine there was pure dead weight (5 extra modules built into every Apple consumer). The product dependency now carries .when(platforms: [.wasi, .linux, .android, .windows, .openbsd]) on all three consuming targets - every non-Apple platform PackageDescription 6.3 exposes, because canImport(Combine) is false on all of them, not just WASI; listing only .wasi would silently break Linux consumers. .freebsd is gated @available(_PackageDescription 999.0) and cannot be listed yet. The package-level .package(url:) declaration stays (full removal deferred), so OpenCombine and its transitive swift-syntax are still fetched at resolution time on every platform - only the build/link footprint drops: a clean macOS build now compiles zero OpenCombine sources and the example binary links only the native Combine framework (verified via otool -L).
The opencombine-latest job only ran swift build/test on macOS. After the platform-conditional dependency (#15) a host build links native Combine and compiles zero OpenCombine code, which would have made the canary vacuous: it could never again detect upstream OpenCombine breakage. Add the same version-matched wasm SDK install + wasm build steps the jskit-latest job already uses, so the canary actually compiles the library against the patched OpenCombine. Host steps are kept as a resolution smoke check. actionlint: the only findings are two pre-existing SC2010 warnings in the untouched Select Xcode steps, identical on main; this change adds none.
Consumers need to know what the conditional dependency changes and - just as important - what it does not: no public API is removed or deprecated, WASI/Linux behavior is identical, and OpenCombine (plus its transitive swift-syntax) is still fetched at resolution time on Apple platforms; only compilation and linkage drop. README and the DocC landing page state the per-platform linkage story; CHANGELOG opens the Unreleased (0.6.0) section with the declared packaging change; CONTRIBUTING's dependency policy now explains the platform-list invariant (keep it equal to the set of platforms where canImport(Combine) is false) so future edits do not silently unlink a platform.
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.
Motivation
Final roadmap ticket (#15, re-scoped to 0.6.0): OpenCombine has been dormant since 2023 and is this library's biggest supply-chain risk. Since #11, Apple builds use native Combine — but OpenCombine was still compiled and linked everywhere. This PR removes it from the Apple build graph entirely.
Changes
.when(platforms: [.wasi, .linux, .android, .windows, .openbsd])on all three consuming targets — every platform wherecanImport(Combine)is false. Dropping any of these (e.g..linux) would silently break those consumers, hence the exhaustive list (documented in the manifest;.freebsdis still_PackageDescription 999.0-gated at tools 6.3).OpenCombineJS.abi.json, andotool -Lon the example binary shows nativeCombine.frameworkonly..packagedeclaration is removed in a future major.opencombine-latestjob would have become vacuous (host builds now compile zero OpenCombine) — it now mirrors the jskit job's wasm-SDK build steps; host steps remain as a resolution smoke check. actionlint: zero new findings.Unreleased (0.6.0)) updated.Test plan
swift build+swift test— 35/6 green.wasm32-unknown-wasip1): build +js test— 81/22 green.swiftformat --lintclean.Closes #15