Skip to content

Fix ArgumentParser build failure for WASI (WebAssembly System Interface) #794

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

kkebo
Copy link
Contributor

@kkebo kkebo commented Jul 2, 2025

ArgumentParser is very useful for command-line tools that are built for wasm32-unknown-wasi and run on WebAssembly runtimes (e.g., wasmtime, wasmer, WasmKit). However, starting from version 1.6.0, the use of DispatchSemaphore has caused the build for wasm32-unknown-wasi to break.

This PR is intended to fix that issue.

Checks

Checklist

  • I've added at least one test that validates that my change is working, if appropriate
  • I've followed the code style of the rest of the project
  • I've read the Contribution Guidelines
  • I've updated the documentation if necessary

ArgumentParser is very useful for command-line tools that are built for wasm32-unknown-wasi and run on WebAssembly runtimes (e.g., wasmtime, wasmer, WasmKit). However, starting from version 1.6.0, the use of `DispatchSemaphore` has caused the build for wasm32-unknown-wasi to break. This change is intended to fix that issue.
@natecook1000
Copy link
Member

@kkebo, thanks for this fix! Would you be willing to update https://github.com/apple/swift-argument-parser/blob/main/.github/workflows/pull_request.yml to include those WASM build tests? They could be in a wasm-build job, just like cmake-build.

@kkebo
Copy link
Contributor Author

kkebo commented Jul 4, 2025

@natecook1000 That's great! I've added the wasm-build job to pull_request.yml.

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.

2 participants