Files
wasmtime/crates/environ/Cargo.toml
Alex Crichton 70345aff31 Remove all global state from the caching system (#863)
* Remove all global state from the caching system

This commit is a continuation of an effort to remove usages of
`lazy_static!` and similar global state macros which can otherwise be
accomodated with passing objects around. Previously there was a global
cache system initialized per-process, but it was initialized in a bit of
a roundabout way and wasn't actually reachable from the `wasmtime` crate
itself. The changes here remove all global state, refactor many of the
internals in the cache system, and makes configuration possible through
the `wasmtime` crate.

Specifically some changes here are:

* Usage of `lazy_static!` and many `static` items in the cache module
  have all been removed.
* Global `cache_config()`, `worker()`, and `init()` functions have all
  been removed. Instead a `CacheConfig` is a "root object" which
  internally owns its worker and passing around the `CacheConfig` is
  required for cache usage.
* The `wasmtime::Config` structure has grown options to load and parse
  cache files at runtime. Currently only loading files is supported,
  although we can likely eventually support programmatically configuring
  APIs as well.
* Usage of the `spin` crate has been removed and the dependency is removed.
* The internal `errors` field of `CacheConfig` is removed, instead
  changing all relevant methods to return a `Result<()>` instead of
  storing errors internally.
* Tests have all been updated with the new interfaces and APIs.

Functionally no real change is intended here. Usage of the `wasmtime`
CLI, for example, should still enable the cache by default.

* Fix lightbeam compilation
2020-02-06 13:11:06 -06:00

53 lines
1.6 KiB
TOML

[package]
name = "wasmtime-environ"
version = "0.9.0"
authors = ["The Wasmtime Project Developers"]
description = "Standalone environment support for WebAsssembly code in Cranelift"
license = "Apache-2.0 WITH LLVM-exception"
repository = "https://github.com/bytecodealliance/wasmtime"
documentation = "https://docs.rs/wasmtime-environ/"
categories = ["wasm"]
keywords = ["webassembly", "wasm"]
readme = "README.md"
edition = "2018"
[dependencies]
anyhow = "1.0"
cranelift-codegen = { version = "0.56", features = ["enable-serde"] }
cranelift-entity = { version = "0.56", features = ["enable-serde"] }
cranelift-wasm = { version = "0.56", features = ["enable-serde"] }
wasmparser = "0.51.0"
lightbeam = { path = "../lightbeam", optional = true, version = "0.9.0" }
indexmap = "1.0.2"
rayon = "1.2.1"
thiserror = "1.0.4"
directories = "2.0.1"
sha2 = "0.8.0"
base64 = "0.11.0"
serde = { version = "1.0.94", features = ["derive"] }
bincode = "1.1.4"
lazy_static = "1.3.0"
log = { version = "0.4.8", default-features = false }
zstd = "0.5"
toml = "0.5.5"
file-per-thread-logger = "0.1.1"
more-asserts = "0.2.1"
[target.'cfg(target_os = "windows")'.dependencies]
winapi = "0.3.7"
[target.'cfg(not(target_os = "windows"))'.dependencies]
libc = "0.2.60"
errno = "0.2.4"
[dev-dependencies]
tempfile = "3"
target-lexicon = { version = "0.10.0", default-features = false }
pretty_env_logger = "0.3.0"
rand = { version = "0.7.0", default-features = false, features = ["small_rng"] }
cranelift-codegen = { version = "0.56", features = ["enable-serde", "all-arch"] }
filetime = "0.2.7"
[badges]
maintenance = { status = "actively-developed" }