Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove cranelift from sys-default feature #3004

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Looking for changes that affect our C API? See the [C API Changelog](lib/c-api/C

### Changed
- [#3003](https://github.com/wasmerio/wasmer/pull/3003) Remove RuntimeError::raise from public API
- [#3004](https://github.com/wasmerio/wasmer/pull/3004) Remove cranelift from wasi/sys-default feature, making it possible to select the compiler backend when depending on wasmer-wasi
fschutt marked this conversation as resolved.
Show resolved Hide resolved
- [#2946](https://github.com/wasmerio/wasmer/pull/2946) Remove dylib,staticlib engines in favor of a single Universal engine
- [#2949](https://github.com/wasmerio/wasmer/pull/2949) Switch back to using custom LLVM builds on CI

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ test-capi-integration-%:
cd lib/c-api/examples; WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-integration-//) WASMER_DIR=`pwd`/../../../package make run

test-wasi-unit:
$(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/wasi/Cargo.toml --release
$(CARGO_BINARY) test $(CARGO_TARGET) --manifest-path lib/wasi/Cargo.toml --release --features compiler-cranelift

test-wasi:
$(CARGO_BINARY) test $(CARGO_TARGET) --release --tests $(compiler_features) -- wasi::wasitests
Expand Down
7 changes: 5 additions & 2 deletions lib/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ compiler = [
"compiler",
"wasmer-compiler-llvm",
]
default-compiler = []
default-compiler = [
"wasmer-compiler/translator"
]
default-singlepass = [
"default-compiler",
"singlepass",
Expand All @@ -118,8 +120,9 @@ default-compiler = []
engine = ["sys"]
universal = [
"engine",
"wasmer-compiler/universal_engine"
]
default-engine = []
default-engine = ["default-universal"]
default-universal = [
"default-engine",
"universal",
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ pub use wasmer_compiler_cranelift::{Cranelift, CraneliftOptLevel};
#[cfg(feature = "llvm")]
pub use wasmer_compiler_llvm::{LLVMOptLevel, LLVM};

#[cfg(feature = "universal")]
#[cfg(feature = "compiler")]
pub use wasmer_compiler::{Universal, UniversalArtifact, UniversalEngine};

/// Version number of this crate.
Expand Down
6 changes: 5 additions & 1 deletion lib/api/src/sys/store.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
use crate::sys::tunables::BaseTunables;
use std::fmt;
use std::sync::{Arc, RwLock};
#[cfg(any(feature = "compiler", feature = "default-compiler"))]
use wasmer_compiler::CompilerConfig;
use wasmer_compiler::{Engine, Tunables, Universal};
#[cfg(any(feature = "compiler", feature = "default-compiler"))]
use wasmer_compiler::Universal;
use wasmer_compiler::{Engine, Tunables};
use wasmer_vm::{init_traps, TrapHandler, TrapHandlerFn};

/// The store represents all global state that can be manipulated by
Expand All @@ -23,6 +26,7 @@ pub struct Store {
}

impl Store {
#[cfg(any(feature = "compiler", feature = "default-compiler"))]
/// Creates a new `Store` with a specific [`CompilerConfig`].
pub fn new(compiler_config: Box<dyn CompilerConfig>) -> Self {
let engine = Universal::new(compiler_config).engine();
Expand Down
2 changes: 1 addition & 1 deletion lib/wasi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ tracing-wasm = "0.2"
default = ["sys-default"]

sys = ["wasmer/sys"]
sys-default = ["wasmer/sys-default", "sys", "logging", "host-fs", "sys-poll", "host-vnet" ]
sys-default = ["wasmer/sys", "wasmer/wat", "wasmer/default-engine", "sys", "logging", "host-fs", "sys-poll", "host-vnet"]
sys-poll = []

js = ["wasmer/js", "mem-fs", "wasmer-vfs/no-time", "getrandom/js", "chrono"]
Expand Down
3 changes: 3 additions & 0 deletions lib/wasi/tests/envvar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

use std::env;

#[cfg(not(feature = "compiler-cranelift"))]
compile_error! {"These tests run only with the feature \"compiler-cranelift\" enabled. Use \"--features compiler-cranelift\" to enable it."}

fn get_env_var(var_name: &str) -> Result<String, env::VarError> {
env::var(var_name)
}
Expand Down
3 changes: 3 additions & 0 deletions lib/wasi/tests/stdio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ use std::io::{Read, Write};
use wasmer::{Instance, Module, Store};
use wasmer_wasi::{Pipe, WasiState};

#[cfg(not(feature = "compiler-cranelift"))]
compile_error! {"These tests run only with the feature \"compiler-cranelift\" enabled. Use \"--features compiler-cranelift\" to enable it."}

mod sys {
#[test]
fn test_stdout() {
Expand Down
2 changes: 1 addition & 1 deletion tests/lib/wast/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ edition = "2018"

[dependencies]
anyhow = "1.0"
wasmer = { path = "../../../lib/api", version = "=2.3.0", default-features = false, features = ["experimental-reference-types-extern-ref"] }
wasmer = { path = "../../../lib/api", version = "=2.3.0", default-features = false, features = ["experimental-reference-types-extern-ref", "cranelift"] }
wasmer-wasi = { path = "../../../lib/wasi", version = "=2.3.0" }
wasmer-vfs = { path = "../../../lib/vfs", version = "=2.3.0" }
wast = "38.0"
Expand Down