Summary
Contribute can't be built for WebAssembly (wasm32-unknown-wasi) on the nightly Swift 6.4 WASM SDK because its transitive dependency Yams doesn't compile there. As a result the WASM CI leg is disabled for Contribute (the Build on WASM step is gated off via the ENABLE_WASM repo variable).
Root cause
Yams/Sources/Yams/Representer.swift uses the C <float.h> macro DBL_DECIMAL_DIG to serialize Doubles losslessly:
import var _float.DBL_DECIMAL_DIG // line 12
let string = String(format: "%.*g", DBL_DECIMAL_DIG, self) // line 342
On the WASM SDK:
wasm: the WASI libc headers don't expose DBL_DECIMAL_DIG through the _float clang module, so the import is "not in scope" and compilation fails. This is reportedly fixed on Yams main but unreleased in the 6.x line we resolve (from: "6.0.0").
wasm-embedded: additionally has no Foundation, which Yams requires (String(format:), Decoder/Constructor), so it can't build at all.
Options
- Wait for a Yams release containing the
main fix, then bump the dependency.
- Pin Yams to a
main commit that includes the fix.
- Vendor + patch Yams (as we did for SwiftSoup's Swift 6.4 issue).
Acceptance
swift build --swift-sdk <6.4 wasm> succeeds for Contribute, and
- the WASM CI leg is re-enabled (set the
ENABLE_WASM repo variable back to true / remove it).
Context: nightly Swift 6.4 multi-platform CI sweep across the BrightDigit vendored packages.
Summary
Contribute can't be built for WebAssembly (
wasm32-unknown-wasi) on the nightly Swift 6.4 WASM SDK because its transitive dependency Yams doesn't compile there. As a result the WASM CI leg is disabled for Contribute (theBuild on WASMstep is gated off via theENABLE_WASMrepo variable).Root cause
Yams/Sources/Yams/Representer.swiftuses the C<float.h>macroDBL_DECIMAL_DIGto serializeDoubles losslessly:On the WASM SDK:
wasm: the WASI libc headers don't exposeDBL_DECIMAL_DIGthrough the_floatclang module, so the import is "not in scope" and compilation fails. This is reportedly fixed on Yamsmainbut unreleased in the 6.x line we resolve (from: "6.0.0").wasm-embedded: additionally has no Foundation, which Yams requires (String(format:), Decoder/Constructor), so it can't build at all.Options
mainfix, then bump the dependency.maincommit that includes the fix.Acceptance
swift build --swift-sdk <6.4 wasm>succeeds for Contribute, andENABLE_WASMrepo variable back totrue/ remove it).Context: nightly Swift 6.4 multi-platform CI sweep across the BrightDigit vendored packages.