Skip to content

Commit

Permalink
Remove the lightbeam backend (#3390)
Browse files Browse the repository at this point in the history
This commit removes the Lightbeam backend from Wasmtime as per [RFC 14].
This backend hasn't received maintenance in quite some time, and as [RFC
14] indicates this doesn't meet the threshold for keeping the code
in-tree, so this commit removes it.

A fast "baseline" compiler may still be added in the future. The
addition of such a backend should be in line with [RFC 14], though, with
the principles we now have for stable releases of Wasmtime. I'll close
out Lightbeam-related issues once this is merged.

[RFC 14]: bytecodealliance/rfcs#14
  • Loading branch information
alexcrichton authored Sep 27, 2021
1 parent 98831fe commit 1ee2af0
Show file tree
Hide file tree
Showing 39 changed files with 20 additions and 12,372 deletions.
13 changes: 1 addition & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ jobs:
# Check some feature combinations of the `wasmtime` crate
- run: cargo check -p wasmtime --no-default-features
- run: cargo check -p wasmtime --no-default-features --features wat
- run: cargo check -p wasmtime --no-default-features --features lightbeam
- run: cargo check -p wasmtime --no-default-features --features jitdump
- run: cargo check -p wasmtime --no-default-features --features vtune
- run: cargo check -p wasmtime --no-default-features --features cache
Expand Down Expand Up @@ -307,7 +306,7 @@ jobs:
RUST_BACKTRACE: 1
if: matrix.target == ''

# Build and test all features except for lightbeam
# Build and test all features
- run: ./ci/run-tests.sh --locked
env:
RUST_BACKTRACE: 1
Expand All @@ -329,16 +328,6 @@ jobs:
env:
RUST_BACKTRACE: 1
# Build and test lightbeam. Note that
# Lightbeam tests fail right now, but we don't want to block on that.
- run: cargo build --package lightbeam
if: matrix.target != 'aarch64-unknown-linux-gnu' && matrix.target != 's390x-unknown-linux-gnu'
- run: cargo test --package lightbeam
if: matrix.target != 'aarch64-unknown-linux-gnu' && matrix.target != 's390x-unknown-linux-gnu'
continue-on-error: true
env:
RUST_BACKTRACE: 1

# Perform all tests (debug mode) for `wasmtime` with the old x86 backend.
test_x86:
name: Test old x86 backend
Expand Down
145 changes: 0 additions & 145 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 1 addition & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,21 +75,19 @@ members = [
"cranelift",
"crates/bench-api",
"crates/c-api",
"crates/lightbeam/wasmtime",
"crates/misc/run-examples",
"examples/fib-debug/wasm",
"examples/wasi/wasm",
"examples/tokio/wasm",
"fuzz",
]
exclude = [
'crates/wasi-common/WASI/tools/witx-cli',
'crates/wasi-common/WASI/tools/witx-cli',
'docs/rust_wasi_markdown_parser'
]

[features]
default = ["jitdump", "wasmtime/wat", "wasmtime/parallel-compilation", "wasi-nn"]
lightbeam = ["wasmtime/lightbeam"]
jitdump = ["wasmtime/jitdump"]
vtune = ["wasmtime/vtune"]
wasi-crypto = ["wasmtime-wasi-crypto"]
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ Hello, world!
quickly generate high-quality machine code at runtime.

* **Configurable**. Whether you need to precompile your wasm ahead of time,
generate code blazingly fast with Lightbeam, or interpret it at runtime,
Wasmtime has you covered for all your wasm-executing needs.
or interpret it at runtime, Wasmtime has you covered for all your
wasm-executing needs.

