Skip to content

Commit fd068d9

Browse files
committed
Simplify clippy Wasmtime feature selection
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent ff3c9d0 commit fd068d9

3 files changed

Lines changed: 3 additions & 19 deletions

File tree

Justfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ latest-release:= if os() == "windows" {"$(git tag -l --sort=v:refname | select -
66
wit-world := if os() == "windows" { "$env:WIT_WORLD=\"" + justfile_directory() + "\\src\\tests\\rust_guests\\component_sample\\wit\\component-world.wasm" + "\";" } else { "WIT_WORLD=" + justfile_directory() + "/src/tests/rust_guests/component_sample/wit/component-world.wasm" }
77
wit-world-c := if os() == "windows" { "$env:WIT_WORLD=\"" + justfile_directory() + "\\src\\tests\\c_guests\\wasmsamples\\components\\runcomponent-world.wasm" + "\";" } else { "WIT_WORLD=" + justfile_directory() + "/src/tests/c_guests/wasmsamples/components/runcomponent-world.wasm" }
88
wit-world-name-greeter := if os() == "windows" { "$env:WIT_WORLD_NAME=\"greeter-world\";" } else { "WIT_WORLD_NAME=greeter-world" }
9-
workspace-features-latest := "hyperlight-wasm/function_call_metrics,hyperlight-wasm/print_debug,hyperlight-wasm/crashdump,hyperlight-wasm/gdb,hyperlight-wasm/kvm,hyperlight-wasm/mshv3,hyperlight-wasm/pulley,hyperlight-wasm/trace_guest,hyperlight-wasm/wasmtime_latest,hyperlight-wasm-aot/gdb"
10-
workspace-features-lts := "hyperlight-wasm/function_call_metrics,hyperlight-wasm/print_debug,hyperlight-wasm/crashdump,hyperlight-wasm/gdb,hyperlight-wasm/kvm,hyperlight-wasm/mshv3,hyperlight-wasm/trace_guest,hyperlight-wasm/wasmtime_lts,hyperlight-wasm-aot/gdb"
119

1210
set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"]
1311

@@ -93,8 +91,7 @@ fmt:
9391
cd src/hyperlight_wasm_macro && cargo +nightly fmt -v --all
9492

9593
clippy target=default-target: (check target)
96-
cargo clippy --workspace --exclude hyperlight-wasm-runtime --exclude hyperlight-wasm-macro --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --no-default-features --features {{ workspace-features-latest }} -- -D warnings
97-
cargo clippy --workspace --exclude hyperlight-wasm-runtime --exclude hyperlight-wasm-macro --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --no-default-features --features {{ workspace-features-lts }} -- -D warnings
94+
cargo clippy --workspace --exclude hyperlight-wasm-runtime --exclude hyperlight-wasm-macro --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings
9895
cd src/tests/rust_guests/rust_wasm_samples && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings
9996
cd src/tests/rust_guests/component_sample && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings
10097
cd src/tests/rust_guests/greeter_sample && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings

src/hyperlight_wasm/Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ pulley = []
121121
trace_guest = ["hyperlight-host/trace_guest"]
122122
# Use latest wasmtime instead of the default LTS version in wasm_runtime
123123
wasmtime_latest = []
124-
# Explicitly use the default LTS wasmtime version in wasm_runtime
125-
wasmtime_lts = []
126124

127125
[[bench]]
128126
name = "benchmarks"

src/hyperlight_wasm/build.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,23 +143,12 @@ fn build_wasm_runtime() -> PathBuf {
143143
.arg("--locked")
144144
.env_clear_cargo();
145145

146-
let wasmtime_latest = std::env::var("CARGO_FEATURE_WASMTIME_LATEST").is_ok();
147-
let wasmtime_lts = std::env::var("CARGO_FEATURE_WASMTIME_LTS").is_ok();
148-
assert!(
149-
!(wasmtime_latest && wasmtime_lts),
150-
"features 'wasmtime_latest' and 'wasmtime_lts' are mutually exclusive"
151-
);
152-
153-
if wasmtime_latest {
146+
// LTS is the runtime default; wasmtime_latest opts into the latest version.
147+
if std::env::var("CARGO_FEATURE_WASMTIME_LATEST").is_ok() {
154148
cmd = cmd
155149
.arg("--no-default-features")
156150
.arg("--features")
157151
.arg("wasmtime_latest");
158-
} else if wasmtime_lts {
159-
cmd = cmd
160-
.arg("--no-default-features")
161-
.arg("--features")
162-
.arg("wasmtime_lts");
163152
}
164153

165154
// Add --features gdb if the gdb feature is enabled for this build script

0 commit comments

Comments
 (0)