Skip to content
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

Add partial WASI/Wasm support. #301

Merged
merged 3 commits into from Mar 19, 2024
Merged

Add partial WASI/Wasm support. #301

merged 3 commits into from Mar 19, 2024

Commits on Mar 18, 2024

  1. Add partial WASI/WASM support.

    This PR allows building using the SwiftWasm toolchain from https://swiftwasm.org.
    As of right now, macro plugins do not build correctly for WASM, so swift-testing
    is not usable, but it is buildable!
    
     ## Testing
    
    A workaround is provided on the [jgrynspan/wasi-workaround](https://github.com/apple/swift-testing/tree/jgrynspan/wasi-workaround)
    branch in order to facilitate testing. Check out that branch, then set the
    environment variable `SWT_COMPILER_PLUGIN_ENABLED` to `0` when building:
    
    ```sh
    SWT_COMPILER_PLUGIN_ENABLED=0 swift build --triple wasm32-unknown-wasi
    ```
    
    The macros target should build except for its main function (which will emit a
    warning about being unsupported) as should the primary library target. It is not
    possible to build the testing library's tests yet.
    grynspan committed Mar 18, 2024
    Copy the full SHA
    1b2e236 View commit details
    Browse the repository at this point in the history
  2. Disable file I/O API on WASI

    grynspan committed Mar 18, 2024
    Copy the full SHA
    7da13cd View commit details
    Browse the repository at this point in the history

Commits on Mar 19, 2024

  1. Copy the full SHA
    68f33ab View commit details
    Browse the repository at this point in the history