From d9ca508f8055ae273c9adcc114181e5782900a1d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Fri, 8 Nov 2019 06:41:07 -0800 Subject: [PATCH] Rename `wasmtime-api` to `wasmtime`. --- Cargo.toml | 4 ++-- README.md | 4 ++-- crates/api/Cargo.toml | 2 +- crates/wasi-common/Cargo.toml | 2 +- crates/wasi-common/WASI | 2 +- docs/embed-rust.md | 4 +++- src/bin/wasm2obj.rs | 4 ++-- src/bin/wasmtime.rs | 4 ++-- src/bin/wast.rs | 4 ++-- 9 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index f68ec5f475..453576f3bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wasmtime" +name = "wasmtime-cli" authors = ["The Wasmtime Project Developers"] version = "0.2.0" 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-wasm = { version = "0.49", features = ["enable-serde"] } cranelift-native = { version = "0.49" } -wasmtime-api = { path = "crates/api" } +wasmtime = { path = "crates/api" } wasmtime-debug = { path = "crates/debug" } wasmtime-environ = { path = "crates/environ" } wasmtime-interface-types = { path = "crates/interface-types" } diff --git a/README.md b/README.md index 8e82aa6db8..f53b1c7bc7 100644 --- a/README.md +++ b/README.md @@ -45,13 +45,13 @@ Additional goals for Wasmtime include: #### 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 compatible with the [proposed WebAssembly C API]. 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 [Rust API embedding chapter]: https://cranestation.github.io/wasmtime/embed-rust.html diff --git a/crates/api/Cargo.toml b/crates/api/Cargo.toml index 33359ecc65..3b2d787d82 100644 --- a/crates/api/Cargo.toml +++ b/crates/api/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wasmtime-api" +name = "wasmtime" authors = ["The Wasmtime Project Developers"] version = "0.1.0" description = "High-level API to expose the Wasmtime runtime" diff --git a/crates/wasi-common/Cargo.toml b/crates/wasi-common/Cargo.toml index 965887d4b2..6e31fcc60c 100644 --- a/crates/wasi-common/Cargo.toml +++ b/crates/wasi-common/Cargo.toml @@ -41,7 +41,7 @@ wasmtime-runtime = { path = "../runtime" } wasmtime-environ = { path = "../environ" } wasmtime-jit = { path = "../jit" } wasmtime-wasi = { path = "../wasi" } -wasmtime-api = { path = "../api" } +wasmtime = { path = "../api" } cranelift-codegen = "0.49" target-lexicon = "0.8.1" pretty_env_logger = "0.3.0" diff --git a/crates/wasi-common/WASI b/crates/wasi-common/WASI index 7a5f477fe4..8651dfa37b 160000 --- a/crates/wasi-common/WASI +++ b/crates/wasi-common/WASI @@ -1 +1 @@ -Subproject commit 7a5f477fe411c2887d0689184d4aadbfc4892c0f +Subproject commit 8651dfa37b92d17215d1364f935ffa1ac2b77c60 diff --git a/docs/embed-rust.md b/docs/embed-rust.md index 3701871d0b..a391290b7d 100644 --- a/docs/embed-rust.md +++ b/docs/embed-rust.md @@ -28,9 +28,11 @@ We will be using the wasmtime engine/API to run the wasm file, so we will add th ``` [dependencies] -wasmtime-api = { git = "https://github.com/CraneStation/wasmtime" } +wasmtime = "" ``` +where "" 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: ```rust diff --git a/src/bin/wasm2obj.rs b/src/bin/wasm2obj.rs index 30747ee9d6..3db711159f 100644 --- a/src/bin/wasm2obj.rs +++ b/src/bin/wasm2obj.rs @@ -49,7 +49,7 @@ use std::process; use std::str; use std::str::FromStr; use target_lexicon::Triple; -use wasmtime::pick_compilation_strategy; +use wasmtime_cli::pick_compilation_strategy; use wasmtime_debug::{emit_debugsections, read_debuginfo}; #[cfg(feature = "lightbeam")] use wasmtime_environ::Lightbeam; @@ -130,7 +130,7 @@ fn main() { None } else { let prefix = "wasm2obj.dbg."; - wasmtime::init_file_per_thread_logger(prefix); + wasmtime_cli::init_file_per_thread_logger(prefix); Some(prefix) }; diff --git a/src/bin/wasmtime.rs b/src/bin/wasmtime.rs index 3bf755a55f..ffc2bf4117 100644 --- a/src/bin/wasmtime.rs +++ b/src/bin/wasmtime.rs @@ -43,7 +43,7 @@ use std::path::Component; use std::path::Path; use std::process::exit; 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_environ::{cache_create_new_config, cache_init}; use wasmtime_interface_types::ModuleData; @@ -200,7 +200,7 @@ fn main() -> Result<()> { None } else { let prefix = "wasmtime.dbg."; - wasmtime::init_file_per_thread_logger(prefix); + wasmtime_cli::init_file_per_thread_logger(prefix); Some(prefix) }; diff --git a/src/bin/wast.rs b/src/bin/wast.rs index 08191f51ac..c019fe11b8 100644 --- a/src/bin/wast.rs +++ b/src/bin/wast.rs @@ -33,7 +33,7 @@ use pretty_env_logger; use serde::Deserialize; use std::path::Path; 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_jit::{Compiler, Features}; use wasmtime_wast::WastContext; @@ -93,7 +93,7 @@ fn main() { None } else { let prefix = "cranelift.dbg."; - wasmtime::init_file_per_thread_logger(prefix); + wasmtime_cli::init_file_per_thread_logger(prefix); Some(prefix) };