diff --git a/Cargo.lock b/Cargo.lock index 88341a78..ebfb31a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -586,16 +586,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "core-foundation" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -1011,21 +1001,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.2.1" @@ -1299,101 +1274,6 @@ dependencies = [ "triomphe", ] -[[package]] -name = "http" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" -dependencies = [ - "bytes", - "http", -] - -[[package]] -name = "http-body-util" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" -dependencies = [ - "bytes", - "futures-util", - "http", - "http-body", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" - -[[package]] -name = "hyper" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "httparse", - "itoa", - "pin-project-lite", - "smallvec", - "tokio", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" -dependencies = [ - "bytes", - "http-body-util", - "hyper", - "hyper-util", - "native-tls", - "tokio", - "tokio-native-tls", - "tower-service", -] - -[[package]] -name = "hyper-util" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "http", - "http-body", - "hyper", - "pin-project-lite", - "socket2", - "tokio", - "tower", - "tower-service", - "tracing", -] - [[package]] name = "iana-time-zone" version = "0.1.60" @@ -1885,23 +1765,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "native-tls" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" -dependencies = [ - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -2000,50 +1863,6 @@ version = "11.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" -[[package]] -name = "openssl" -version = "0.10.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.70", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "outref" version = "0.1.0" @@ -2104,26 +1923,6 @@ dependencies = [ "siphasher", ] -[[package]] -name = "pin-project" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.70", -] - [[package]] name = "pin-project-lite" version = "0.2.14" @@ -2249,33 +2048,6 @@ dependencies = [ "rand", ] -[[package]] -name = "quickjs-wasm-rs" -version = "3.1.0" -dependencies = [ - "anyhow", - "once_cell", - "quickcheck", - "quickjs-wasm-sys", - "serde", - "serde_bytes", -] - -[[package]] -name = "quickjs-wasm-sys" -version = "1.2.1" -dependencies = [ - "anyhow", - "bindgen", - "cc", - "http-body-util", - "hyper", - "hyper-tls", - "hyper-util", - "tokio", - "walkdir", -] - [[package]] name = "quote" version = "1.0.36" @@ -2553,15 +2325,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "schannel" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "scoped-tls" version = "1.0.1" @@ -2574,29 +2337,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" -[[package]] -name = "security-framework" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "0.9.0" @@ -2639,15 +2379,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_bytes" -version = "0.11.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "387cc504cb06bb40a96c8e04e951fe01854cf6bc921053c954e4a606d9675c6a" -dependencies = [ - "serde", -] - [[package]] name = "serde_derive" version = "1.0.204" @@ -3183,31 +2914,9 @@ dependencies = [ "num_cpus", "pin-project-lite", "socket2", - "tokio-macros", "windows-sys 0.48.0", ] -[[package]] -name = "tokio-macros" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.70", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "toml" version = "0.8.14" @@ -3253,33 +2962,6 @@ dependencies = [ "winnow 0.6.13", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - [[package]] name = "tracing" version = "0.1.40" @@ -3322,12 +3004,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "try-lock" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" - [[package]] name = "typed-arena" version = "2.0.2" @@ -3429,12 +3105,6 @@ dependencies = [ "ryu", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "vergen" version = "8.3.1" @@ -3491,15 +3161,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "want" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" -dependencies = [ - "try-lock", -] - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/Cargo.toml b/Cargo.toml index 216069ad..1dc0aa48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,5 @@ [workspace] members = [ - "crates/quickjs-wasm-sys", - "crates/quickjs-wasm-rs", "crates/javy", "crates/apis", "crates/core", diff --git a/Makefile b/Makefile index 8bd7045f..974fac55 100644 --- a/Makefile +++ b/Makefile @@ -49,15 +49,7 @@ test-config: tests: test-javy test-core test-runner test-cli test-wpt test-config -fmt: fmt-quickjs-wasm-sys fmt-quickjs-wasm-rs fmt-javy fmt-apis fmt-core fmt-cli - -fmt-quickjs-wasm-sys: - cargo fmt --package=quickjs-wasm-sys -- --check - cargo clippy --package=quickjs-wasm-sys --target=wasm32-wasi --all-targets -- -D warnings - -fmt-quickjs-wasm-rs: - cargo fmt --package=quickjs-wasm-rs -- --check - cargo clippy --package=quickjs-wasm-rs --target=wasm32-wasi --all-targets -- -D warnings +fmt: fmt-javy fmt-apis fmt-core fmt-cli fmt-javy: cargo fmt --package=javy -- --check diff --git a/crates/cli/benches/benchmark.rs b/crates/cli/benches/benchmark.rs index a310b21b..9f62928a 100644 --- a/crates/cli/benches/benchmark.rs +++ b/crates/cli/benches/benchmark.rs @@ -7,7 +7,7 @@ use wasi_common::{ sync::WasiCtxBuilder, WasiCtx, }; -use wasmtime::{Engine, Linker, Module, Store}; +use wasmtime::{AsContextMut, Engine, Linker, Module, Store}; struct FunctionCase { name: String, @@ -84,22 +84,26 @@ impl FunctionCase { Ok(function_case) } - pub fn run(&self, linker: &mut Linker, mut store: &mut Store) -> Result<()> { + pub fn run( + &self, + linker: &mut Linker, + mut store: impl AsContextMut, + ) -> Result<()> { let js_module = match &self.precompiled_elf_bytes { Some(bytes) => unsafe { Module::deserialize(&self.engine, bytes) }?, None => Module::new(&self.engine, &self.wasm_bytes)?, }; - let consumer_instance = linker.instantiate(&mut store, &js_module)?; - linker.instance(&mut store, "consumer", consumer_instance)?; + let consumer_instance = linker.instantiate(store.as_context_mut(), &js_module)?; + linker.instance(store.as_context_mut(), "consumer", consumer_instance)?; linker - .get(&mut store, "consumer", "_start") + .get(store.as_context_mut(), "consumer", "_start") .unwrap() .into_func() .unwrap() - .typed::<(), ()>(&mut store)? - .call(&mut store, ())?; + .typed::<(), ()>(store.as_context())? + .call(store.as_context_mut(), ())?; Ok(()) } @@ -120,8 +124,8 @@ impl FunctionCase { "../../target/wasm32-wasi/release/javy_quickjs_provider_wizened.wasm", ))?, )?; - let instance = linker.instantiate(&mut store, &qjs_provider)?; - linker.instance(&mut store, "javy_quickjs_provider_v2", instance)?; + let instance = linker.instantiate(store.as_context_mut(), &qjs_provider)?; + linker.instance(store.as_context_mut(), "javy_quickjs_provider_v2", instance)?; } Ok((linker, store)) @@ -169,7 +173,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { |b, f| { b.iter_with_setup( || function_case.setup().unwrap(), - |(mut linker, mut store)| f.run(&mut linker, &mut store).unwrap(), + |(mut linker, mut store)| f.run(&mut linker, store.as_context_mut()).unwrap(), ) }, ); diff --git a/crates/cli/src/bytecode.rs b/crates/cli/src/bytecode.rs index 021595de..bbf15333 100644 --- a/crates/cli/src/bytecode.rs +++ b/crates/cli/src/bytecode.rs @@ -1,6 +1,6 @@ use anyhow::{anyhow, Result}; use wasi_common::{sync::WasiCtxBuilder, WasiCtx}; -use wasmtime::{Engine, Instance, Linker, Memory, Module, Store}; +use wasmtime::{AsContextMut, Engine, Instance, Linker, Memory, Module, Store}; pub const QUICKJS_PROVIDER_MODULE: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/provider.wasm")); @@ -8,9 +8,9 @@ pub const QUICKJS_PROVIDER_MODULE: &[u8] = pub fn compile_source(js_source_code: &[u8]) -> Result> { let (mut store, instance, memory) = create_wasm_env()?; let (js_src_ptr, js_src_len) = - copy_source_code_into_instance(js_source_code, &mut store, &instance, &memory)?; - let ret_ptr = call_compile(js_src_ptr, js_src_len, &mut store, &instance)?; - let bytecode = copy_bytecode_from_instance(ret_ptr, &mut store, &memory)?; + copy_source_code_into_instance(js_source_code, store.as_context_mut(), &instance, &memory)?; + let ret_ptr = call_compile(js_src_ptr, js_src_len, store.as_context_mut(), &instance)?; + let bytecode = copy_bytecode_from_instance(ret_ptr, store.as_context_mut(), &memory)?; Ok(bytecode) } @@ -24,29 +24,39 @@ fn create_wasm_env() -> Result<(Store, Instance, Memory)> { )?; let wasi = WasiCtxBuilder::new().inherit_stderr().build(); let mut store = Store::new(&engine, wasi); - let instance = linker.instantiate(&mut store, &module)?; - let memory = instance.get_memory(&mut store, "memory").unwrap(); + let instance = linker.instantiate(store.as_context_mut(), &module)?; + let memory = instance + .get_memory(store.as_context_mut(), "memory") + .unwrap(); Ok((store, instance, memory)) } fn copy_source_code_into_instance( js_source_code: &[u8], - mut store: &mut Store, + mut store: impl AsContextMut, instance: &Instance, memory: &Memory, ) -> Result<(u32, u32)> { - let realloc_fn = instance - .get_typed_func::<(u32, u32, u32, u32), u32>(&mut store, "canonical_abi_realloc")?; + let realloc_fn = instance.get_typed_func::<(u32, u32, u32, u32), u32>( + store.as_context_mut(), + "canonical_abi_realloc", + )?; let js_src_len = js_source_code.len().try_into()?; let original_ptr = 0; let original_size = 0; let alignment = 1; let size = js_src_len; - let js_source_ptr = - realloc_fn.call(&mut store, (original_ptr, original_size, alignment, size))?; + let js_source_ptr = realloc_fn.call( + store.as_context_mut(), + (original_ptr, original_size, alignment, size), + )?; - memory.write(&mut store, js_source_ptr.try_into()?, js_source_code)?; + memory.write( + store.as_context_mut(), + js_source_ptr.try_into()?, + js_source_code, + )?; Ok((js_source_ptr, js_src_len)) } @@ -54,29 +64,30 @@ fn copy_source_code_into_instance( fn call_compile( js_src_ptr: u32, js_src_len: u32, - mut store: &mut Store, + mut store: impl AsContextMut, instance: &Instance, ) -> Result { - let compile_src_fn = instance.get_typed_func::<(u32, u32), u32>(&mut store, "compile_src")?; + let compile_src_fn = + instance.get_typed_func::<(u32, u32), u32>(store.as_context_mut(), "compile_src")?; let ret_ptr = compile_src_fn - .call(&mut store, (js_src_ptr, js_src_len)) + .call(store.as_context_mut(), (js_src_ptr, js_src_len)) .map_err(|_| anyhow!("JS compilation failed"))?; Ok(ret_ptr) } fn copy_bytecode_from_instance( ret_ptr: u32, - mut store: &mut Store, + mut store: impl AsContextMut, memory: &Memory, ) -> Result> { let mut ret_buffer = [0; 8]; - memory.read(&mut store, ret_ptr.try_into()?, &mut ret_buffer)?; + memory.read(store.as_context_mut(), ret_ptr.try_into()?, &mut ret_buffer)?; let bytecode_ptr = u32::from_le_bytes(ret_buffer[0..4].try_into()?); let bytecode_len = u32::from_le_bytes(ret_buffer[4..8].try_into()?); let mut bytecode = vec![0; bytecode_len.try_into()?]; - memory.read(&mut store, bytecode_ptr.try_into()?, &mut bytecode)?; + memory.read(store.as_context(), bytecode_ptr.try_into()?, &mut bytecode)?; Ok(bytecode) } diff --git a/crates/cli/tests/dylib_test.rs b/crates/cli/tests/dylib_test.rs index 24c4a3ac..89463072 100644 --- a/crates/cli/tests/dylib_test.rs +++ b/crates/cli/tests/dylib_test.rs @@ -2,7 +2,7 @@ use anyhow::Result; use std::boxed::Box; use std::str; use wasi_common::{pipe::WritePipe, sync::WasiCtxBuilder, WasiCtx, WasiFile}; -use wasmtime::{Engine, Instance, Linker, Store}; +use wasmtime::{AsContextMut, Engine, Instance, Linker, Store}; mod common; @@ -49,9 +49,10 @@ fn run_js_src(js_src: &str, stderr: &T) -> Result let (instance, mut store) = create_wasm_env(stderr)?; let eval_bytecode_func = - instance.get_typed_func::<(u32, u32), ()>(&mut store, "eval_bytecode")?; - let (bytecode_ptr, bytecode_len) = compile_src(js_src.as_bytes(), &instance, &mut store)?; - eval_bytecode_func.call(&mut store, (bytecode_ptr, bytecode_len))?; + instance.get_typed_func::<(u32, u32), ()>(store.as_context_mut(), "eval_bytecode")?; + let (bytecode_ptr, bytecode_len) = + compile_src(js_src.as_bytes(), &instance, store.as_context_mut())?; + eval_bytecode_func.call(store.as_context_mut(), (bytecode_ptr, bytecode_len))?; Ok(()) } @@ -62,11 +63,14 @@ fn run_invoke( ) -> Result<()> { let (instance, mut store) = create_wasm_env(stderr)?; - let invoke_func = instance.get_typed_func::<(u32, u32, u32, u32), ()>(&mut store, "invoke")?; - let (bytecode_ptr, bytecode_len) = compile_src(js_src.as_bytes(), &instance, &mut store)?; - let (fn_name_ptr, fn_name_len) = copy_func_name(fn_to_invoke, &instance, &mut store)?; + let invoke_func = + instance.get_typed_func::<(u32, u32, u32, u32), ()>(store.as_context_mut(), "invoke")?; + let (bytecode_ptr, bytecode_len) = + compile_src(js_src.as_bytes(), &instance, store.as_context_mut())?; + let (fn_name_ptr, fn_name_len) = + copy_func_name(fn_to_invoke, &instance, store.as_context_mut())?; invoke_func.call( - &mut store, + store.as_context_mut(), (bytecode_ptr, bytecode_len, fn_name_ptr, fn_name_len), )?; Ok(()) @@ -84,7 +88,7 @@ fn create_wasm_env( let module = common::create_quickjs_provider_module(&engine)?; let mut store = Store::new(&engine, wasi); - let instance = linker.instantiate(&mut store, &module)?; + let instance = linker.instantiate(store.as_context_mut(), &module)?; Ok((instance, store)) } @@ -92,17 +96,28 @@ fn create_wasm_env( fn compile_src( js_src: &[u8], instance: &Instance, - mut store: &mut Store, + mut store: impl AsContextMut, ) -> Result<(u32, u32)> { - let memory = instance.get_memory(&mut store, "memory").unwrap(); - let compile_src_func = instance.get_typed_func::<(u32, u32), u32>(&mut store, "compile_src")?; - - let js_src_ptr = allocate_memory(instance, store, 1, js_src.len().try_into()?)?; - memory.write(&mut store, js_src_ptr.try_into()?, js_src)?; + let memory = instance + .get_memory(store.as_context_mut(), "memory") + .unwrap(); + let compile_src_func = + instance.get_typed_func::<(u32, u32), u32>(store.as_context_mut(), "compile_src")?; + + let js_src_ptr = allocate_memory( + instance, + store.as_context_mut(), + 1, + js_src.len().try_into()?, + )?; + memory.write(store.as_context_mut(), js_src_ptr.try_into()?, js_src)?; - let ret_ptr = compile_src_func.call(&mut store, (js_src_ptr, js_src.len().try_into()?))?; + let ret_ptr = compile_src_func.call( + store.as_context_mut(), + (js_src_ptr, js_src.len().try_into()?), + )?; let mut ret_buffer = [0; 8]; - memory.read(&mut store, ret_ptr.try_into()?, &mut ret_buffer)?; + memory.read(store.as_context(), ret_ptr.try_into()?, &mut ret_buffer)?; let bytecode_ptr = u32::from_le_bytes(ret_buffer[0..4].try_into()?); let bytecode_len = u32::from_le_bytes(ret_buffer[4..8].try_into()?); @@ -112,27 +127,43 @@ fn compile_src( fn copy_func_name( fn_name: &str, instance: &Instance, - mut store: &mut Store, + mut store: impl AsContextMut, ) -> Result<(u32, u32)> { - let memory = instance.get_memory(&mut store, "memory").unwrap(); + let memory = instance + .get_memory(store.as_context_mut(), "memory") + .unwrap(); let fn_name_bytes = fn_name.as_bytes(); - let fn_name_ptr = allocate_memory(instance, store, 1, fn_name_bytes.len().try_into()?)?; - memory.write(&mut store, fn_name_ptr.try_into()?, fn_name_bytes)?; + let fn_name_ptr = allocate_memory( + instance, + store.as_context_mut(), + 1, + fn_name_bytes.len().try_into()?, + )?; + memory.write( + store.as_context_mut(), + fn_name_ptr.try_into()?, + fn_name_bytes, + )?; Ok((fn_name_ptr, fn_name_bytes.len().try_into()?)) } fn allocate_memory( instance: &Instance, - mut store: &mut Store, + mut store: impl AsContextMut, alignment: u32, new_size: u32, ) -> Result { - let realloc_func = instance - .get_typed_func::<(u32, u32, u32, u32), u32>(&mut store, "canonical_abi_realloc")?; + let realloc_func = instance.get_typed_func::<(u32, u32, u32, u32), u32>( + store.as_context_mut(), + "canonical_abi_realloc", + )?; let orig_ptr = 0; let orig_size = 0; realloc_func - .call(&mut store, (orig_ptr, orig_size, alignment, new_size)) + .call( + store.as_context_mut(), + (orig_ptr, orig_size, alignment, new_size), + ) .map_err(Into::into) } diff --git a/crates/cli/tests/dynamic_linking_test.rs b/crates/cli/tests/dynamic_linking_test.rs index cd5a0d27..cd2dc340 100644 --- a/crates/cli/tests/dynamic_linking_test.rs +++ b/crates/cli/tests/dynamic_linking_test.rs @@ -7,7 +7,7 @@ use uuid::Uuid; use wasi_common::pipe::{ReadPipe, WritePipe}; use wasi_common::sync::WasiCtxBuilder; use wasi_common::WasiCtx; -use wasmtime::{Config, Engine, ExternType, Linker, Module, Store}; +use wasmtime::{AsContextMut, Config, Engine, ExternType, Linker, Module, Store}; mod common; @@ -223,15 +223,16 @@ fn invoke_fn_on_generated_module( let quickjs_provider_module = common::create_quickjs_provider_module(&engine)?; let js_module = Module::from_binary(&engine, &js_wasm)?; - let quickjs_provider_instance = linker.instantiate(&mut store, &quickjs_provider_module)?; + let quickjs_provider_instance = + linker.instantiate(store.as_context_mut(), &quickjs_provider_module)?; linker.instance( - &mut store, + store.as_context_mut(), "javy_quickjs_provider_v2", quickjs_provider_instance, )?; - let js_instance = linker.instantiate(&mut store, &js_module)?; - let func = js_instance.get_typed_func::<(), ()>(&mut store, func)?; - func.call(&mut store, ())?; + let js_instance = linker.instantiate(store.as_context_mut(), &js_module)?; + let func = js_instance.get_typed_func::<(), ()>(store.as_context_mut(), func)?; + func.call(store.as_context_mut(), ())?; drop(store); // Need to drop store to access contents of stderr. let log_output = stderr.try_into_inner().unwrap().into_inner(); diff --git a/crates/javy/src/alloc.rs b/crates/javy/src/alloc.rs index 706e8b13..ee6c23ad 100644 --- a/crates/javy/src/alloc.rs +++ b/crates/javy/src/alloc.rs @@ -18,8 +18,8 @@ const ZERO_SIZE_ALLOCATION_PTR: *mut u8 = 1 as _; /// /// 1. Allocate memory of new_size with alignment. /// 2. If original_ptr != 0. -/// a. copy min(new_size, original_size) bytes from original_ptr to new memory. -/// b. de-allocate original_ptr. +/// a. copy min(new_size, original_size) bytes from original_ptr to new memory. +/// b. de-allocate original_ptr. /// 3. Return new memory ptr. /// /// # Safety diff --git a/crates/javy/tests/misc.rs b/crates/javy/tests/misc.rs index 8f4dd5a9..b359c6ab 100644 --- a/crates/javy/tests/misc.rs +++ b/crates/javy/tests/misc.rs @@ -1,4 +1,6 @@ +#[cfg(feature = "json")] use anyhow::Result; +#[cfg(feature = "json")] use javy::{quickjs::context::EvalOptions, Config, Runtime}; #[cfg(feature = "json")] diff --git a/fuzz/fuzz_targets/json_differential.rs b/fuzz/fuzz_targets/json_differential.rs index d71a7fd3..04e6f955 100644 --- a/fuzz/fuzz_targets/json_differential.rs +++ b/fuzz/fuzz_targets/json_differential.rs @@ -48,7 +48,8 @@ fn exec(data: &ArbitraryValue) -> Result<()> { panic!("{}\n{}", from_js_error(cx.clone(), e), **data,); } - output = globals.get("OUTPUT")?; + let result: String = globals.get("OUTPUT")?; + output = serde_json::from_str(&result).ok(); Ok::<(), Error>(()) })?; @@ -63,7 +64,8 @@ fn exec(data: &ArbitraryValue) -> Result<()> { panic!("{}\n{}", from_js_error(cx.clone(), e), **data); } - ref_output = globals.get("OUTPUT")?; + let result: String = globals.get("OUTPUT")?; + ref_output = serde_json::from_str(&result).ok(); Ok::<(), Error>(()) })?; diff --git a/supply-chain/config.toml b/supply-chain/config.toml index a9d54faa..04d3861d 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -28,12 +28,6 @@ audit-as-crates-io = false [policy.javy-apis] audit-as-crates-io = false -[policy.quickjs-wasm-rs] -audit-as-crates-io = false - -[policy.quickjs-wasm-sys] -audit-as-crates-io = false - [[exemptions.Inflector]] version = "0.11.4" criteria = "safe-to-deploy" @@ -42,10 +36,6 @@ criteria = "safe-to-deploy" version = "0.19.0" criteria = "safe-to-deploy" -[[exemptions.addr2line]] -version = "0.22.0" -criteria = "safe-to-deploy" - [[exemptions.ahash]] version = "0.8.11" criteria = "safe-to-deploy" @@ -110,10 +100,6 @@ criteria = "safe-to-deploy" version = "4.0.1" criteria = "safe-to-deploy" -[[exemptions.bumpalo]] -version = "3.16.0" -criteria = "safe-to-deploy" - [[exemptions.bytes]] version = "1.6.0" criteria = "safe-to-deploy" @@ -158,10 +144,6 @@ criteria = "safe-to-deploy" version = "0.2.12" criteria = "safe-to-deploy" -[[exemptions.crc32fast]] -version = "1.4.2" -criteria = "safe-to-deploy" - [[exemptions.criterion]] version = "0.3.6" criteria = "safe-to-run" @@ -218,10 +200,6 @@ criteria = "safe-to-deploy" version = "0.2.0" criteria = "safe-to-deploy" -[[exemptions.fastrand]] -version = "2.1.0" -criteria = "safe-to-deploy" - [[exemptions.float-cmp]] version = "0.9.0" criteria = "safe-to-deploy" @@ -402,18 +380,10 @@ criteria = "safe-to-deploy" version = "0.2.1" criteria = "safe-to-deploy" -[[exemptions.miniz_oxide]] -version = "0.7.4" -criteria = "safe-to-deploy" - [[exemptions.mio]] version = "0.8.11" criteria = "safe-to-deploy" -[[exemptions.native-tls]] -version = "0.2.12" -criteria = "safe-to-deploy" - [[exemptions.new_debug_unreachable]] version = "1.0.6" criteria = "safe-to-deploy" @@ -442,14 +412,6 @@ criteria = "safe-to-deploy" version = "11.1.4" criteria = "safe-to-run" -[[exemptions.openssl]] -version = "0.10.64" -criteria = "safe-to-deploy" - -[[exemptions.openssl-sys]] -version = "0.9.102" -criteria = "safe-to-deploy" - [[exemptions.outref]] version = "0.1.0" criteria = "safe-to-deploy" @@ -470,18 +432,6 @@ criteria = "safe-to-deploy" version = "0.10.0" criteria = "safe-to-deploy" -[[exemptions.pin-project]] -version = "1.1.5" -criteria = "safe-to-deploy" - -[[exemptions.pin-project-internal]] -version = "1.1.5" -criteria = "safe-to-deploy" - -[[exemptions.pin-project-lite]] -version = "0.2.14" -criteria = "safe-to-deploy" - [[exemptions.pkg-config]] version = "0.3.30" criteria = "safe-to-deploy" @@ -562,10 +512,6 @@ criteria = "safe-to-deploy" version = "0.6.1" criteria = "safe-to-deploy" -[[exemptions.rustc-demangle]] -version = "0.1.24" -criteria = "safe-to-deploy" - [[exemptions.rustc_version]] version = "0.2.3" criteria = "safe-to-deploy" @@ -574,22 +520,10 @@ criteria = "safe-to-deploy" version = "1.0.1" criteria = "safe-to-deploy" -[[exemptions.schannel]] -version = "0.1.23" -criteria = "safe-to-deploy" - [[exemptions.scoped-tls]] version = "1.0.1" criteria = "safe-to-deploy" -[[exemptions.security-framework]] -version = "2.11.0" -criteria = "safe-to-deploy" - -[[exemptions.security-framework-sys]] -version = "2.11.0" -criteria = "safe-to-deploy" - [[exemptions.semver]] version = "0.9.0" criteria = "safe-to-deploy" @@ -718,26 +652,10 @@ criteria = "safe-to-deploy" version = "3.10.1" criteria = "safe-to-deploy" -[[exemptions.tinyvec]] -version = "1.8.0" -criteria = "safe-to-deploy" - [[exemptions.tinyvec_macros]] version = "0.1.1" criteria = "safe-to-deploy" -[[exemptions.tower]] -version = "0.4.13" -criteria = "safe-to-deploy" - -[[exemptions.tower-layer]] -version = "0.3.2" -criteria = "safe-to-deploy" - -[[exemptions.tower-service]] -version = "0.3.2" -criteria = "safe-to-deploy" - [[exemptions.tracing]] version = "0.1.40" criteria = "safe-to-deploy" @@ -754,10 +672,6 @@ criteria = "safe-to-deploy" version = "0.1.13" criteria = "safe-to-deploy" -[[exemptions.try-lock]] -version = "0.2.5" -criteria = "safe-to-deploy" - [[exemptions.typed-arena]] version = "2.0.2" criteria = "safe-to-deploy" @@ -806,10 +720,6 @@ criteria = "safe-to-deploy" version = "0.19.0" criteria = "safe-to-deploy" -[[exemptions.want]] -version = "0.3.1" -criteria = "safe-to-deploy" - [[exemptions.wasi]] version = "0.11.0+wasi-snapshot-preview1" criteria = "safe-to-deploy" @@ -866,10 +776,6 @@ criteria = "safe-to-deploy" version = "0.7.35" criteria = "safe-to-deploy" -[[exemptions.zerovec]] -version = "0.10.4" -criteria = "safe-to-deploy" - [[exemptions.zstd]] version = "0.13.2" criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 8c6ce1dc..039c3a43 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -64,6 +64,13 @@ user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" +[[publisher.bumpalo]] +version = "3.16.0" +when = "2024-04-08" +user-id = 696 +user-login = "fitzgen" +user-name = "Nick Fitzgerald" + [[publisher.byteorder]] version = "1.5.0" when = "2023-10-06" @@ -155,13 +162,6 @@ user-id = 6743 user-login = "epage" user-name = "Ed Page" -[[publisher.core-foundation]] -version = "0.9.3" -when = "2022-02-07" -user-id = 5946 -user-login = "jrmuizel" -user-name = "Jeff Muizelaar" - [[publisher.core-foundation-sys]] version = "0.8.4" when = "2023-04-03" @@ -299,48 +299,6 @@ user-id = 2915 user-login = "Amanieu" user-name = "Amanieu d'Antras" -[[publisher.http]] -version = "1.1.0" -when = "2024-03-04" -user-id = 359 -user-login = "seanmonstar" -user-name = "Sean McArthur" - -[[publisher.http-body-util]] -version = "0.1.2" -when = "2024-06-10" -user-id = 359 -user-login = "seanmonstar" -user-name = "Sean McArthur" - -[[publisher.httparse]] -version = "1.9.4" -when = "2024-06-17" -user-id = 359 -user-login = "seanmonstar" -user-name = "Sean McArthur" - -[[publisher.hyper]] -version = "1.4.0" -when = "2024-07-01" -user-id = 359 -user-login = "seanmonstar" -user-name = "Sean McArthur" - -[[publisher.hyper-tls]] -version = "0.6.0" -when = "2023-11-27" -user-id = 359 -user-login = "seanmonstar" -user-name = "Sean McArthur" - -[[publisher.hyper-util]] -version = "0.1.6" -when = "2024-07-01" -user-id = 359 -user-login = "seanmonstar" -user-name = "Sean McArthur" - [[publisher.io-extras]] version = "0.18.2" when = "2024-03-29" @@ -523,13 +481,6 @@ user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" -[[publisher.serde_bytes]] -version = "0.11.15" -when = "2024-06-25" -user-id = 3618 -user-login = "dtolnay" -user-name = "David Tolnay" - [[publisher.serde_derive]] version = "1.0.204" when = "2024-07-06" @@ -614,13 +565,6 @@ user-id = 10 user-login = "carllerche" user-name = "Carl Lerche" -[[publisher.tokio-macros]] -version = "2.3.0" -when = "2024-05-30" -user-id = 10 -user-login = "carllerche" -user-name = "Carl Lerche" - [[publisher.toml]] version = "0.8.14" when = "2024-06-03" @@ -1122,15 +1066,22 @@ who = "Nick Fitzgerald " criteria = "safe-to-deploy" user-id = 696 # Nick Fitzgerald (fitzgen) start = "2020-01-14" -end = "2024-04-21" +end = "2025-07-30" notes = "I am an author of this crate." +[[audits.bytecode-alliance.wildcard-audits.bumpalo]] +who = "Nick Fitzgerald " +criteria = "safe-to-deploy" +user-id = 696 # Nick Fitzgerald (fitzgen) +start = "2019-03-16" +end = "2025-07-30" + [[audits.bytecode-alliance.wildcard-audits.cranelift-bforest]] who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-codegen]] @@ -1138,7 +1089,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-codegen-meta]] @@ -1146,7 +1097,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-codegen-shared]] @@ -1154,7 +1105,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-control]] @@ -1162,7 +1113,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2023-05-22" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-entity]] @@ -1170,7 +1121,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-frontend]] @@ -1178,7 +1129,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-isle]] @@ -1186,7 +1137,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-12-13" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-native]] @@ -1194,7 +1145,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.cranelift-wasm]] @@ -1202,7 +1153,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.regalloc2]] @@ -1210,7 +1161,7 @@ who = "Chris Fallin " criteria = "safe-to-deploy" user-id = 3726 # Chris Fallin (cfallin) start = "2021-12-03" -end = "2024-05-02" +end = "2025-07-30" notes = "We (Bytecode Alliance) are the primary authors of regalloc2 and co-develop it with Cranelift/Wasmtime, with the same code-review, testing/fuzzing, and security standards." [[audits.bytecode-alliance.wildcard-audits.wasi-common]] @@ -1218,7 +1169,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasm-encoder]] @@ -1226,7 +1177,7 @@ who = "Alex Crichton " criteria = "safe-to-deploy" user-id = 1 # Alex Crichton (alexcrichton) start = "2020-12-11" -end = "2024-04-14" +end = "2025-07-30" notes = """ This is a Bytecode Alliance authored crate maintained in the `wasm-tools` repository of which I'm one of the primary maintainers and publishers for. @@ -1251,7 +1202,7 @@ who = "Alex Crichton " criteria = "safe-to-deploy" user-id = 1 # Alex Crichton (alexcrichton) start = "2020-07-13" -end = "2024-04-14" +end = "2025-07-30" notes = """ This is a Bytecode Alliance authored crate maintained in the `wasm-tools` repository of which I'm one of the primary maintainers and publishers for. @@ -1288,7 +1239,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-asm-macros]] @@ -1296,7 +1247,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-08-22" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-cache]] @@ -1304,7 +1255,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-component-macro]] @@ -1312,7 +1263,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-07-20" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-component-util]] @@ -1320,7 +1271,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-08-22" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-cranelift]] @@ -1328,7 +1279,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-cranelift-shared]] @@ -1336,7 +1287,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2023-04-20" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-environ]] @@ -1344,7 +1295,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-fiber]] @@ -1352,7 +1303,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-jit-debug]] @@ -1360,7 +1311,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-03-07" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-jit-icache-coherence]] @@ -1368,7 +1319,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-11-21" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-runtime]] @@ -1376,7 +1327,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-types]] @@ -1384,7 +1335,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-wasi]] @@ -1392,7 +1343,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-winch]] @@ -1400,7 +1351,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-11-21" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-wit-bindgen]] @@ -1408,7 +1359,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2023-01-20" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wasmtime-wmemcheck]] @@ -1416,7 +1367,7 @@ who = "Pat Hickey " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-11-27" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wast]] @@ -1448,7 +1399,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wiggle-generate]] @@ -1456,7 +1407,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wiggle-macro]] @@ -1464,7 +1415,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2021-10-29" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.winch-codegen]] @@ -1472,7 +1423,7 @@ who = "Bobby Holley " criteria = "safe-to-deploy" user-id = 73222 # wasmtime-publish start = "2022-11-21" -end = "2024-06-26" +end = "2025-07-30" notes = "The Bytecode Alliance is the author of this crate." [[audits.bytecode-alliance.wildcard-audits.wit-parser]] @@ -1499,6 +1450,11 @@ criteria = "safe-to-deploy" delta = "0.20.0 -> 0.21.0" notes = "This version bump updated some dependencies and optimized some internals. All looks good." +[[audits.bytecode-alliance.audits.addr2line]] +who = "Alex Crichton " +criteria = "safe-to-deploy" +delta = "0.21.0 -> 0.22.0" + [[audits.bytecode-alliance.audits.adler]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -1586,16 +1542,14 @@ this crate has to do with iterators and `Result` and such. No `unsafe` or anything like that, all looks good. """ -[[audits.bytecode-alliance.audits.foreign-types]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.3.2" -notes = "This crate defined a macro-rules which creates wrappers working with FFI types. The implementation of this crate appears to be safe, but each use of this macro would need to be vetted for correctness as well." - -[[audits.bytecode-alliance.audits.foreign-types-shared]] -who = "Pat Hickey " +[[audits.bytecode-alliance.audits.fastrand]] +who = "Alex Crichton " criteria = "safe-to-deploy" -version = "0.1.1" +delta = "2.0.0 -> 2.0.1" +notes = """ +This update had a few doc updates but no otherwise-substantial source code +updates. +""" [[audits.bytecode-alliance.audits.fxprof-processed-profile]] who = "Jamey Sharp " @@ -1626,17 +1580,6 @@ criteria = "safe-to-deploy" delta = "0.4.1 -> 0.5.0" notes = "Minor changes for a `no_std` upgrade but otherwise everything looks as expected." -[[audits.bytecode-alliance.audits.http-body]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "1.0.0-rc.2" - -[[audits.bytecode-alliance.audits.http-body]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -delta = "1.0.0-rc.2 -> 1.0.0" -notes = "Only minor changes made for a stable release." - [[audits.bytecode-alliance.audits.iana-time-zone-haiku]] who = "Dan Gohman " criteria = "safe-to-deploy" @@ -1715,17 +1658,6 @@ criteria = "safe-to-deploy" delta = "0.6.3 -> 0.6.4" notes = "This commit only updated the dependency `rustix`, so same as before." -[[audits.bytecode-alliance.audits.openssl-macros]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.1.0" - -[[audits.bytecode-alliance.audits.openssl-probe]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.1.5" -notes = "IO is only checking for the existence of paths in the filesystem" - [[audits.bytecode-alliance.audits.percent-encoding]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -1736,11 +1668,28 @@ a few `unsafe` blocks related to utf-8 validation which are locally verifiable as correct and otherwise this crate is good to go. """ +[[audits.bytecode-alliance.audits.pin-project-lite]] +who = "Alex Crichton " +criteria = "safe-to-deploy" +delta = "0.2.13 -> 0.2.14" +notes = "No substantive changes in this update" + [[audits.bytecode-alliance.audits.pin-utils]] who = "Pat Hickey " criteria = "safe-to-deploy" version = "0.1.0" +[[audits.bytecode-alliance.audits.rustc-demangle]] +who = "Alex Crichton " +criteria = "safe-to-deploy" +version = "0.1.21" +notes = "I am the author of this crate." + +[[audits.bytecode-alliance.audits.rustc-demangle]] +who = "Alex Crichton " +criteria = "safe-to-deploy" +delta = "0.1.21 -> 0.1.24" + [[audits.bytecode-alliance.audits.slice-group-by]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -1767,11 +1716,15 @@ criteria = "safe-to-deploy" version = "1.1.0" notes = "No dependencies and completely a compile-time crate as advertised. Uses `unsafe` in one module as a compile-time check only: `mem::transmute` and `ptr::write` are wrapped in an impossible-to-run closure." -[[audits.bytecode-alliance.audits.tokio-native-tls]] -who = "Pat Hickey " +[[audits.bytecode-alliance.audits.tinyvec]] +who = "Alex Crichton " criteria = "safe-to-deploy" -version = "0.3.1" -notes = "unsafety is used for smuggling std::task::Context as a raw pointer. Lifetime and type safety appears to be taken care of correctly." +version = "1.6.0" +notes = """ +This crate, while it implements collections, does so without `std::*` APIs and +without `unsafe`. Skimming the crate everything looks reasonable and what one +would expect from idiomatic safe collections in Rust. +""" [[audits.bytecode-alliance.audits.unicode-bidi]] who = "Alex Crichton " @@ -1782,12 +1735,6 @@ This crate has no unsafe code and does not use `std::*`. Skimming the crate it does not attempt to out of the bounds of what it's already supposed to be doing. """ -[[audits.bytecode-alliance.audits.vcpkg]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.2.15" -notes = "no build.rs, no macros, no unsafe. It reads the filesystem and makes copies of DLLs into OUT_DIR." - [[audits.bytecode-alliance.audits.wast]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -1880,6 +1827,28 @@ criteria = "safe-to-run" version = "0.3.0" aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" +[[audits.google.audits.crc32fast]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +version = "1.4.2" +notes = """ +Security review of earlier versions of the crate can be found at +(Google-internal, sorry): go/image-crate-chromium-security-review + +Audit comments for 1.4.2 can be found at https://crrev.com/c/4723145. +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.fastrand]] +who = "George Burgess IV " +criteria = "safe-to-deploy" +version = "1.9.0" +notes = """ +`does-not-implement-crypto` is certified because this crate explicitly says +that the RNG here is not cryptographically secure. +""" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + [[audits.google.audits.getrandom]] who = "David Koloski " criteria = "safe-to-deploy" @@ -1943,6 +1912,22 @@ are made about the safety of either of those libraries. :) """ aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" +[[audits.google.audits.miniz_oxide]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +version = "0.7.4" +notes = ''' +Grepped for `-i cipher`, `-i crypto`, `'\bfs\b'`, `'\bnet\b'`, `'\bunsafe\b'` +and there were no hits, except for some mentions of "unsafe" in the `README.md` +and in a comment in `src/deflate/core.rs`. The comment discusses whether a +function should be treated as unsafe, but there is no actual `unsafe` code, so +the crate meets the `ub-risk-0` criteria. + +Note that some additional, internal notes about an older version of this crate +can be found at go/image-crate-chromium-security-review. +''' +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + [[audits.google.audits.nom]] who = "danakj@chromium.org" criteria = "safe-to-deploy" @@ -1952,11 +1937,19 @@ Reviewed in https://chromium-review.googlesource.com/c/chromium/src/+/5046153 """ aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" -[[audits.google.audits.openssl-macros]] -who = "George Burgess IV " +[[audits.google.audits.pin-project-lite]] +who = "David Koloski " criteria = "safe-to-deploy" -delta = "0.1.0 -> 0.1.1" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" +version = "0.2.9" +notes = "Reviewed on https://fxrev.dev/824504" +aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.pin-project-lite]] +who = "David Koloski " +criteria = "safe-to-deploy" +delta = "0.2.9 -> 0.2.13" +notes = "Audited at https://fxrev.dev/946396" +aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT" [[audits.google.audits.proc-macro-error-attr]] who = "George Burgess IV " @@ -1977,6 +1970,24 @@ criteria = "safe-to-run" version = "1.2.1" aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" +[[audits.google.audits.tinyvec]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "1.6.0 -> 1.6.1" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.tinyvec]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "1.6.1 -> 1.7.0" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.tinyvec]] +who = "Dustin J. Mitchell " +criteria = "safe-to-deploy" +delta = "1.7.0 -> 1.8.0" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + [[audits.google.audits.version_check]] who = "George Burgess IV " criteria = "safe-to-deploy" @@ -2052,16 +2063,6 @@ end = "2024-04-21" notes = "No unsafe code, rather straight-forward parser." aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.wildcard-audits.core-foundation]] -who = "Bobby Holley " -criteria = "safe-to-deploy" -user-id = 5946 # Jeff Muizelaar (jrmuizel) -start = "2019-03-29" -end = "2023-05-04" -renew = false -notes = "I've reviewed every source contribution that was neither authored nor reviewed by Mozilla." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - [[audits.mozilla.wildcard-audits.core-foundation-sys]] who = "Bobby Holley " criteria = "safe-to-deploy" @@ -2176,13 +2177,6 @@ criteria = "safe-to-deploy" delta = "0.69.2 -> 0.69.4" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.core-foundation]] -who = "Teodor Tanasoaia " -criteria = "safe-to-deploy" -delta = "0.9.3 -> 0.9.4" -notes = "I've reviewed every source contribution that was neither authored nor reviewed by Mozilla." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - [[audits.mozilla.audits.crypto-common]] who = "Mike Hommey " criteria = "safe-to-deploy" @@ -2196,6 +2190,18 @@ version = "0.8.0" notes = "This crates was written by Sentry and I've fully audited it as Firefox crash reporting machinery relies on it." aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.fastrand]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "1.9.0 -> 2.0.0" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.fastrand]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "2.0.1 -> 2.1.0" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.fnv]] who = "Bobby Holley " criteria = "safe-to-deploy" @@ -2315,12 +2321,6 @@ criteria = "safe-to-deploy" delta = "0.5.5 -> 0.5.7" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.tinystr]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.7.4 -> 0.7.6" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - [[audits.mozilla.audits.unicode-bidi]] who = "Makoto Kato " criteria = "safe-to-deploy" @@ -2339,97 +2339,3 @@ who = "Jonathan Kew " criteria = "safe-to-deploy" delta = "0.3.14 -> 0.3.15" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.writeable]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -version = "0.5.2" -notes = "writeable is a variation of fmt::Write with sink version. This uses `unsafe` block to handle potentially-invalid UTF-8 character. I've vetted the one instance of unsafe code." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.writeable]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.5.2 -> 0.5.4" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.writeable]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.5.4 -> 0.5.5" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.yoke]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -version = "0.7.1" -notes = "This crate is for zero-copy serialization for ICU4X data structure, and maintained by ICU4X team. Since this uses unsafe block for serialization, I audited code." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.yoke]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.7.1 -> 0.7.3" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.yoke]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.7.3 -> 0.7.4" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.yoke-derive]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -version = "0.7.3" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.yoke-derive]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.7.3 -> 0.7.4" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.zerofrom]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -version = "0.1.2" -notes = "This crate is zero-copy version of \"From\". This has no unsafe code and uses no ambient capabilities." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.zerofrom]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.1.2 -> 0.1.4" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.zerovec]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -version = "0.9.4" -notes = "This crate is zero-copy data structure implmentation. Although this uses unsafe block in several code, it requires for zero-copy. And this has a comment in code why this uses unsafe and I audited code." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.zerovec]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.9.4 -> 0.10.1" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.zerovec]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.10.1 -> 0.10.2" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.zerovec-derive]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -version = "0.10.1" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.zerovec-derive]] -who = "Makoto Kato " -criteria = "safe-to-deploy" -delta = "0.10.1 -> 0.10.2" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"