Skip to content

Commit

Permalink
remove support for emscripten (#5186)
Browse files Browse the repository at this point in the history
  • Loading branch information
maminrayej authored Oct 29, 2024
2 parents 33a6908 + 9a9b390 commit 7a75251
Show file tree
Hide file tree
Showing 65 changed files with 17 additions and 8,797 deletions.
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ lib/compiler-cranelift @syrusakbary
lib/compiler-llvm
lib/compiler-singlepass @syrusakbary
lib/deprecated
lib/emscripten
lib/engine @syrusakbary
lib/engine-jit @syrusakbary
lib/engine-native @syrusakbary
Expand Down
18 changes: 0 additions & 18 deletions Cargo.lock

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

4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ wasmer-compiler = { version = "=5.0.0-rc.1", path = "lib/compiler", features = [
wasmer-compiler-cranelift = { version = "=5.0.0-rc.1", path = "lib/compiler-cranelift", optional = true }
wasmer-compiler-singlepass = { version = "=5.0.0-rc.1", path = "lib/compiler-singlepass", optional = true }
wasmer-compiler-llvm = { version = "=5.0.0-rc.1", path = "lib/compiler-llvm", optional = true }
wasmer-emscripten = { version = "=5.0.0-rc.1", path = "lib/emscripten", optional = true }
wasmer-wasix = { path = "lib/wasix", optional = true }
wasmer-wast = { version = "=5.0.0-rc.1", path = "tests/lib/wast", optional = true }
wasi-test-generator = { version = "=5.0.0-rc.1", path = "tests/wasi-wast", optional = true }
Expand Down Expand Up @@ -55,7 +54,6 @@ members = [
"lib/compiler",
"lib/config",
"lib/derive",
"lib/emscripten",
"lib/object",
"lib/sys-utils",
"lib/types",
Expand Down Expand Up @@ -166,7 +164,6 @@ default = [
"cache",
"wasi",
"engine",
"emscripten",
"middlewares",
]
# backend means that the `wasmer` crate will be compiled with the `wasmer-compiler` or the `jsc`.
Expand All @@ -181,7 +178,6 @@ universal = []
cache = ["wasmer-cache"]
wast = ["wasmer-wast"]
wasi = ["wasmer-wasix"]
emscripten = ["wasmer-emscripten"]
wat = ["wasmer/wat"]
compiler = ["wasmer/compiler", "backend", "wasmer-compiler/translator"]
singlepass = ["compiler", "wasmer-compiler-singlepass", "wasmer/singlepass"]
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Wasmer is a _blazing fast_ and _secure_ [**WebAssembly**](https://webassembly.or
_lightweight containers_ to run anywhere: from _Desktop_ to the _Cloud_, _Edge_ and your browser.

- **Secure** by default. No file, network, or environment access, unless explicitly enabled.
- **Pluggable**. supports [**WASIX**](https://wasix.org/), [WASI](https://github.com/WebAssembly/WASI) and [Emscripten](https://emscripten.org/) out of the box.
- **Pluggable**. supports [**WASIX**](https://wasix.org/), [WASI](https://github.com/WebAssembly/WASI) out of the box.
- **Incredibly Fast**. Run WebAssembly at near-native speeds.
- **Embeddable** [anywhere via Wasmer SDKs](https://github.com/wasmerio/wasmer/#wasmer-sdk)

Expand Down
2 changes: 1 addition & 1 deletion docs/BUILD.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ curl https://sh.rustup.rs -sSf | sh

### Windows

Windows is fully supported by Wasmer. WASI is also fully supported, but Emscripten support is still experimental.
Windows is fully supported by Wasmer. WASI is also fully supported.

1. Install [Visual Studio](https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15)
2. Install [Rust for Windows](https://win.rustup.rs/)
Expand Down
2 changes: 0 additions & 2 deletions docs/deps_dedup.dot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ digraph dependencies {
n8 [label="wasmer-types", color=orange];
n9 [label="wasmer-vm", color=orange];
n10 [label="wasmer-c-api", color=orange];
n11 [label="wasmer-emscripten", color=orange];
n12 [label="wasmer-wasi", color=orange];
n13 [label="wasmer-cache", color=orange];
n14 [label="wasmer-cli", color=orange];
Expand Down Expand Up @@ -45,7 +44,6 @@ digraph dependencies {
color=brown;

n12 [label="wasmer-wasi", color=orange];
n11 [label="wasmer-emscripten", color=orange];
}

n14 -> n13 [color=orange, style=dashed];
Expand Down
1 change: 0 additions & 1 deletion lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ composed of a set of crates. We can group them as follows:
performance.
* `derive` — A set of procedural macros used inside Wasmer,
* ABI:
* `emscripten` — Emscripten ABI implementation inside Wasmer,
* `wasi` — WASI ABI implementation inside Wasmer:
* `wasi-types` — All the WASI types,
* `engine` — The general abstraction for creating an engine, which is
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/c_api/externals/memory_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl<'a> MemoryView<'a> {

/// Returns the pointer to the raw bytes of the `Memory`.
//
// This used by wasmer-emscripten and wasmer-c-api, but should be treated
// This used by wasmer-c-api, but should be treated
// as deprecated and not used in future code.
#[doc(hidden)]
pub fn data_ptr(&self) -> *mut u8 {
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/externals/memory_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ impl<'a> MemoryView<'a> {

/// Returns the pointer to the raw bytes of the `Memory`.
//
// This used by wasmer-emscripten and wasmer-c-api, but should be treated
// This used by wasmer-c-api, but should be treated
// as deprecated and not used in future code.
#[doc(hidden)]
pub fn data_ptr(&self) -> *mut u8 {
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/jsc/externals/memory_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ impl<'a> MemoryView<'a> {

/// Returns the pointer to the raw bytes of the `Memory`.
//
// This used by wasmer-emscripten and wasmer-c-api, but should be treated
// This used by wasmer-c-api, but should be treated
// as deprecated and not used in future code.
#[doc(hidden)]
pub fn data_ptr(&self) -> *mut u8 {
Expand Down
3 changes: 0 additions & 3 deletions lib/api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@
//! on top of this API that you may be interested in using, including:
//!
//! - [`wasmer-cache`] for caching compiled Wasm modules,
//! - [`wasmer-emscripten`] for running Wasm modules compiled to the
//! Emscripten ABI,
//! - [`wasmer-wasix`] for running Wasm modules compiled to the WASI ABI.
//!
//! The Wasmer project has two major abstractions:
Expand Down Expand Up @@ -383,7 +381,6 @@
//! [wasmer-examples]: https://github.com/wasmerio/wasmer/tree/main/examples
//! [`wasmer-cache`]: https://docs.rs/wasmer-cache/
//! [wasmer-compiler]: https://docs.rs/wasmer-compiler/
//! [`wasmer-emscripten`]: https://docs.rs/wasmer-emscripten/
//! [`wasmer-compiler-singlepass`]: https://docs.rs/wasmer-compiler-singlepass/
//! [`wasmer-compiler-llvm`]: https://docs.rs/wasmer-compiler-llvm/
//! [`wasmer-compiler-cranelift`]: https://docs.rs/wasmer-compiler-cranelift/
Expand Down
2 changes: 1 addition & 1 deletion lib/api/src/sys/externals/memory_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ impl<'a> MemoryView<'a> {

/// Returns the pointer to the raw bytes of the `Memory`.
//
// This used by wasmer-emscripten and wasmer-c-api, but should be treated
// This used by wasmer-c-api, but should be treated
// as deprecated and not used in future code.
#[doc(hidden)]
pub fn data_ptr(&self) -> *mut u8 {
Expand Down
4 changes: 0 additions & 4 deletions lib/c-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ wasmer-compiler = { version = "=5.0.0-rc.1", path = "../compiler", optional = tr
wasmer-compiler-cranelift = { version = "=5.0.0-rc.1", path = "../compiler-cranelift", optional = true }
wasmer-compiler-llvm = { version = "=5.0.0-rc.1", path = "../compiler-llvm", optional = true }
wasmer-compiler-singlepass = { version = "=5.0.0-rc.1", path = "../compiler-singlepass", optional = true }
wasmer-emscripten = { version = "=5.0.0-rc.1", path = "../emscripten", optional = true }
wasmer-middlewares = { version = "=5.0.0-rc.1", path = "../middlewares", optional = true }
wasmer-types = { version = "=5.0.0-rc.1", path = "../types" }
wasmer-wasix = { path = "../wasix", version="=0.29.0", features = ["host-fs", "host-vnet"], optional = true }
Expand Down Expand Up @@ -107,8 +106,5 @@ webc_runner = ["virtual-fs", "webc"]
# Deprecated features.
jit = ["compiler"]

# TODO: Port this feature.
#emscripten = ["wasmer-emscripten"]

[build-dependencies]
cbindgen = { version = "0.27", default-features = false }
5 changes: 0 additions & 5 deletions lib/c-api/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@ const WASI_FEATURE_AS_C_DEFINE: &str = "WASMER_WASI_ENABLED";
#[allow(unused)]
const MIDDLEWARES_FEATURE_AS_C_DEFINE: &str = "WASMER_MIDDLEWARES_ENABLED";

#[allow(unused)]
const EMSCRIPTEN_FEATURE_AS_C_DEFINE: &str = "WASMER_EMSCRIPTEN_ENABLED";

#[allow(unused)]
const JSC_FEATURE_AS_C_DEFINE: &str = "WASMER_JSC_BACKEND";

Expand Down Expand Up @@ -150,7 +147,6 @@ fn build_wasm_c_api_headers(crate_dir: &str, out_dir: &str) {
map_feature_as_c_define!("compiler", COMPILER_FEATURE_AS_C_DEFINE, pre_header);
map_feature_as_c_define!("wasi", WASI_FEATURE_AS_C_DEFINE, pre_header);
map_feature_as_c_define!("middlewares", MIDDLEWARES_FEATURE_AS_C_DEFINE, pre_header);
map_feature_as_c_define!("emscripten", EMSCRIPTEN_FEATURE_AS_C_DEFINE, pre_header);

add_wasmer_version(&mut pre_header);

Expand Down Expand Up @@ -227,7 +223,6 @@ fn new_builder(language: Language, crate_dir: &str, include_guard: &str, header:
.with_define("feature", "universal", UNIVERSAL_FEATURE_AS_C_DEFINE)
.with_define("feature", "compiler", COMPILER_FEATURE_AS_C_DEFINE)
.with_define("feature", "wasi", WASI_FEATURE_AS_C_DEFINE)
.with_define("feature", "emscripten", EMSCRIPTEN_FEATURE_AS_C_DEFINE)
}

fn build_inline_c_env_vars() {
Expand Down
2 changes: 0 additions & 2 deletions lib/cli-compiler/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ This crate is the Wasmer Compiler only CLI.

The Compiler only Wasmer supports the following features:
* `wasi` (default): support for [WASI].
* `emscripten` (default): support for [Emscripten].
* `singlepass`: support for the [Singlepass compiler].

[WASI]: https://github.com/wasmerio/wasmer/tree/main/lib/wasi/
[Emscripten]: https://github.com/wasmerio/wasmer/tree/main/lib/emscripten/
[Singlepass compiler]: https://github.com/wasmerio/wasmer/tree/main/lib/compiler-singlepass/

## CLI commands
Expand Down
2 changes: 0 additions & 2 deletions lib/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ wasmer-compiler = { version = "=5.0.0-rc.1", path = "../compiler", features = [
wasmer-compiler-cranelift = { version = "=5.0.0-rc.1", path = "../compiler-cranelift", optional = true }
wasmer-compiler-singlepass = { version = "=5.0.0-rc.1", path = "../compiler-singlepass", optional = true }
wasmer-compiler-llvm = { version = "=5.0.0-rc.1", path = "../compiler-llvm", optional = true }
wasmer-emscripten = { version = "=5.0.0-rc.1", path = "../emscripten" }
wasmer-package.workspace = true

wasmer-vm = { version = "=5.0.0-rc.1", path = "../vm", optional = true }
Expand All @@ -128,7 +127,6 @@ wasmer-wasix = { path = "../wasix", version = "=0.29.0", features = [
"webc_runner_rt_wcgi",
"webc_runner_rt_dcgi",
"webc_runner_rt_dproxy",
"webc_runner_rt_emscripten",
"host-fs",
"ctrlc",
] }
Expand Down
2 changes: 0 additions & 2 deletions lib/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ The Wasmer supports the following features:
* `wast`(default): support for running wast test files.
* `cache` (default): support or automatically caching compiled artifacts.
* `wasi` (default): support for [WASI].
* `emscripten` (default): support for [Emscripten].
* `singlepass`: support for the [Singlepass compiler].
* `cranelift`: support for the [Cranelift compiler].
* `llvm`: support for the [LLVM compiler].

[WASI]: https://github.com/wasmerio/wasmer/tree/main/lib/wasi/
[Emscripten]: https://github.com/wasmerio/wasmer/tree/main/lib/emscripten/
[Singlepass compiler]: https://github.com/wasmerio/wasmer/tree/main/lib/compiler-singlepass/
[Cranelift compiler]: https://github.com/wasmerio/wasmer/tree/main/lib/compiler-cranelift/
[LLVM compiler]: https://github.com/wasmerio/wasmer/tree/main/lib/compiler-llvm/
Expand Down
24 changes: 1 addition & 23 deletions lib/cli/src/commands/run/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ use wasmer_wasix::{
runners::{
dcgi::{DcgiInstanceFactory, DcgiRunner},
dproxy::DProxyRunner,
emscripten::EmscriptenRunner,
wasi::WasiRunner,
wcgi::{self, AbortHandle, NoOpWcgiCallbacks, WcgiRunner},
MappedCommand, MappedDirectory, Runner,
Expand Down Expand Up @@ -207,9 +206,7 @@ impl Run {
mut store: Store,
runtime: Arc<dyn Runtime + Send + Sync>,
) -> Result<(), Error> {
if wasmer_emscripten::is_emscripten_module(module) {
self.execute_emscripten_module()
} else if wasmer_wasix::is_wasi_module(module) || wasmer_wasix::is_wasix_module(module) {
if wasmer_wasix::is_wasi_module(module) || wasmer_wasix::is_wasix_module(module) {
self.execute_wasi_module(path, module, module_hash, runtime, store)
} else {
self.execute_pure_wasm_module(module, &mut store)
Expand Down Expand Up @@ -240,8 +237,6 @@ impl Run {
self.run_wcgi(id, pkg, uses, runtime)
} else if WasiRunner::can_run_command(cmd.metadata())? {
self.run_wasi(id, pkg, uses, runtime)
} else if EmscriptenRunner::can_run_command(cmd.metadata())? {
self.run_emscripten(id, pkg, runtime)
} else {
bail!(
"Unable to find a runner that supports \"{}\"",
Expand Down Expand Up @@ -364,18 +359,6 @@ impl Run {
runner.run_command(command_name, pkg, runtime)
}

fn run_emscripten(
&self,
command_name: &str,
pkg: &BinaryPackage,
runtime: Arc<dyn Runtime + Send + Sync>,
) -> Result<(), Error> {
let mut runner = wasmer_wasix::runners::emscripten::EmscriptenRunner::new();
runner.set_args(self.args.clone());

runner.run_command(command_name, pkg, runtime)
}

#[tracing::instrument(skip_all)]
fn execute_pure_wasm_module(&self, module: &Module, store: &mut Store) -> Result<(), Error> {
let imports = Imports::default();
Expand Down Expand Up @@ -479,11 +462,6 @@ impl Run {
)
}

#[tracing::instrument(skip_all)]
fn execute_emscripten_module(&self) -> Result<(), Error> {
bail!("Emscripten packages are not currently supported")
}

#[allow(unused_variables)]
fn maybe_save_coredump(&self, e: &Error) {
#[cfg(feature = "coredump")]
Expand Down
9 changes: 2 additions & 7 deletions lib/config/src/package/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ use thiserror::Error;
#[derive(Clone, Copy, Default, Debug, Deserialize, Serialize, PartialEq, Eq)]
#[non_exhaustive]
pub enum Abi {
#[serde(rename = "emscripten")]
Emscripten,
#[default]
#[serde(rename = "none")]
None,
Expand All @@ -55,7 +53,6 @@ impl Abi {
/// Get the ABI's human-friendly name.
pub fn to_str(&self) -> &str {
match self {
Abi::Emscripten => "emscripten",
Abi::Wasi => "wasi",
Abi::WASM4 => "wasm4",
Abi::None => "generic",
Expand Down Expand Up @@ -84,7 +81,6 @@ impl FromStr for Abi {

fn from_str(s: &str) -> Result<Self, Self::Err> {
match s.to_lowercase().as_str() {
"emscripten" => Ok(Abi::Emscripten),
"wasi" => Ok(Abi::Wasi),
"wasm4" => Ok(Abi::WASM4),
"generic" => Ok(Abi::None),
Expand Down Expand Up @@ -258,8 +254,7 @@ pub struct CommandV2 {
pub module: ModuleReference,
/// The runner to use when running this command.
///
/// This may be a URL, or the well-known runners `wasi`, `wcgi`, or
/// `emscripten`.
/// This may be a URL, or the well-known runners `wasi` or `wcgi`
pub runner: String,
/// Extra annotations that will be consumed by the runner.
pub annotations: Option<CommandAnnotations>,
Expand Down Expand Up @@ -952,7 +947,7 @@ pub enum ManifestError {
#[non_exhaustive]
pub enum ValidationError {
#[error(
"missing ABI field on module, \"{module}\", used by command, \"{command}\"; an ABI of `wasi` or `emscripten` is required",
"missing ABI field on module, \"{module}\", used by command, \"{command}\"; an ABI of `wasi` is required",
)]
MissingABI { command: String, module: String },
#[error("missing module, \"{module}\", in manifest used by command, \"{command}\"")]
Expand Down
Loading

0 comments on commit 7a75251

Please sign in to comment.