wasm-bindgen/crates/cli/Cargo.toml
Alex Crichton 203d86f343
Add tests for the interface types output of wasm-bindgen (#1898)
* Add tests for the interface types output of wasm-bindgen

This commit expands the test suite with assertions about the output of
the interface types pass in wasm-bindgen. The goal here is to actually
assert that we produce the right output and have a suite of reference
files to show how the interface types output is changing over time.

The `reference` test suite added in the previous PR has been updated to
work for interface types as well, generating `*.wit` file assertions
which are printed via the `wit-printer` crate on crates.io.

Along the way a number of bugs were fixed with the interface types
output, such as:

* Non-determinism in output caused by iteration of a `HashMap`

* Avoiding JS generation entirely in interface types mode, ensuring that
  we don't export extraneous intrinsics that aren't otherwise needed.

* Fixing location of the stack pointer for modules where it's GC'd out.
  It's now rooted in the aux section of wasm-bindgen so it's available
  to later passes, like the multi-value pass.

* Interface types emission now works in debug mode, meaning the
  `--release` flag is no longer required. This previously did not work
  because the `__wbindgen_throw` intrinsic was required in debug mode.
  This comes about because of the `malloc_failure` and `internal_error`
  functions in the anyref pass. The purpose of these functions is to
  signal fatal runtime errors, if any, in a way that's usable to the
  user. For wasm interface types though we can replace calls to these
  functions with `unreachable` to avoid needing to import the
  intrinsic. This has the accidental side effect of making
  `wasm_bindgen::throw_str` "just work" with wasm interface types by
  aborting the program, but that's not actually entirely intended. It's
  hoped that a split of a `wasm-bindgen-core` crate would solve this
  issue for the future.

* Run the wasm interface types validator in tests

* Add more gc roots for adapter gc

* Improve stack pointer detection

The stack pointer is never initialized to zero, but some other mutable
globals are (TLS, thread ID, etc), so let's filter those out.
2019-12-04 15:19:48 -06:00

48 lines
1.3 KiB
TOML

[package]
name = "wasm-bindgen-cli"
version = "0.2.55"
authors = ["The wasm-bindgen Developers"]
license = "MIT/Apache-2.0"
repository = "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli"
homepage = "https://rustwasm.github.io/wasm-bindgen/"
documentation = "https://rustwasm.github.io/wasm-bindgen/"
categories = ["wasm"]
description = """
Command line interface of the `#[wasm_bindgen]` attribute and project. For more
information see https://github.com/rustwasm/wasm-bindgen.
"""
edition = '2018'
[dependencies]
curl = "0.4.13"
docopt = "1.0"
env_logger = "0.7"
anyhow = "1.0"
log = "0.4"
openssl = { version = '0.10.11', optional = true }
rouille = { version = "3.0.0", default-features = false }
serde = { version = "1.0", features = ['derive'] }
serde_derive = "1.0"
serde_json = "1.0"
walrus = { version = "0.14.0", features = ['parallel'] }
wasm-bindgen-cli-support = { path = "../cli-support", version = "=0.2.55" }
wasm-bindgen-shared = { path = "../shared", version = "=0.2.55" }
[dev-dependencies]
assert_cmd = "0.11"
diff = "0.1"
predicates = "1.0.0"
rayon = "1.0"
tempfile = "3.0"
walrus = "0.14"
wit-printer = "0.1"
wit-validator = "0.1"
wit-walrus = "0.1"
[[test]]
name = "reference"
harness = false
[features]
vendored-openssl = ['openssl/vendored']