Skip to content

Commit

Permalink
Gate some clap features behind the default feature (#7317)
Browse files Browse the repository at this point in the history
While not a large amount of binary size if the purpose of the
`--no-default-features` build is to showcase "minimal Wasmtime" then may
as well try to make `clap` as small as possible.
  • Loading branch information
alexcrichton authored Oct 23, 2023
1 parent a80da75 commit 962318e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ wasmtime-wasi-nn = { workspace = true, optional = true }
wasmtime-wasi-threads = { workspace = true, optional = true }
wasmtime-wasi-http = { workspace = true, optional = true }
wasmtime-runtime = { workspace = true }
clap = { workspace = true, features = ["color", "suggestions", "derive"] }
clap = { workspace = true }
anyhow = { workspace = true }
target-lexicon = { workspace = true }
once_cell = { workspace = true }
Expand Down Expand Up @@ -228,7 +228,7 @@ anyhow = "1.0.22"
windows-sys = "0.48.0"
env_logger = "0.10"
log = { version = "0.4.8", default-features = false }
clap = { version = "4.3.12", features = ["color", "suggestions", "derive"] }
clap = { version = "4.3.12", default-features = false, features = ["std", "derive"] }
hashbrown = { version = "0.14", default-features = false }
capstone = "0.9.0"
once_cell = "1.12.0"
Expand Down Expand Up @@ -303,6 +303,11 @@ default = [
"coredump",
"addr2line",
"debug-builtins",

# Enable some nice features of clap by default, but they come at a binary size
# cost, so allow disabling this through disabling of our own `default`
# feature.
"clap/default",
]

# ========================================
Expand Down
2 changes: 1 addition & 1 deletion cranelift/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ indicatif = "0.13.0"
thiserror = { workspace = true }
walkdir = { workspace = true }
anyhow = { workspace = true }
clap = { workspace = true }
clap = { workspace = true, features = ['default'] }
similar = { workspace = true }
toml = { workspace = true }
serde = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion cranelift/isle/islec/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ publish = false
[dependencies]
cranelift-isle = { version = "*", path = "../isle/", features = ["fancy-errors", "logging"] }
env_logger = { workspace = true }
clap = { workspace = true }
clap = { workspace = true, features = ['default'] }
2 changes: 1 addition & 1 deletion crates/environ/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ wasmprinter = { workspace = true, optional = true }
wasmtime-component-util = { workspace = true, optional = true }

[dev-dependencies]
clap = { workspace = true }
clap = { workspace = true, features = ['default'] }
env_logger = { workspace = true }
wat = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion winch/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ wasmtime-environ = { workspace = true }
target-lexicon = { workspace = true }
anyhow = { workspace = true }
wasmparser = { workspace = true }
clap = { workspace = true }
clap = { workspace = true, features = ['default'] }
wat = { workspace = true }
cranelift-codegen = { workspace = true }
capstone = { workspace = true }
Expand Down

0 comments on commit 962318e

Please sign in to comment.