Skip to content

fix WASI & Android build, add to CI and add Combine package trait#406

Open
diederich wants to merge 10 commits intopointfreeco:mainfrom
untitled-in-brackets:bugfix/wasm-build
Open

fix WASI & Android build, add to CI and add Combine package trait#406
diederich wants to merge 10 commits intopointfreeco:mainfrom
untitled-in-brackets:bugfix/wasm-build

Conversation

@diederich
Copy link
Copy Markdown

@diederich diederich commented Nov 27, 2025

trying to build swift-dependencies against the WASM SDK failed because of:

  • missing NotificationCenter type

Excluding the NotificationCenter dependency on WASI fixes it.

This now also borrows swift-nio's WASM build (saw that recently in swift-distributed-tracing), but given building w/o arguments tries to build libIssueReporting.wasm as a dynamic library (how is that the default target 😅 ) and complains, we're passing --target Dependencies and --target DependenciesMacros along.

@stephencelis
Copy link
Copy Markdown
Member

@diederich Thanks for taking the time to PR! And sorry for the delay, holiday travel and all 😄

Just a few things:

  • CombineSchedulers recently got OpenCombine support via a trait. It looks like OpenCombine supports WASI, so I think it should hopefully be easy to support here, and would mean less Package file churn.
  • Relatedly, we are interested in moving Combine support into a trait of its own (enabled by default for now, but disabled by default in the next major version), so maybe this work would help here, too. This definitely could be done later, though.
  • We think getting CI on this would be a good idea if possible before merging, since otherwise things are just a ticking time bomb to not building again. You might be able to get a simple workflow going based off some more official SwiftWasm projects?

@diederich
Copy link
Copy Markdown
Author

@diederich Thanks for taking the time to PR! And sorry for the delay, holiday travel and all 😄

No worries at all. I can relate! :-)

Just a few things:

  • CombineSchedulers recently got OpenCombine support via a trait. It looks like OpenCombine supports WASI, so I think it should hopefully be easy to support here, and would mean less Package file churn.

Love it. Will take a look! 🙏

  • Relatedly, we are interested in moving Combine support into a trait of its own (enabled by default for now, but disabled by default in the next major version), so maybe this work would help here, too. This definitely could be done later, though.

Gotcha, makes sense.

  • We think getting CI on this would be a good idea if possible before merging, since otherwise things are just a ticking time bomb to not building again. You might be able to get a simple workflow going based off some more official SwiftWasm projects?

Yeah, agreed. Will take a look and keep us posted.

@victorpimentel
Copy link
Copy Markdown

Hi! Any updates on this? We may be able to help if you can give us directions (like fixing the CI support) :)

```
error: dynamic libraries are unsupported for target 'wasm32-unknown-wasip1'
[3/15] Linking libIssueReportingTestSupport.wasm
```
@diederich
Copy link
Copy Markdown
Author

@diederich
Copy link
Copy Markdown
Author

diederich commented Mar 11, 2026

@stephencelis NotificationCenter was the only required fix now. OpenCombine did the trick.

As mentioned in the PR description, I picked the swift-nio workflow. While that builds against main (and haven't seen a flag to change), it should be relatively maintenance free. Let me know it that's OK or if you want something more custom/configurable.

(Oh, and sorry this took so long. Was in a bit of a frenzy putting all the things together 😅 )

@diederich
Copy link
Copy Markdown
Author

OK - more incoming 😅

  • Android didn't build, so did go for the Combine package trait, added Android CI (via skiptools workflow)
  • bumped Ubuntu CI to Swift 6.2 (was 6.0)
  • fixed warning on DependenciesMacros.xctestplan

@diederich diederich changed the title fix WASI build fix WASI & Android build, add to CI and add Combine package trait Mar 11, 2026
we're importing the Shim now, which should be available in case
`#if Combine` resolved to true.
It's kind of sad we're leaking
…lerPlugin` not being picked up

I'm not clear why we were seeing:
```/__w/swift-dependencies/swift-dependencies/Tests/DependenciesMacrosPluginTests/DependencyClientMacroTests.swift:1:8: error: missing required module 'SwiftCompilerPlugin'
   1 | import DependenciesMacrosPlugin
     |        `- error: missing required module 'SwiftCompilerPlugin'
   2 | import MacroTesting
   3 | import XCTest
[942/955] Compiling DependenciesMacrosPluginTests BaseTestCase.swift
/__w/swift-dependencies/swift-dependencies/Tests/DependenciesMacrosPluginTests/DependencyClientMacroTests.swift:1:8: error: missing required module 'SwiftCompilerPlugin'
   1 | import DependenciesMacrosPlugin
     |        `- error: missing required module 'SwiftCompilerPlugin'
   2 | import MacroTesting
   3 | import XCTest
[943/955] Compiling DependenciesMacrosPluginTests DependencyEndpointMacroTests.swift
/__w/swift-dependencies/swift-dependencies/Tests/DependenciesMacrosPluginTests/DependencyClientMacroTests.swift:1:8: error: missing required module 'SwiftCompilerPlugin'
   1 | import DependenciesMacrosPlugin
     |        `- error: missing required module 'SwiftCompilerPlugin'
   2 | import MacroTesting
   3 | import XCTest

```

on https://github.com/untitled-in-brackets/swift-dependencies/actions/runs/22952803121/job/66621506036

but hoping being explicit fixes it (and we import, so should be fine?)
@diederich
Copy link
Copy Markdown
Author

Looks like we're green with Android, WASI & the Combine trait:
Screenshot 2026-03-11 at 14 02 55

via https://github.com/untitled-in-brackets/swift-dependencies/actions/runs/22953163892/job/66622793357

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.

3 participants