From 9386c8f4b501fd1cbc634e176a53f5c0c26a6602 Mon Sep 17 00:00:00 2001 From: Christoph Herzog Date: Mon, 5 Jun 2023 18:21:00 +0200 Subject: [PATCH] chore(cli): Remove redundant CLI feature flags The CLI previously had a bunch of feature flags, which were only left in for legacy support, but which do not change behaviour anymore. This commit removes the feature flags in question. (flags: webc_runner, cache, wasi, debug, emscripten, cache-blake3-pure ) Closes #3954 --- Makefile | 34 +++++++++++++++++----------------- lib/cli/Cargo.toml | 15 +-------------- 2 files changed, 18 insertions(+), 31 deletions(-) diff --git a/Makefile b/Makefile index f45af8d39a9..fd400d32118 100644 --- a/Makefile +++ b/Makefile @@ -392,7 +392,7 @@ check-wasmer-wasm: check-capi: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) check $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml \ - --no-default-features --features wat,compiler,wasi,middlewares $(capi_compiler_features) + --no-default-features --features wat,compiler,middlewares $(capi_compiler_features) build-wasmer: @@ -468,55 +468,55 @@ build-docs-capi: # when generating the documentation, we rename it to its # crate's name. Then we restore the lib's name. sed "$(SEDI)" -e 's/name = "wasmer" # ##lib.name##/name = "wasmer_c_api" # ##lib.name##/' lib/c-api/Cargo.toml - RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,compiler,cranelift,wasi + RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) doc $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,compiler,cranelift sed "$(SEDI)" -e 's/name = "wasmer_c_api" # ##lib.name##/name = "wasmer" # ##lib.name##/' lib/c-api/Cargo.toml build-capi: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) + --no-default-features --features wat,compiler,middlewares $(capi_compiler_features) build-capi-singlepass: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,singlepass,wasi,middlewares,webc_runner + --no-default-features --features wat,compiler,singlepass,middlewares build-capi-singlepass-universal: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,singlepass,wasi,middlewares,webc_runner + --no-default-features --features wat,compiler,singlepass,middlewares build-capi-cranelift: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,cranelift,wasi,middlewares,webc_runner + --no-default-features --features wat,compiler,cranelift,middlewares build-capi-cranelift-universal: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,cranelift,wasi,middlewares,webc_runner + --no-default-features --features wat,compiler,cranelift,middlewares build-capi-llvm: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,llvm,wasi,middlewares,webc_runner + --no-default-features --features wat,compiler,llvm,middlewares build-capi-llvm-universal: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,llvm,wasi,middlewares,webc_runner + --no-default-features --features wat,compiler,llvm,middlewares build-capi-jsc: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,jsc,wasi + --no-default-features --features wat,jsc # Headless (we include the minimal to be able to run) build-capi-headless: ifeq ($(CARGO_TARGET_FLAG),) RUSTFLAGS="${RUSTFLAGS} -C panic=abort -C link-dead-code -C lto -O -C embed-bitcode=yes" $(CARGO_BINARY) build --target $(HOST_TARGET) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features compiler-headless,wasi,webc_runner --target-dir target/headless + --no-default-features --features compiler-headless --target-dir target/headless else RUSTFLAGS="${RUSTFLAGS} -C panic=abort -C link-dead-code -C lto -O -C embed-bitcode=yes" $(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features compiler-headless,wasi,webc_runner --target-dir target/headless + --no-default-features --features compiler-headless --target-dir target/headless endif build-capi-headless-ios: RUSTFLAGS="${RUSTFLAGS} -C panic=abort" cargo lipo --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features compiler-headless,wasi,webc_runner --target-dir target/$(CARGO_TARGET)/headless + --no-default-features --features compiler-headless --target-dir target/$(CARGO_TARGET)/headless ##### # @@ -604,7 +604,7 @@ test-capi-jsc: build-capi-jsc package-capi test-capi-integration-jsc test-capi-crate-%: WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml --release \ - --no-default-features --features wat,compiler,wasi,middlewares,webc_runner $(capi_compiler_features) -- --nocapture + --no-default-features --features wat,compiler,middlewares $(capi_compiler_features) -- --nocapture test-capi-integration-%: # note: you need to do make build-capi and make package-capi first! @@ -622,15 +622,15 @@ test-wasi: test-integration-cli: build-wasmer build-capi package-capi-headless package distribution cp ./dist/wasmer.tar.gz ./link.tar.gz rustup target add wasm32-wasi - WASMER_DIR=`pwd`/package $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 + WASMER_DIR=`pwd`/package $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --no-fail-fast -p wasmer-integration-tests-cli -- --nocapture --test-threads=1 # Before running this in the CI, we need to set up link.tar.gz and /cache/wasmer-[target].tar.gz test-integration-cli-ci: rustup target add wasm32-wasi - $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner -p wasmer-integration-tests-cli -- --test-threads=1 + $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) -p wasmer-integration-tests-cli -- --test-threads=1 test-integration-ios: - $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner -p wasmer-integration-tests-ios + $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) -p wasmer-integration-tests-ios generate-wasi-tests: # Uncomment the following for installing the toolchain diff --git a/lib/cli/Cargo.toml b/lib/cli/Cargo.toml index a5c9e76b6df..9563c7d31e3 100644 --- a/lib/cli/Cargo.toml +++ b/lib/cli/Cargo.toml @@ -130,13 +130,9 @@ default = [ "sys", "wat", "wast", - "cache", - "wasi", - "emscripten", "compiler", "wasmer-artifact-create", "static-artifact-create", - "webc_runner", ] backend = [] coredump = [ @@ -184,7 +180,6 @@ static-artifact-load = ["compiler", ] experimental-io-devices = [ "wasmer-wasix-experimental-io-devices", - "wasi" ] singlepass = [ "wasmer-compiler-singlepass", @@ -200,7 +195,7 @@ llvm = [ ] disable-all-logging = ["wasmer-wasix/disable-all-logging", "log/release_max_level_off"] headless = [] -headless-minimal = ["headless", "disable-all-logging", "wasi"] +headless-minimal = ["headless", "disable-all-logging"] # Optional enable-serde = [ @@ -210,14 +205,6 @@ enable-serde = [ "wasmer-wasix/enable-serde", ] -# Deprecated. These feature flags no longer protect anything. -cache = [] -cache-blake3-pure = [] -debug = [] -wasi = [] -emscripten = [] -webc_runner = [] - [target.'cfg(target_os = "windows")'.dependencies] colored = "2.0.0"