Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
3bde1ad
Move `wasmtime explore` behind a Cargo feature
alexcrichton Oct 17, 2023
655afe2
Move the `wast` subcommand behind a Cargo feature
alexcrichton Oct 17, 2023
29eb8b7
Move support for `wat` behind a CLI feature
alexcrichton Oct 17, 2023
3cbeaf8
Move CLI cache support behind a Cargo feature
alexcrichton Oct 17, 2023
7ea8ac1
Move `rayon` behind an optional feature
alexcrichton Oct 17, 2023
65a056a
Move `http-body-util` dependency behind `serve` feature
alexcrichton Oct 17, 2023
37c11b6
Add a Cargo feature for compiling out log statements
alexcrichton Oct 17, 2023
624b205
Move logging support behind a Cargo feature
alexcrichton Oct 17, 2023
a65fe0d
Move demangling support behind a Cargo feature
alexcrichton Oct 17, 2023
4e05d0b
Enable building the CLI without cranelift
alexcrichton Oct 17, 2023
814b5c4
Gate all profiling support behind one feature flag
alexcrichton Oct 17, 2023
1515f33
Move support for core dumps behind a feature flag
alexcrichton Oct 17, 2023
1b59c0e
Move addr2line behind a feature
alexcrichton Oct 17, 2023
c1bade8
Fix rebase
alexcrichton Oct 18, 2023
b5798f7
Document cargo features and a minimal build
alexcrichton Oct 18, 2023
62e84fc
Tidy up the source a bit
alexcrichton Oct 18, 2023
eef57dd
Rename compile-out-logging
alexcrichton Oct 18, 2023
f861f8a
Document disabling logging
alexcrichton Oct 18, 2023
a484f75
Note the host architecture as well
alexcrichton Oct 18, 2023
a018323
Fix tests
alexcrichton Oct 18, 2023
e2b4f78
Fix tests
alexcrichton Oct 18, 2023
bd9f37c
Mention debuginfo stripping
alexcrichton Oct 18, 2023
a5819f2
Fix CI configuration for checking features
alexcrichton Oct 18, 2023
cc051b0
Fix book tests
alexcrichton Oct 18, 2023
d440ff2
Update lock file after rebase
alexcrichton Oct 19, 2023
df41d1a
Enable coredump feature by default
alexcrichton Oct 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,7 @@ jobs:
# Check some feature combinations of the `wasmtime` crate
- run: cargo check -p wasmtime --no-default-features
- run: cargo check -p wasmtime --no-default-features --features wat
- run: cargo check -p wasmtime --no-default-features --features jitdump
- run: cargo check -p wasmtime --no-default-features --features vtune
- run: cargo check -p wasmtime --no-default-features --features profiling
- run: cargo check -p wasmtime --no-default-features --features cache
- run: cargo check -p wasmtime --no-default-features --features async
- run: cargo check -p wasmtime --no-default-features --features pooling-allocator
Expand All @@ -267,9 +266,14 @@ jobs:
- run: cargo check -p wasmtime --no-default-features --features cranelift,wat,async,cache
- run: cargo check -p wasmtime --no-default-features --features winch
- run: cargo check -p wasmtime --no-default-features --features wmemcheck
- run: cargo check -p wasmtime --no-default-features --features demangle
- run: cargo check -p wasmtime --no-default-features --features addr2line
- run: cargo check --features component-model
- run: cargo check -p wasmtime --features incremental-cache

# Feature combinations of the `wasmtime-cli`
- run: cargo check -p wasmtime-cli --no-default-features

# Check that benchmarks of the cranelift project build
- run: cargo check --benches -p cranelift-codegen

Expand Down
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

93 changes: 73 additions & 20 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ path = "src/bin/wasmtime.rs"
doc = false

[dependencies]
wasmtime = { workspace = true, features = ['cache', 'cranelift'] }
wasmtime-cache = { workspace = true }
wasmtime = { workspace = true }
wasmtime-cache = { workspace = true, optional = true }
wasmtime-cli-flags = { workspace = true }
wasmtime-cranelift = { workspace = true }
wasmtime-cranelift = { workspace = true, optional = true }
wasmtime-environ = { workspace = true }
wasmtime-explorer = { workspace = true }
wasmtime-wast = { workspace = true }
wasmtime-explorer = { workspace = true, optional = true }
wasmtime-wast = { workspace = true, optional = true }
wasmtime-wasi = { workspace = true, default-features = true, features = [
"exit",
] }
Expand All @@ -41,18 +41,18 @@ anyhow = { workspace = true }
target-lexicon = { workspace = true }
once_cell = { workspace = true }
listenfd = "1.0.0"
wat = { workspace = true }
wat = { workspace = true, optional = true }
serde = { workspace = true }
serde_derive = { workspace = true }
serde_json = { workspace = true }
wasmparser = { workspace = true }
wasm-encoder = { workspace = true }
tracing = { workspace = true }
log = { workspace = true }

async-trait = { workspace = true }
tokio = { workspace = true, optional = true, features = [ "signal", "macros" ] }
hyper = { workspace = true, optional = true }
http-body = { workspace = true }
http-body-util = { workspace = true }
http-body-util = { workspace = true, optional = true }

