Skip to content

Commit

Permalink
chore(cli): Remove redundant CLI feature flags
Browse files Browse the repository at this point in the history
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
  • Loading branch information
theduke committed Jun 5, 2023
1 parent f0eda9b commit 3044e23
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 34 deletions.
40 changes: 20 additions & 20 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,14 @@ 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:
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --features="webc_runner" --bin wasmer
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml $(compiler_features) --bin wasmer

build-wasmer-jsc:
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml --no-default-features --features="jsc,wat,wasi,webc_runner" --bin wasmer
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --release --manifest-path lib/cli/Cargo.toml --no-default-features --features="jsc,wat" --bin wasmer

install-wasi-web:
cd lib/wasi-web && npm install || true
Expand All @@ -409,7 +409,7 @@ build-wasi-web:
cd lib/wasi-web && npm run build

build-wasmer-debug:
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/cli/Cargo.toml $(compiler_features) --features "webc_runner,debug" --bin wasmer
$(CARGO_BINARY) build $(CARGO_TARGET_FLAG) --manifest-path lib/cli/Cargo.toml $(compiler_features) --bin wasmer

bench:
$(CARGO_BINARY) bench $(CARGO_TARGET_FLAG) $(compiler_features)
Expand Down Expand Up @@ -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

#####
#
Expand Down Expand Up @@ -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!
Expand All @@ -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
Expand Down
15 changes: 1 addition & 14 deletions lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,9 @@ default = [
"sys",
"wat",
"wast",
"cache",
"wasi",
"emscripten",
"compiler",
"wasmer-artifact-create",
"static-artifact-create",
"webc_runner",
]
backend = []
coredump = [
Expand Down Expand Up @@ -184,7 +180,6 @@ static-artifact-load = ["compiler",
]
experimental-io-devices = [
"wasmer-wasix-experimental-io-devices",
"wasi"
]
singlepass = [
"wasmer-compiler-singlepass",
Expand All @@ -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 = [
Expand All @@ -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"

Expand Down

0 comments on commit 3044e23

Please sign in to comment.