feat: Add Swift WebAssembly compilation support to swift-distributed-tracing#174
Conversation
|
@FranzBusch @ktoso would either of you have a moment to review? |
|
@scottmarchant could you update PR description to refer to official swift.org Swift SDKs for Wasm instead of SwiftWasm? Thanks! |
@MaxDesiatov Done. I updated my other existing PR's as well. |
62ca5b1 to
bfdfbad
Compare
|
Note, latest push was just rebasing these changes onto the latest tip of |
| dependencies: [ | ||
| .product(name: "ServiceContextModule", package: "swift-service-context"), | ||
| .target(name: "Instrumentation"), | ||
| .target(name: "_CWASI", condition: .when(platforms: [.wasi])), |
There was a problem hiding this comment.
We seem to be getting an error on this line on 5.10
error: Target Tracing imports another target (_CWASI) in the package without declaring it a dependency.
Is this a bug in the package manager on 5.10? Can you take a look and if it is a bug we can just disable the strict dependency check on just 5.10
There was a problem hiding this comment.
@FranzBusch Indeed it does look like that is a bug. I tracked it down to FB14859516 metnioned in https://forums.swift.org/t/do-swiftpm-conditional-target-dependencies-work/74047.
I removed the dependency check for swift versions before Swift 6. See 386e324
|
@scottmarchant would you mind addressing formatting job failures per the build log? https://github.com/apple/swift-distributed-tracing/actions/runs/16578688393/job/46920017078?pr=174 |
…ns before Swift 6, due to associated false positive errors. See FB14859516.
Head branch was pushed to by a user without write access
Done. |
|
@ktoso would you have a moment to review and kick off CI? Thanks! |
|
Can you fix the YAML lint and update against the latest main branch. Thanks again for working on this! |
Head branch was pushed to by a user without write access
@FranzBusch Done. And thank you for the active reviews here! Hugely appreciated! |
|
This needs a merge with |
|
@FranzBusch I believe this branch has the latest main merged into it and is ready for merge now once the workflow runs. |
…uilds (#175) # Change summary Added swift wasm as a CI target, to help prevent future breakages to swift wasm builds in DataLoader # Details - Adds wasm build to `pull_request` and `main`, by adding references to new wasm build workflow from swiftlang. # Notes - This PR is [part of a larger effort](PassiveLogic/swift-web-examples#1) by PassiveLogic to add wasm support to many popular repositories. # PR Dependencies The following PR's must be merged before this PR can be merged: - #174 # Testing done Verified in separate fork that new workflow functions correctly: https://github.com/PassiveLogic/swift-distributed-tracing/actions/runs/18858201101/job/53810934909?pr=2
Summary
This PR adds support for compiling swift-distributed-tracing to wasm using the Swift SDK for WebAssembly.
This PR is part of a larger effort by a company called PassiveLogic to enable broad support for Swift WebAssembly compilation.
Details
There are three changes required to enable wasm compilation for swift-distributed-tracing.
import Dispatchimports. The Swift SDK for WebAssembly doesn't currently include GCD. Luckily, all usage of GCD was unused.Testing done
swift buildcompletes without errorsswift build --swift-sdk wasm32-unknown-wasicompletes without errorsswift build --swift-sdk wasm32-unknown-wasip1-threadscompletes without errorsswift package --swift-sdk wasm32-unknown-wasip1-threads js --use-cdnImpact Risk
Realistically, this change should not cause any impact or risk. Outside of wasm targets, the changes in this PR are additive.