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 9386c8f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 31 deletions.
34 changes: 17 additions & 17 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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:
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 9386c8f

Please sign in to comment.