Rename wasmtime-api to wasmtime.
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmtime"
|
name = "wasmtime-cli"
|
||||||
authors = ["The Wasmtime Project Developers"]
|
authors = ["The Wasmtime Project Developers"]
|
||||||
version = "0.2.0"
|
version = "0.2.0"
|
||||||
description = "Command-line interface for Wasmtime"
|
description = "Command-line interface for Wasmtime"
|
||||||
@@ -15,7 +15,7 @@ cranelift-codegen = { version = "0.49", features = ["enable-serde"] }
|
|||||||
cranelift-entity = { version = "0.49", features = ["enable-serde"] }
|
cranelift-entity = { version = "0.49", features = ["enable-serde"] }
|
||||||
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
|
cranelift-wasm = { version = "0.49", features = ["enable-serde"] }
|
||||||
cranelift-native = { version = "0.49" }
|
cranelift-native = { version = "0.49" }
|
||||||
wasmtime-api = { path = "crates/api" }
|
wasmtime = { path = "crates/api" }
|
||||||
wasmtime-debug = { path = "crates/debug" }
|
wasmtime-debug = { path = "crates/debug" }
|
||||||
wasmtime-environ = { path = "crates/environ" }
|
wasmtime-environ = { path = "crates/environ" }
|
||||||
wasmtime-interface-types = { path = "crates/interface-types" }
|
wasmtime-interface-types = { path = "crates/interface-types" }
|
||||||
|
|||||||
@@ -45,13 +45,13 @@ Additional goals for Wasmtime include:
|
|||||||
|
|
||||||
#### Including Wasmtime in your project
|
#### Including Wasmtime in your project
|
||||||
|
|
||||||
Wasmtime exposes an API for embedding as a library through the `wasmtime-api` subcrate,
|
Wasmtime exposes an API for embedding as a library through the `wasmtime` subcrate,
|
||||||
which contains both a [high-level and safe Rust API], as well as a C-compatible API
|
which contains both a [high-level and safe Rust API], as well as a C-compatible API
|
||||||
compatible with the [proposed WebAssembly C API].
|
compatible with the [proposed WebAssembly C API].
|
||||||
|
|
||||||
For more information, see the [Rust API embedding chapter] of the Wasmtime documentation.
|
For more information, see the [Rust API embedding chapter] of the Wasmtime documentation.
|
||||||
|
|
||||||
[high-level and safe Rust API]: https://docs.rs/wasmtime-api/
|
[high-level and safe Rust API]: https://docs.rs/wasmtime/
|
||||||
[proposed WebAssembly C API]: https://github.com/WebAssembly/wasm-c-api
|
[proposed WebAssembly C API]: https://github.com/WebAssembly/wasm-c-api
|
||||||
[Rust API embedding chapter]: https://cranestation.github.io/wasmtime/embed-rust.html
|
[Rust API embedding chapter]: https://cranestation.github.io/wasmtime/embed-rust.html
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "wasmtime-api"
|
name = "wasmtime"
|
||||||
authors = ["The Wasmtime Project Developers"]
|
authors = ["The Wasmtime Project Developers"]
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "High-level API to expose the Wasmtime runtime"
|
description = "High-level API to expose the Wasmtime runtime"
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ wasmtime-runtime = { path = "../runtime" }
|
|||||||
wasmtime-environ = { path = "../environ" }
|
wasmtime-environ = { path = "../environ" }
|
||||||
wasmtime-jit = { path = "../jit" }
|
wasmtime-jit = { path = "../jit" }
|
||||||
wasmtime-wasi = { path = "../wasi" }
|
wasmtime-wasi = { path = "../wasi" }
|
||||||
wasmtime-api = { path = "../api" }
|
wasmtime = { path = "../api" }
|
||||||
cranelift-codegen = "0.49"
|
cranelift-codegen = "0.49"
|
||||||
target-lexicon = "0.8.1"
|
target-lexicon = "0.8.1"
|
||||||
pretty_env_logger = "0.3.0"
|
pretty_env_logger = "0.3.0"
|
||||||
|
|||||||
Submodule crates/wasi-common/WASI updated: 7a5f477fe4...8651dfa37b
@@ -28,9 +28,11 @@ We will be using the wasmtime engine/API to run the wasm file, so we will add th
|
|||||||
|
|
||||||
```
|
```
|
||||||
[dependencies]
|
[dependencies]
|
||||||
wasmtime-api = { git = "https://github.com/CraneStation/wasmtime" }
|
wasmtime = "<current version>"
|
||||||
```
|
```
|
||||||
|
|
||||||
|
where "<current version>" is the current version number of the `wasmtime` crate.
|
||||||
|
|
||||||
It is time to add code to the `src/main.rs`. First, the engine and storage need to be activated:
|
It is time to add code to the `src/main.rs`. First, the engine and storage need to be activated:
|
||||||
|
|
||||||
```rust
|
```rust
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ use std::process;
|
|||||||
use std::str;
|
use std::str;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
use target_lexicon::Triple;
|
use target_lexicon::Triple;
|
||||||
use wasmtime::pick_compilation_strategy;
|
use wasmtime_cli::pick_compilation_strategy;
|
||||||
use wasmtime_debug::{emit_debugsections, read_debuginfo};
|
use wasmtime_debug::{emit_debugsections, read_debuginfo};
|
||||||
#[cfg(feature = "lightbeam")]
|
#[cfg(feature = "lightbeam")]
|
||||||
use wasmtime_environ::Lightbeam;
|
use wasmtime_environ::Lightbeam;
|
||||||
@@ -130,7 +130,7 @@ fn main() {
|
|||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let prefix = "wasm2obj.dbg.";
|
let prefix = "wasm2obj.dbg.";
|
||||||
wasmtime::init_file_per_thread_logger(prefix);
|
wasmtime_cli::init_file_per_thread_logger(prefix);
|
||||||
Some(prefix)
|
Some(prefix)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ use std::path::Component;
|
|||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process::exit;
|
use std::process::exit;
|
||||||
use wasi_common::preopen_dir;
|
use wasi_common::preopen_dir;
|
||||||
use wasmtime::pick_compilation_strategy;
|
use wasmtime_cli::pick_compilation_strategy;
|
||||||
use wasmtime_api::{Config, Engine, HostRef, Instance, Module, Store};
|
use wasmtime_api::{Config, Engine, HostRef, Instance, Module, Store};
|
||||||
use wasmtime_environ::{cache_create_new_config, cache_init};
|
use wasmtime_environ::{cache_create_new_config, cache_init};
|
||||||
use wasmtime_interface_types::ModuleData;
|
use wasmtime_interface_types::ModuleData;
|
||||||
@@ -200,7 +200,7 @@ fn main() -> Result<()> {
|
|||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let prefix = "wasmtime.dbg.";
|
let prefix = "wasmtime.dbg.";
|
||||||
wasmtime::init_file_per_thread_logger(prefix);
|
wasmtime_cli::init_file_per_thread_logger(prefix);
|
||||||
Some(prefix)
|
Some(prefix)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ use pretty_env_logger;
|
|||||||
use serde::Deserialize;
|
use serde::Deserialize;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
use std::process;
|
use std::process;
|
||||||
use wasmtime::pick_compilation_strategy;
|
use wasmtime_cli::pick_compilation_strategy;
|
||||||
use wasmtime_environ::{cache_create_new_config, cache_init};
|
use wasmtime_environ::{cache_create_new_config, cache_init};
|
||||||
use wasmtime_jit::{Compiler, Features};
|
use wasmtime_jit::{Compiler, Features};
|
||||||
use wasmtime_wast::WastContext;
|
use wasmtime_wast::WastContext;
|
||||||
@@ -93,7 +93,7 @@ fn main() {
|
|||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let prefix = "cranelift.dbg.";
|
let prefix = "cranelift.dbg.";
|
||||||
wasmtime::init_file_per_thread_logger(prefix);
|
wasmtime_cli::init_file_per_thread_logger(prefix);
|
||||||
Some(prefix)
|
Some(prefix)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user