[target.'cfg(unix)'.dependencies]
rustix = { workspace = true, features = ["mm", "param"] }
Expand Down Expand Up @@ -266,34 +266,87 @@ test-log = { version = "0.2", default-features = false, features = ["trace"] }
tracing-subscriber = { version = "0.3.1", default-features = false, features = ['fmt', 'env-filter', 'ansi', 'tracing-log'] }
url = "2.3.1"

# =============================================================================
#
# Features for the Wasmtime CLI executable
#
#
# Note that many of these features are inherited from Wasmtime itself or
# otherwise configure the `wasmtime` crate's execution. Features are provided as
# compile-time switches to disable functionality primarily if one is interested
# in configuring binary size and or exploring the binary size implications of
# various features. Most features are enabled by default but most embeddings
# likely won't need all features.
[features]
default = [
"jitdump",
"wasmtime/wat",
"wasmtime/parallel-compilation",
"vtune",
# All subcommands are included by default.
"compile",
"explore",
"serve",
"wast",
"config",

# On-by-default WASI features
"wasi-nn",
"wasi-threads",
"wasi-http",

# Most features of Wasmtime are enabled by default.
"wat",
"parallel-compilation",
"pooling-allocator",
"cache",
"logging",
"demangle",
"cranelift",
"profiling",
"coredump",
"addr2line",
]
jitdump = ["wasmtime/jitdump"]
vtune = ["wasmtime/vtune"]

# ========================================
# Off-by-default features
#
# These features are off-by-default but may optionally be enabled.
all-arch = ["wasmtime/all-arch"]
winch = ["wasmtime/winch"]
wmemcheck = ["wasmtime/wmemcheck"]

# This feature, when enabled, will statically compile out all logging statements
# throughout Wasmtime and its dependencies.
disable-logging = ["log/max_level_off", "tracing/max_level_off"]

# ========================================
# On-by-default features
#
# These features are all included in the `default` set above and this is
# the internal mapping for what they enable in Wasmtime itself.
wasi-nn = ["dep:wasmtime-wasi-nn"]
wasi-threads = ["dep:wasmtime-wasi-threads"]
wasi-http = ["component-model", "dep:wasmtime-wasi-http", "dep:tokio", "dep:hyper", "wasmtime-wasi-http?/sync"]
pooling-allocator = ["wasmtime/pooling-allocator", "wasmtime-cli-flags/pooling-allocator"]
all-arch = ["wasmtime/all-arch"]
component-model = [
"wasmtime/component-model",
"wasmtime-wast/component-model",
"wasmtime-cli-flags/component-model"
]
winch = ["wasmtime/winch"]
wmemcheck = ["wasmtime/wmemcheck"]
wat = ["dep:wat"]
cache = ["dep:wasmtime-cache", "wasmtime-cli-flags/cache"]
parallel-compilation = ["wasmtime-cli-flags/parallel-compilation"]
logging = ["wasmtime-cli-flags/logging"]
demangle = ["wasmtime/demangle"]
cranelift = ["wasmtime-cli-flags/cranelift", "dep:wasmtime-cranelift"]
profiling = ["wasmtime/profiling"]
coredump = ["wasmtime-cli-flags/coredump"]
addr2line = ["wasmtime/addr2line"]

# Enable the `wasmtime serve` command
serve = ["wasi-http", "component-model"]
# CLI subcommands for the `wasmtime` executable. See `wasmtime $cmd --help`
# for more information on each subcommand.
serve = ["wasi-http", "component-model", "dep:http-body-util"]
explore = ["dep:wasmtime-explorer"]
wast = ["dep:wasmtime-wast"]
config = ["cache"]
compile = ["cranelift"]

[[test]]
name = "host_segfault"
Expand Down
4 changes: 2 additions & 2 deletions crates/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ wasi-common = { workspace = true, optional = true }
futures = { workspace = true, optional = true }

[features]
default = ['jitdump', 'wat', 'wasi', 'cache', 'parallel-compilation', 'async']
default = ['profiling', 'wat', 'wasi', 'cache', 'parallel-compilation', 'async']
async = ['wasmtime/async', 'futures']
jitdump = ["wasmtime/jitdump"]
profiling = ["wasmtime/profiling"]
cache = ["wasmtime/cache"]
parallel-compilation = ['wasmtime/parallel-compilation']
wasi = ['wasi-cap-std-sync', 'wasmtime-wasi', 'cap-std', 'wasi-common']
18 changes: 8 additions & 10 deletions crates/cli-flags/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,17 @@ edition.workspace = true
[dependencies]
anyhow = { workspace = true }
clap = { workspace = true }
file-per-thread-logger = { workspace = true }
tracing-subscriber = { workspace = true }
rayon = "1.5.0"
file-per-thread-logger = { workspace = true, optional = true }
tracing-subscriber = { workspace = true, optional = true }
rayon = { version = "1.5.0", optional = true }
wasmtime = { workspace = true }
humantime = "2.0.0"

[features]
default = [
"wasmtime/cache",
"wasmtime/cranelift",
"wasmtime/jitdump",
"wasmtime/vtune",
"wasmtime/parallel-compilation",
]
pooling-allocator = []
component-model = ["wasmtime/component-model"]
cache = ["wasmtime/cache"]
parallel-compilation = ["wasmtime/parallel-compilation", "dep:rayon"]
logging = ["dep:file-per-thread-logger", "dep:tracing-subscriber"]
cranelift = ["wasmtime/cranelift"]
coredump = ["wasmtime/coredump"]
Loading