* **WASI**. Wasmtime supports a rich set of APIs for interacting with the host
environment through the [WASI standard](https://wasi.dev).
Expand Down
14 changes: 1 addition & 13 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,7 @@ fn main() -> anyhow::Result<()> {
);
let mut out = String::new();

for strategy in &[
"Cranelift",
#[cfg(feature = "lightbeam")]
"Lightbeam",
] {
for strategy in &["Cranelift"] {
writeln!(out, "#[cfg(test)]")?;
writeln!(out, "#[allow(non_snake_case)]")?;
writeln!(out, "mod {} {{", strategy)?;
Expand Down Expand Up @@ -185,14 +181,6 @@ fn write_testsuite_tests(
/// Ignore tests that aren't supported yet.
fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
match strategy {
#[cfg(feature = "lightbeam")]
"Lightbeam" => match (testsuite, testname) {
("simd", _) => return true,
("multi_value", _) => return true,
("reference_types", _) => return true,
("bulk_memory_operations", _) => return true,
_ => (),
},
"Cranelift" => match (testsuite, testname) {
// Skip all reference types tests on the old backend. The modern
// implementation of reference types uses atomic instructions
Expand Down
1 change: 0 additions & 1 deletion ci/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
cargo test \
--features "test-programs/test_programs" \
--workspace \
--exclude '*lightbeam*' \
--exclude 'wasmtime-wasi-*' \
--exclude 'peepmatic*' \
--exclude wasi-crypto \
Expand Down
4 changes: 2 additions & 2 deletions cranelift/codegen/src/isa/x64/inst/emit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
//!
//! cd to the top of your wasmtime tree, then:
//! RUST_BACKTRACE=1 cargo test --features test-programs/test_programs \
//! --features experimental_x64 --all --exclude peepmatic --exclude lightbeam \
//! --exclude wasmtime-lightbeam --exclude peepmatic-automata --exclude peepmatic-fuzzing \
//! --features experimental_x64 --all --exclude peepmatic \
//! --exclude peepmatic-automata --exclude peepmatic-fuzzing \
//! --exclude peepmatic-macro --exclude wasmtime-wasi-nn -- isa::x64::inst::emit_tests::test_x64_emit
use super::*;
Expand Down
1 change: 0 additions & 1 deletion crates/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ cap-std = { version = "0.19.1", optional = true }

[features]
default = ['jitdump', 'wat', 'wasi', 'cache']
lightbeam = ["wasmtime/lightbeam"]
jitdump = ["wasmtime/jitdump"]
cache = ["wasmtime/cache"]
wasi = ['wasi-common', 'wasi-cap-std-sync', 'wasmtime-wasi', 'cap-std']
12 changes: 3 additions & 9 deletions crates/c-api/include/wasmtime/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,13 @@ typedef uint8_t wasmtime_strategy_t;
* The default value is #WASMTIME_STRATEGY_AUTO.
*/
enum wasmtime_strategy_enum { // Strategy
/// Wasmtime will automatically determine whether to use Cranelift or
/// Lightbeam, and currently it will always pick Cranelift. This default may
/// change over time though.
/// Automatically picks the compilation backend, currently always defaulting
/// to Cranelift.
WASMTIME_STRATEGY_AUTO,

/// Indicates that Cranelift will unconditionally use Cranelift to compile
/// Indicates that Wasmtime will unconditionally use Cranelift to compile
/// WebAssembly code.
WASMTIME_STRATEGY_CRANELIFT,

/// Indicates that Cranelift will unconditionally use Lightbeam to compile
/// WebAssembly code. Note that Lightbeam isn't always enabled at compile
/// time, and if that's the case an error will be returned.
WASMTIME_STRATEGY_LIGHTBEAM,
};

/**
Expand Down
2 changes: 0 additions & 2 deletions crates/c-api/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ wasmtime_c_api_macros::declare_own!(wasm_config_t);
pub enum wasmtime_strategy_t {
WASMTIME_STRATEGY_AUTO,
WASMTIME_STRATEGY_CRANELIFT,
WASMTIME_STRATEGY_LIGHTBEAM,
}

#[repr(u8)]
Expand Down Expand Up @@ -114,7 +113,6 @@ pub extern "C" fn wasmtime_config_strategy_set(
let result = c.config.strategy(match strategy {
WASMTIME_STRATEGY_AUTO => Strategy::Auto,
WASMTIME_STRATEGY_CRANELIFT => Strategy::Cranelift,
WASMTIME_STRATEGY_LIGHTBEAM => Strategy::Lightbeam,
});
handle_result(result, |_cfg| {})
}
Expand Down
Loading

0 comments on commit 1ee2af0

Please sign in to comment.