[package] name = "wasm-tools" version = "1.239.0" authors = ["The Wasmtime Project Developers"] edition.workspace = true description = "CLI tools for interoperating with WebAssembly files" license.workspace = true documentation = "https://github.com/bytecodealliance/wasm-tools" categories = ["wasm"] keywords = ["webassembly", "wasm"] repository = "https://github.com/bytecodealliance/wasm-tools" readme = "README.md" exclude = ['tests/wabt', 'tests/testsuite', 'tests/snapshots', 'ci'] rust-version.workspace = true [package.metadata.binstall] pkg-url = "{repo}/releases/download/v{version}/{name}-{version}-{target-arch}-{target-family}{archive-suffix}" bin-dir = "{name}-{version}-{target-arch}-{target-family}/{bin}{binary-ext}" pkg-fmt = "tgz" [package.metadata.binstall.overrides.x86_64-apple-darwin] pkg-url = "{repo}/releases/download/v{version}/{name}-{version}-{target-arch}-macos{archive-suffix}" bin-dir = "{name}-{version}-{target-arch}-macos/{bin}{binary-ext}" [package.metadata.binstall.overrides.aarch64-apple-darwin] pkg-url = "{repo}/releases/download/v{version}/{name}-{version}-{target-arch}-macos{archive-suffix}" bin-dir = "{name}-{version}-{target-arch}-macos/{bin}{binary-ext}" [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] pkg-fmt = "zip" [package.metadata.binstall.overrides.x86_64-pc-windows-gnu] pkg-fmt = "zip" [lints] workspace = true [workspace] members = [ 'crates/c-api', 'crates/wasm-wave', 'crates/wit-encoder', 'crates/wit-component/dl', ] [workspace.lints.rust] unsafe_code = "deny" # Turn on some lints which are otherwise allow-by-default in rustc. unused_extern_crates = 'warn' unstable_features = 'warn' unused_import_braces = 'warn' unused-lifetimes = 'warn' unused-macro-rules = 'warn' # Lints that are part of the `rust-2024-compatibility` group. This group is a # bit too noisy to enable wholesale but some selective items are ones we want to # opt-in to. keyword_idents_2024 = 'warn' unsafe-attr-outside-unsafe = 'warn' deprecated-safe-2024 = 'warn' rust-2024-guarded-string-incompatible-syntax = 'warn' rust-2024-prelude-collisions = 'warn' rust-2024-incompatible-pat = 'warn' missing-unsafe-on-extern = 'warn' unsafe-op-in-unsafe-fn = 'warn' unexpected_cfgs = { level = 'warn', check-cfg = ['cfg(fuzzing)'] } [workspace.lints.clippy] # The default set of lints in Clippy is viewed as "too noisy" right now so # they're all turned off by default. Selective lints are then enabled below as # necessary. all = { level = 'allow', priority = -1 } clone_on_copy = 'warn' map_clone = 'warn' unnecessary_to_owned = 'warn' manual_strip = 'warn' uninlined_format_args = 'warn' unnecessary_mut_passed = 'warn' unnecessary_fallible_conversions = 'warn' unnecessary_cast = 'warn' allow_attributes_without_reason = 'warn' [workspace.package] edition = '2021' license = "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" version = "0.239.0" # Current thinking for wasm-tools is that the minimum supported Rust version # (MSRV), or this number here, is no larger than the current stable release of # Rust minus 10. This is more conservative than Wasmtime's policy which is # stable minus two and is due to the nature of this repository and how the # crates are expected to be used in more situations and places than Wasmtime. # # Note that this number is not proactively updated whenever a new release of # Rust comes out. Instead if you run into this, for example a PR on CI is # failing due to needing a newer feature of Rust, you're welcome to update this # at any time so longer that it's no greater than the current release of Rust # minus 10. # # If this window is too restrictive please leave a comment on your PR or send a # message to wasm-tools maintainers to discuss. In some cases it's possible to # add version detection to build scripts but in other cases this may not be # reasonable to expect. # # NB: if this number increases to 1.81-or-later delete # `crates/wasmparser/build.rs` and `crates/wasm-encoder/build.rs` scripts # as they are no longer necessary. rust-version = "1.76.0" [workspace.dependencies] ahash = { version = "0.8.11", default-features = false } anyhow = "1.0.58" arbitrary = "1.1.0" bitflags = "2.5.0" bytesize = "2.0.0" clap = { version = "4.0.0", features = ["derive"] } clap_complete = "4.4.7" comfy-table = { version = "7.1.3", default-features = false } env_logger = "0.11" gimli = "0.32.3" hashbrown = { version = ">= 0.15.2, <= 0.16", default-features = false, features = ['default-hasher'] } id-arena = "2" indexmap = { version = "2.7.0", default-features = false } indoc = "2.0.5" leb128fmt = { version = "0.1.0", default-features = false } libtest-mimic = ">= 0.7.3, <= 0.8.1" log = "0.4.17" num_cpus = "1.13" pretty_assertions = "1.3.0" rand = "0.10" rayon = "1.3" semver = { version = "1.0.0", default-features = false } serde = { version = "1.0.166", default-features = false, features = ['alloc'] } serde_derive = "1.0.166" serde_json = { version = "1" } smallvec = "1.11.1" spdx = ">= 0.10.1, <= 0.13" termcolor = "1.2.0" url = "2.0.0" thiserror = "2.0.12" wasm-compose = { version = "0.239.0", path = "crates/wasm-compose" } wasm-encoder = { version = "0.239.0", path = "crates/wasm-encoder", default-features = false } wasm-metadata = { version = "0.239.0", path = "crates/wasm-metadata", default-features = false } wasm-mutate = { version = "0.239.0", path = "crates/wasm-mutate" } wasm-shrink = { version = "0.239.0", path = "crates/wasm-shrink" } wasm-smith = { version = "0.239.0", path = "crates/wasm-smith" } wasmparser = { version = "0.239.0", path = "crates/wasmparser", default-features = false, features = ['simd'] } wasmprinter = { version = "0.239.0", path = "crates/wasmprinter", default-features = false } wast = { version = "239.0.0", path = "crates/wast", default-features = false } wat = { version = "1.239.0", path = "crates/wat", default-features = false } wit-component = { version = "0.239.0", path = "crates/wit-component" } wit-encoder = { version = "0.239.0", path = "crates/wit-encoder" } wit-parser = { version = "0.239.0", path = "crates/wit-parser" } wit-smith = { version = "0.239.0", path = "crates/wit-smith" } json-from-wast = { version = "0.239.0", path = "crates/json-from-wast" } [dependencies] anyhow = { workspace = true } clap = { workspace = true, features = ['wrap_help'] } clap_complete = { workspace = true, optional = true } comfy-table = { workspace = true } env_logger = { workspace = true } log = { workspace = true } tempfile = "3.2.0" termcolor = { workspace = true } wasmparser = { workspace = true, features = ['std', 'component-model', 'simd'] } wat = { workspace = true, features = ['dwarf', 'component-model'] } # Dependencies of `validate` bitflags = { workspace = true, optional = true } rayon = { workspace = true, optional = true } # Dependencies of `print` wasmprinter = { workspace = true, features = ['component-model', 'validate'] } # Dependencies of `smith` arbitrary = { workspace = true, optional = true } serde = { workspace = true, optional = true } serde_derive = { workspace = true, optional = true } serde_json = { workspace = true, optional = true } wasm-smith = { workspace = true, features = ["_internal_cli", "wasmparser"], optional = true } # Dependencies of `shrink` wasm-shrink = { workspace = true, features = ["clap"], optional = true } # Dependencies of `mutate` wasm-mutate = { workspace = true, features = ["clap"], optional = true } # Dependencies of `strip` regex = { version = "1.6.0", optional = true } wasm-encoder = { workspace = true, features = ["std"], optional = true } # Dependencies of `compose` wasm-compose = { workspace = true, optional = true } # Dependencies of `demangle` cpp_demangle = { version = "0.5.1", optional = true } rustc-demangle = { version = "0.1.21", optional = true } # Dependencies of `component` wast = { workspace = true, optional = true, features = ['wasm-module', 'component-model'] } wit-component = { workspace = true, optional = true, features = ['dummy-module', 'wat', 'semver-check'] } wit-encoder = { workspace = true, optional = true } wit-parser = { workspace = true, optional = true, features = ['decoding', 'wat', 'serde'] } # Dependencies of `metadata` wasm-metadata = { workspace = true, features = ["clap", "default"], optional = true } bytesize = { workspace = true } # Dependencies of `wit-smith` wit-smith = { workspace = true, features = ["clap"], optional = true } # Dependencies of `addr2line` addr2line = { version = ">= 0.24.0, <= 0.25", optional = true } gimli = { workspace = true, optional = true } # Dependencies of `wast` pretty_assertions = { workspace = true, optional = true } # Dependencies of `json-from-wast` json-from-wast = { workspace = true, optional = true } [target.'cfg(not(target_family = "wasm"))'.dependencies] is_executable = { version = "1.0.1", optional = true } [dev-dependencies] indexmap = { workspace = true } libtest-mimic = { workspace = true } pretty_assertions = { workspace = true } serde_json = "1.0" tempfile = "3.1" wast = { workspace = true } arbitrary = { workspace = true } wasm-smith = { workspace = true } [[test]] name = "cli" harness = false required-features = ["broken"] [features] # By default, all subcommands are built default = [ 'shrink', 'smith', 'mutate', 'validate', 'print', 'parse', 'dump', 'objdump', 'strip', 'compose', 'demangle', 'component', 'metadata', 'wit-smith', 'addr2line', 'completion', 'json-from-wast', 'wast', ] # Each subcommand is gated behind a feature and lists the dependencies it needs validate = [ 'rayon', 'dep:addr2line', 'dep:gimli', 'dep:bitflags', 'wasmparser/validate', 'wasmparser/features', ] print = [] parse = [] smith = ['wasm-smith', 'arbitrary', 'dep:serde', 'dep:serde_derive', 'dep:serde_json'] shrink = ['wasm-shrink', 'is_executable'] mutate = ['wasm-mutate'] dump = [] objdump = [] strip = ['wasm-encoder', 'regex'] compose = ['wasm-compose'] demangle = ['rustc-demangle', 'cpp_demangle', 'wasm-encoder'] component = [ 'wit-component', 'wit-encoder', 'wit-parser', 'dep:wast', 'wasm-encoder', 'dep:serde_json', ] metadata = ['wasm-metadata', 'dep:serde_json'] wit-smith = ['dep:wit-smith', 'arbitrary'] addr2line = ['dep:addr2line', 'dep:gimli'] completion = ['dep:clap_complete'] json-from-wast = ['dep:json-from-wast', 'dep:wast', 'dep:serde_json'] wast = [ 'dep:wast', 'wast/component-model', 'wasm-encoder/wasmparser', 'dep:pretty_assertions', 'validate', # These subcommands are executed from `wasm-tools wast` so make sure they're # built-in if this is enabled. 'dump', 'json-from-wast', ]