forked from bytecodealliance/wasmtime
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
wasi-adapter: Implement provider crate that embeds the adapter binari…
…es (bytecodealliance#8792) * wasi-adapter: Implement provider crate that embeds the adapter binaries * Upgrade wasi adapters to the latest version * Update adapter docs * Recompile asi adapters with 1.78 * Recompile wasi adapters with 1.79 * Add some debugging to adapter build script * Fix script debugging * Compute wasi adapter version based on latest adapter commit hash * Try to bless wasi adapters again * Try to work around CI auto-merges * Revert to just using workspace version * Add the wasi adapter provider to the crate publication list * Use wasi adapter provider in artifacts test + explicit MSRV in CI * Explicit adapter crate version * Small fix * Remove version info from adapter metadata * Check but don't install rust toolchain in build script * Bless after rebase --------- Co-authored-by: Alex Crichton <alex@alexcrichton.com>
- Loading branch information
1 parent
864fdb6
commit 2dbf8f1
Showing
13 changed files
with
155 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
crates/wasi-preview1-component-adapter/provider/Cargo.toml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
[package] | ||
name = "wasi-preview1-component-adapter-provider" | ||
version.workspace = true | ||
authors.workspace = true | ||
description = "Embedded wasi-preview1-component-adapter binaries" | ||
license = "Apache-2.0 WITH LLVM-exception" | ||
repository = "https://github.com/bytecodealliance/wasmtime" | ||
documentation = "https://docs.rs/wasi-preview1-component-adapter-provider/" | ||
categories = ["wasm"] | ||
keywords = ["webassembly", "wasm"] | ||
edition.workspace = true | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[package.metadata.docs.rs] | ||
all-features = true | ||
|
||
[dependencies] |
Binary file added
BIN
+78.2 KB
...es/wasi-preview1-component-adapter/provider/artefacts/wasi_snapshot_preview1.command.wasm
Binary file not shown.
Binary file added
BIN
+27.4 KB
crates/wasi-preview1-component-adapter/provider/artefacts/wasi_snapshot_preview1.proxy.wasm
Binary file not shown.
Binary file added
BIN
+78 KB
...es/wasi-preview1-component-adapter/provider/artefacts/wasi_snapshot_preview1.reactor.wasm
Binary file not shown.
51 changes: 51 additions & 0 deletions
51
crates/wasi-preview1-component-adapter/provider/src/lib.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
//! This crate contains the binaries of three WebAssembly modules: | ||
//! | ||
//! - [`WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER`] | ||
//! - [`WASI_SNAPSHOT_PREVIEW1_COMMAND_ADAPTER`] | ||
//! - [`WASI_SNAPSHOT_PREVIEW1_PROXY_ADAPTER`] | ||
//! | ||
//! These three modules bridge the wasip1 ABI to the wasip2 ABI of the component | ||
//! model. | ||
//! | ||
//! They can be given to the [`wit_component::ComponentEncoder::adapter`] | ||
//! method, using the [`WASI_SNAPSHOT_PREVIEW1_ADAPTER_NAME`], to translate a | ||
//! module from the historical WASM ABI to the canonical ABI. | ||
//! | ||
//! [`wit_component::ComponentEncoder::adapter`]: https://docs.rs/wit-component/latest/wit_component/struct.ComponentEncoder.html#method.adapter | ||
/// The name of the adapters in this crate, which may be provided to | ||
/// [`wit_component::ComponentEncoder::adapter`]. | ||
/// | ||
/// [`wit_component::ComponentEncoder::adapter`]: https://docs.rs/wit-component/latest/wit_component/struct.ComponentEncoder.html#method.adapter | ||
pub const WASI_SNAPSHOT_PREVIEW1_ADAPTER_NAME: &str = "wasi_snapshot_preview1"; | ||
|
||
/// The "reactor" adapter provides the default adaptation from preview1 to | ||
/// preview2. | ||
/// | ||
/// This adapter implements the [`wasi:cli/imports`] world. | ||
/// | ||
/// [`wasi:cli/imports`]: https://github.com/WebAssembly/WASI/blob/01bb90d8b66cbc1d50349aaaab9ac5b143c9c98c/preview2/cli/imports.wit | ||
pub const WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER: &[u8] = | ||
include_bytes!("../artefacts/wasi_snapshot_preview1.reactor.wasm"); | ||
|
||
/// The "command" adapter extends the ["reactor" adapter] and additionally | ||
/// exports a `run` function entrypoint. | ||
/// | ||
/// This adapter implements the [`wasi:cli/command`] world. | ||
/// | ||
/// ["reactor" adapter]: WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER | ||
/// [`wasi:cli/command`]: https://github.com/WebAssembly/WASI/blob/01bb90d8b66cbc1d50349aaaab9ac5b143c9c98c/preview2/cli/command.wit | ||
pub const WASI_SNAPSHOT_PREVIEW1_COMMAND_ADAPTER: &[u8] = | ||
include_bytes!("../artefacts/wasi_snapshot_preview1.command.wasm"); | ||
|
||
/// The "proxy" adapter provides implements a HTTP proxy which is more | ||
/// restricted than the ["reactor" adapter] adapter, as it lacks filesystem, | ||
/// socket, environment, exit, and terminal support, but includes HTTP handlers | ||
/// for incoming and outgoing requests. | ||
/// | ||
/// This adapter implements the [`wasi:http/proxy`] world. | ||
/// | ||
/// ["reactor" adapter]: WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER | ||
/// [`wasi:http/proxy`]: https://github.com/WebAssembly/WASI/blob/01bb90d8b66cbc1d50349aaaab9ac5b143c9c98c/preview2/http/proxy.wit | ||
pub const WASI_SNAPSHOT_PREVIEW1_PROXY_ADAPTER: &[u8] = | ||
include_bytes!("../artefacts/wasi_snapshot_preview1.proxy.wasm"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters