Skip to content

Commit 6d59c9b

Browse files
authored
Merge branch 'master' into feat-remove-deprecated
2 parents 51d7236 + 7d09f94 commit 6d59c9b

28 files changed

+217
-210
lines changed

Cargo.lock

+4-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+6-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ wasmer-emscripten = { version = "1.0.2", path = "lib/emscripten", optional = tru
1919
wasmer-engine = { version = "1.0.2", path = "lib/engine" }
2020
wasmer-engine-universal = { version = "1.0.2", path = "lib/engine-universal", optional = true }
2121
wasmer-engine-dylib = { version = "1.0.2", path = "lib/engine-dylib", optional = true }
22-
wasmer-engine-object-file = { version = "1.0.2", path = "lib/engine-object-file", optional = true }
22+
wasmer-engine-staticlib = { version = "1.0.2", path = "lib/engine-staticlib", optional = true }
2323
wasmer-wasi = { version = "1.0.2", path = "lib/wasi", optional = true }
2424
wasmer-wast = { version = "1.0.2", path = "tests/lib/wast", optional = true }
2525
wasmer-cache = { version = "1.0.2", path = "lib/cache", optional = true }
@@ -42,7 +42,7 @@ members = [
4242
"lib/engine",
4343
"lib/engine-universal",
4444
"lib/engine-dylib",
45-
"lib/engine-object-file",
45+
"lib/engine-staticlib",
4646
"lib/object",
4747
"lib/vm",
4848
"lib/wasi",
@@ -80,7 +80,7 @@ default = [
8080
"wast",
8181
"universal",
8282
"dylib",
83-
"object-file",
83+
"staticlib",
8484
"cache",
8585
"wasi",
8686
"emscripten",
@@ -95,8 +95,8 @@ dylib = [
9595
"wasmer-engine-dylib",
9696
"engine",
9797
]
98-
object-file = [
99-
"wasmer-engine-object-file",
98+
staticlib = [
99+
"wasmer-engine-staticlib",
100100
"engine",
101101
]
102102
cache = ["wasmer-cache"]
@@ -109,7 +109,7 @@ compiler = [
109109
"wasmer-compiler/translator",
110110
"wasmer-engine-universal/compiler",
111111
"wasmer-engine-dylib/compiler",
112-
"wasmer-engine-object-file/compiler",
112+
"wasmer-engine-staticlib/compiler",
113113
]
114114
singlepass = [
115115
"wasmer-compiler-singlepass",

Makefile

+17-17
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ SHELL=/bin/bash
1414
# |------------|-----------|----------|--------------|-------|
1515
# | Cranelift | Universal | Linux | amd64 | glibc |
1616
# | LLVM | Dylib | Darwin | aarch64 | musl |
17-
# | Singlepass | | Windows | | |
17+
# | Singlepass | Staticlib | Windows | | |
1818
# |------------|-----------|----------|--------------|-------|
1919
#
2020
# Here is what works and what doesn't:
@@ -423,15 +423,15 @@ endif
423423

424424
build-docs-capi: capi-setup
425425
cd lib/c-api/doc/deprecated/ && doxygen doxyfile
426-
RUSTFLAGS="${RUSTFLAGS}" cargo doc --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,universal,object-file,dylib,cranelift,wasi $(capi_default_features)
426+
RUSTFLAGS="${RUSTFLAGS}" cargo doc --manifest-path lib/c-api/Cargo.toml --no-deps --features wat,universal,staticlib,dylib,cranelift,wasi $(capi_default_features)
427427

428428
build-capi: capi-setup
429429
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
430-
--no-default-features --features deprecated,wat,universal,dylib,object-file,wasi,middlewares $(capi_default_features) $(capi_compiler_features)
430+
--no-default-features --features deprecated,wat,universal,dylib,staticlib,wasi,middlewares $(capi_default_features) $(capi_compiler_features)
431431

432432
build-capi-singlepass: capi-setup
433433
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
434-
--no-default-features --features deprecated,wat,universal,dylib,object-file,singlepass,wasi,middlewares $(capi_default_features)
434+
--no-default-features --features deprecated,wat,universal,dylib,staticlib,singlepass,wasi,middlewares $(capi_default_features)
435435

436436
build-capi-singlepass-universal: capi-setup
437437
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
@@ -441,17 +441,17 @@ build-capi-singlepass-dylib: capi-setup
441441
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
442442
--no-default-features --features deprecated,wat,dylib,singlepass,wasi,middlewares $(capi_default_features)
443443

444-
build-capi-singlepass-object-file: capi-setup
444+
build-capi-singlepass-staticlib: capi-setup
445445
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
446-
--no-default-features --features deprecated,wat,object-file,singlepass,wasi,middlewares $(capi_default_features)
446+
--no-default-features --features deprecated,wat,staticlib,singlepass,wasi,middlewares $(capi_default_features)
447447

448448
build-capi-cranelift: capi-setup
449449
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
450-
--no-default-features --features deprecated,wat,universal,dylib,object-file,cranelift,wasi,middlewares $(capi_default_features)
450+
--no-default-features --features deprecated,wat,universal,dylib,staticlib,cranelift,wasi,middlewares $(capi_default_features)
451451

452452
build-capi-cranelift-system-libffi: capi-setup
453453
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
454-
--no-default-features --features deprecated,wat,universal,dylib,object-file,cranelift,wasi,middlewares,system-libffi $(capi_default_features)
454+
--no-default-features --features deprecated,wat,universal,dylib,staticlib,cranelift,wasi,middlewares,system-libffi $(capi_default_features)
455455

456456
build-capi-cranelift-universal: capi-setup
457457
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
@@ -461,13 +461,13 @@ build-capi-cranelift-dylib: capi-setup
461461
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
462462
--no-default-features --features deprecated,wat,dylib,cranelift,wasi,middlewares $(capi_default_features)
463463

464-
build-capi-cranelift-object-file: capi-setup
464+
build-capi-cranelift-staticlib: capi-setup
465465
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
466-
--no-default-features --features deprecated,wat,dylib,object-file,cranelift,wasi,middlewares $(capi_default_features)
466+
--no-default-features --features deprecated,wat,dylib,staticlib,cranelift,wasi,middlewares $(capi_default_features)
467467

468468
build-capi-llvm: capi-setup
469469
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
470-
--no-default-features --features deprecated,wat,universal,dylib,object-file,llvm,wasi,middlewares $(capi_default_features)
470+
--no-default-features --features deprecated,wat,universal,dylib,staticlib,llvm,wasi,middlewares $(capi_default_features)
471471

472472
build-capi-llvm-universal: capi-setup
473473
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
@@ -477,9 +477,9 @@ build-capi-llvm-dylib: capi-setup
477477
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
478478
--no-default-features --features deprecated,wat,dylib,llvm,wasi,middlewares $(capi_default_features)
479479

480-
build-capi-llvm-object-file: capi-setup
480+
build-capi-llvm-staticlib: capi-setup
481481
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
482-
--no-default-features --features deprecated,wat,object-file,llvm,wasi,middlewares $(capi_default_features)
482+
--no-default-features --features deprecated,wat,staticlib,llvm,wasi,middlewares $(capi_default_features)
483483

484484
# Headless (we include the minimal to be able to run)
485485

@@ -491,13 +491,13 @@ build-capi-headless-dylib: capi-setup
491491
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
492492
--no-default-features --features dylib,wasi
493493

494-
build-capi-headless-object-file: capi-setup
494+
build-capi-headless-staticlib: capi-setup
495495
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
496-
--no-default-features --features object-file,wasi
496+
--no-default-features --features staticlib,wasi
497497

498498
build-capi-headless-all: capi-setup
499499
RUSTFLAGS="${RUSTFLAGS}" cargo build --manifest-path lib/c-api/Cargo.toml --release \
500-
--no-default-features --features universal,dylib,object-file,wasi
500+
--no-default-features --features universal,dylib,staticlib,wasi
501501

502502
###########
503503
# Testing #
@@ -550,7 +550,7 @@ test-capi: build-capi package-capi $(foreach compiler_engine,$(capi_compilers_en
550550

551551
test-capi-crate-%:
552552
WASMER_CAPI_CONFIG=$(shell echo $@ | sed -e s/test-capi-crate-//) cargo test --manifest-path lib/c-api/Cargo.toml --release \
553-
--no-default-features --features deprecated,wat,universal,dylib,object-file,wasi,middlewares $(capi_default_features) $(capi_compiler_features) -- --nocapture
553+
--no-default-features --features deprecated,wat,universal,dylib,staticlib,wasi,middlewares $(capi_default_features) $(capi_compiler_features) -- --nocapture
554554

555555
test-capi-integration-%:
556556
# Test the Wasmer C API tests for C

lib/c-api/Cargo.toml

+4-4
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ wasmer-emscripten = { version = "1.0.2", path = "../emscripten", optional = true
2323
wasmer-engine = { version = "1.0.2", path = "../engine" }
2424
wasmer-engine-universal = { version = "1.0.2", path = "../engine-universal", optional = true }
2525
wasmer-engine-dylib = { version = "1.0.2", path = "../engine-dylib", optional = true }
26-
wasmer-engine-object-file = { version = "1.0.2", path = "../engine-object-file", optional = true }
26+
wasmer-engine-staticlib = { version = "1.0.2", path = "../engine-staticlib", optional = true }
2727
wasmer-middlewares = { version = "1.0.2", path = "../middlewares", optional = true }
2828
wasmer-wasi = { version = "1.0.2", path = "../wasi", optional = true }
2929
wasmer-types = { version = "1.0.2", path = "../types" }
@@ -63,15 +63,15 @@ dylib = [
6363
"wasmer-engine-dylib",
6464
"engine",
6565
]
66-
object-file = [
67-
"wasmer-engine-object-file",
66+
staticlib = [
67+
"wasmer-engine-staticlib",
6868
"engine",
6969
]
7070
compiler = [
7171
"wasmer/compiler",
7272
"wasmer-engine-universal/compiler",
7373
"wasmer-engine-dylib/compiler",
74-
"wasmer-engine-object-file/compiler"
74+
"wasmer-engine-staticlib/compiler"
7575
]
7676
singlepass = [
7777
"wasmer-compiler-singlepass",

lib/c-api/src/wasm_c_api/engine.rs

+20-20
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ use std::sync::Arc;
1414
use wasmer::Engine;
1515
#[cfg(feature = "dylib")]
1616
use wasmer_engine_dylib::Dylib;
17-
#[cfg(feature = "object-file")]
18-
use wasmer_engine_object_file::ObjectFile;
17+
#[cfg(feature = "staticlib")]
18+
use wasmer_engine_staticlib::Staticlib;
1919
#[cfg(feature = "universal")]
2020
use wasmer_engine_universal::Universal;
2121

@@ -73,9 +73,9 @@ pub enum wasmer_engine_t {
7373
/// [`wasmer_engine_dylib`] Rust crate.
7474
DYLIB = 1,
7575

76-
/// Variant to represent the Object File engine. See the
77-
/// [`wasmer_engine_object_file`] Rust crate.
78-
OBJECT_FILE = 2,
76+
/// Variant to represent the Staticlib engine. See the
77+
/// [`wasmer_engine_staticlib`] Rust crate.
78+
STATICLIB = 2,
7979
}
8080

8181
impl Default for wasmer_engine_t {
@@ -85,8 +85,8 @@ impl Default for wasmer_engine_t {
8585
Self::UNIVERSAL
8686
} else if #[cfg(feature = "dylib")] {
8787
Self::DYLIB
88-
} else if #[cfg(feature = "object-file")] {
89-
Self::OBJECT_FILE
88+
} else if #[cfg(feature = "staticlib")] {
89+
Self::STATICLIB
9090
} else {
9191
compile_error!("Please enable one of the engines")
9292
}
@@ -359,10 +359,10 @@ cfg_if! {
359359
Box::new(wasm_engine_t { inner: engine })
360360
}
361361
}
362-
// There are currently no uses of the object-file engine + compiler from the C API.
362+
// There are currently no uses of the Staticlib engine + compiler from the C API.
363363
// So if we get here, we default to headless mode regardless of if `compiler` is enabled.
364-
else if #[cfg(feature = "object-file")] {
365-
/// Creates a new headless object-file engine.
364+
else if #[cfg(feature = "staticlib")] {
365+
/// Creates a new headless Staticlib engine.
366366
///
367367
/// # Example
368368
///
@@ -371,7 +371,7 @@ cfg_if! {
371371
/// cbindgen:ignore
372372
#[no_mangle]
373373
pub extern "C" fn wasm_engine_new() -> Box<wasm_engine_t> {
374-
let engine: Arc<dyn Engine + Send + Sync> = Arc::new(ObjectFile::headless().engine());
374+
let engine: Arc<dyn Engine + Send + Sync> = Arc::new(Staticlib::headless().engine());
375375
Box::new(wasm_engine_t { inner: engine })
376376
}
377377
} else {
@@ -526,12 +526,12 @@ pub extern "C" fn wasm_engine_new_with_config(
526526
}
527527
}
528528
},
529-
wasmer_engine_t::OBJECT_FILE => {
529+
wasmer_engine_t::STATICLIB => {
530530
cfg_if! {
531-
// There are currently no uses of the object-file engine + compiler from the C API.
531+
// There are currently no uses of the Staticlib engine + compiler from the C API.
532532
// So we run in headless mode.
533-
if #[cfg(feature = "object-file")] {
534-
let mut builder = ObjectFile::headless();
533+
if #[cfg(feature = "staticlib")] {
534+
let mut builder = Staticlib::headless();
535535

536536
if let Some(target) = config.target {
537537
builder = builder.target(target.inner);
@@ -543,7 +543,7 @@ pub extern "C" fn wasm_engine_new_with_config(
543543

544544
Arc::new(builder.engine())
545545
} else {
546-
return return_with_error("Wasmer has not been compiled with the `object-file` feature.");
546+
return return_with_error("Wasmer has not been compiled with the `staticlib` feature.");
547547
}
548548
}
549549
},
@@ -589,10 +589,10 @@ pub extern "C" fn wasm_engine_new_with_config(
589589
}
590590
}
591591
},
592-
wasmer_engine_t::OBJECT_FILE => {
592+
wasmer_engine_t::STATICLIB => {
593593
cfg_if! {
594-
if #[cfg(feature = "object-file")] {
595-
let mut builder = ObjectFile::headless();
594+
if #[cfg(feature = "staticlib")] {
595+
let mut builder = Staticlib::headless();
596596

597597
if let Some(target) = config.target {
598598
builder = builder.target(target.inner);
@@ -604,7 +604,7 @@ pub extern "C" fn wasm_engine_new_with_config(
604604

605605
Arc::new(builder.engine())
606606
} else {
607-
return return_with_error("Wasmer has not been compiled with the `object-file` feature.");
607+
return return_with_error("Wasmer has not been compiled with the `staticlib` feature.");
608608
}
609609
}
610610
},

lib/c-api/src/wasm_c_api/unstable/engine.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ pub extern "C" fn wasmer_is_engine_available(engine: wasmer_engine_t) -> bool {
160160
match engine {
161161
wasmer_engine_t::UNIVERSAL if cfg!(feature = "universal") => true,
162162
wasmer_engine_t::DYLIB if cfg!(feature = "dylib") => true,
163-
wasmer_engine_t::OBJECT_FILE if cfg!(feature = "object-file") => true,
163+
wasmer_engine_t::STATICLIB if cfg!(feature = "staticlib") => true,
164164
_ => false,
165165
}
166166
}
@@ -243,8 +243,8 @@ mod tests {
243243
);
244244
set_var("DYLIB", if cfg!(feature = "dylib") { "1" } else { "0" });
245245
set_var(
246-
"OBJECT_FILE",
247-
if cfg!(feature = "object-file") {
246+
"STATICLIB",
247+
if cfg!(feature = "staticlib") {
248248
"1"
249249
} else {
250250
"0"
@@ -258,7 +258,7 @@ mod tests {
258258
int main() {
259259
assert(wasmer_is_engine_available(UNIVERSAL) == (getenv("UNIVERSAL")[0] == '1'));
260260
assert(wasmer_is_engine_available(DYLIB) == (getenv("DYLIB")[0] == '1'));
261-
assert(wasmer_is_engine_available(OBJECT_FILE) == (getenv("OBJECT_FILE")[0] == '1'));
261+
assert(wasmer_is_engine_available(STATICLIB) == (getenv("STATICLIB")[0] == '1'));
262262

263263
return 0;
264264
}
@@ -267,6 +267,6 @@ mod tests {
267267

268268
remove_var("UNIVERSAL");
269269
remove_var("DYLIB");
270-
remove_var("OBJECT_FILE");
270+
remove_var("STATICLIB");
271271
}
272272
}

lib/c-api/wasmer_wasm.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ typedef enum wasmer_compiler_t {
126126
typedef enum wasmer_engine_t {
127127
UNIVERSAL = 0,
128128
DYLIB = 1,
129-
OBJECT_FILE = 2,
129+
STATICLIB = 2,
130130
} wasmer_engine_t;
131131

132132
typedef enum wasmer_parser_operator_t {

0 commit comments

Comments
 (0)