Use Cargo's "namespace features" feature (#4293)

Cargo recently added the ability to have an optional dependency without
implicitly introducing a new named feature on a crate. This is triggered
with some new directives in the `[features]` section, specifically:

* The `dep:foo` syntax means that `foo` is activated but no implicit
  feature should be added named `foo`.

* Additionally `foo?/bar` means that the `bar` feature of `foo` is only
  activated if `foo` is otherwise activated elsewhere, for example a
  conditional activation.

These two features can help avoid extra feature names showing up that we
don't want (e.g. currently the `wasmtime` crate has a `rayon` feature)
and additionally can help avoid runtime dependencies in niche cases for
us (e.g. activating `all-arch` but disabling `cranelift` would
previously pull-in cranelift but no longer will).
This commit is contained in:
Alex Crichton
2022-06-21 15:05:14 -05:00
committed by GitHub
parent b2e03ae873
commit 2f9d96cd00
2 changed files with 7 additions and 7 deletions

View File

@@ -101,8 +101,8 @@ default = [
]
jitdump = ["wasmtime/jitdump"]
vtune = ["wasmtime/vtune"]
wasi-crypto = ["wasmtime-wasi-crypto"]
wasi-nn = ["wasmtime-wasi-nn"]
wasi-crypto = ["dep:wasmtime-wasi-crypto"]
wasi-nn = ["dep:wasmtime-wasi-nn"]
memory-init-cow = ["wasmtime/memory-init-cow", "wasmtime-cli-flags/memory-init-cow"]
pooling-allocator = ["wasmtime/pooling-allocator", "wasmtime-cli-flags/pooling-allocator"]
all-arch = ["wasmtime/all-arch"]