From 235b5a670fe1c49c667e5dbb7e43082bc8ca622a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Cabrera?= Date: Thu, 2 May 2024 07:17:00 -0400 Subject: [PATCH] Switch to `rquickjs` (#618) * chore: Initial migration to rquickjs * More progress on migration: Migrated the `Console` and `Random` APIs; got to the `StreamIO` API. * Migrate all of the APIs to use rquickjs This commit migrates the `console`, `stream_io`, `random` and `text_encoding` APIs to use rquickjs. One notable change in this commit is the introduction of the `Args` struct to tie the lifetime of `Ctx<'js>` and `Rest>` arguments, given that explicit lifetime binding is not possible in Rust closures at the moment. * Finalize migration of the toolchain as a whole * Uncomment integration tests * Throw `TypeError` when `fatal` decoding is specified. * Fix clippy errors * Update documentation where applicable and remove reference to older crates * Handle converting from JS strings to Rust strings for text encoding * Migrate serializers and deserializers to use rquickjs and move them under the javy crate * Move quickcheck to the top level Cargo.toml `cargo` doesn't seem to pickup the fact that `quickcheck` is only used in tests. * Update versions and CHANGELOGs * Audit dependencies And prune unused ones * Improve safety comment * Port previous implementation of read sync I wanted to avoid as much as possible using the underlying QuickJS unsafe APIs, but that introduced behavioral changes and bugs. So for now, I'm sticking to the previous implementation. * Review comments * Improve comment for why `ManuallyDrop` * Use `ManuallyDrop` for Context * Format comments where applicable * Use rquickjs 0.6.0 through a fork This commit introduces rquickjs 0.6.0 through a fork that contains Wasm specific performance improvements. We intend to upstream these improvements. * Cargo vet config Adds special policy for rquickjs given that we're currently in a fork. * Remove comment, cargo vet doesn't like them --- Cargo.lock | 1357 ++++++++++++++------------ Cargo.toml | 2 +- Makefile | 5 +- crates/apis/CHANGELOG.md | 5 + crates/apis/Cargo.toml | 2 +- crates/apis/README.md | 15 +- crates/apis/src/console/mod.rs | 150 +-- crates/apis/src/random/mod.rs | 47 +- crates/apis/src/runtime_ext.rs | 1 + crates/apis/src/stream_io/mod.rs | 210 ++-- crates/apis/src/text_encoding/mod.rs | 191 ++-- crates/cli/tests/dylib_test.rs | 2 +- crates/cli/tests/integration_test.rs | 18 +- crates/core/src/execution.rs | 80 +- crates/core/src/lib.rs | 21 +- crates/core/src/main.rs | 12 +- crates/javy/CHANGELOG.md | 5 + crates/javy/Cargo.toml | 8 +- crates/javy/README.md | 48 +- crates/javy/src/json.rs | 16 +- crates/javy/src/lib.rs | 201 +++- crates/javy/src/messagepack.rs | 9 +- crates/javy/src/runtime.rs | 105 +- crates/javy/src/serde/de.rs | 428 ++++++++ crates/javy/src/serde/err.rs | 23 + crates/javy/src/serde/mod.rs | 304 ++++++ crates/javy/src/serde/ser.rs | 704 +++++++++++++ supply-chain/audits.toml | 12 + supply-chain/config.toml | 304 ++++-- supply-chain/imports.lock | 958 ++++++++---------- 30 files changed, 3622 insertions(+), 1621 deletions(-) create mode 100644 crates/javy/src/serde/de.rs create mode 100644 crates/javy/src/serde/err.rs create mode 100644 crates/javy/src/serde/mod.rs create mode 100644 crates/javy/src/serde/ser.rs diff --git a/Cargo.lock b/Cargo.lock index 87feac94..cfb8a5c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -18,7 +18,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli 0.28.0", + "gimli 0.28.1", ] [[package]] @@ -29,20 +29,21 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.3" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", "version_check", + "zerocopy", ] [[package]] name = "aho-corasick" -version = "0.7.18" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -94,15 +95,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "arbitrary" @@ -112,9 +113,9 @@ checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] name = "arrayvec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "ast_node" @@ -125,18 +126,18 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -152,15 +153,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -173,9 +174,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.0" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64-simd" @@ -210,10 +211,10 @@ version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "cexpr", "clang-sys", - "itertools", + "itertools 0.12.1", "lazy_static", "lazycell", "log", @@ -223,7 +224,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.46", + "syn 2.0.58", "which", ] @@ -235,9 +236,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "bitvec" @@ -273,9 +274,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -283,21 +284,30 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" + +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] [[package]] name = "cap-fs-ext" @@ -307,7 +317,7 @@ checksum = "88e341d15ac1029aadce600be764a1a1edafe40e03cde23285bc1d261b3a4866" dependencies = [ "cap-primitives", "cap-std", - "io-lifetimes 2.0.3", + "io-lifetimes", "windows-sys 0.52.0", ] @@ -319,7 +329,7 @@ checksum = "434168fe6533055f0f4204039abe3ff6d7db338ef46872a5fa39e9d5ad5ab7a9" dependencies = [ "cap-primitives", "cap-std", - "rustix 0.38.31", + "rustix", "smallvec", ] @@ -332,10 +342,10 @@ dependencies = [ "ambient-authority", "fs-set-times", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "ipnet", "maybe-owned", - "rustix 0.38.31", + "rustix", "windows-sys 0.52.0", "winx", ] @@ -358,8 +368,8 @@ checksum = "593db20e4c51f62d3284bae7ee718849c3214f93a3b94ea1899ad85ba119d330" dependencies = [ "cap-primitives", "io-extras", - "io-lifetimes 2.0.3", - "rustix 0.38.31", + "io-lifetimes", + "rustix", ] [[package]] @@ -372,10 +382,33 @@ dependencies = [ "cap-primitives", "iana-time-zone", "once_cell", - "rustix 0.38.31", + "rustix", "winx", ] +[[package]] +name = "cargo-platform" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.22", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cast" version = "0.3.0" @@ -384,9 +417,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.0.90" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" dependencies = [ "jobserver", "libc", @@ -409,9 +442,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "ciborium" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "effd91f6c78e5a4ace8a5d3c0b6bfaec9e2baaef55f3efc00e45fb2e477ee926" +checksum = "42e69ffd6f0917f5c029256a24d0161db17cea3997d185db0d35926308770f0e" dependencies = [ "ciborium-io", "ciborium-ll", @@ -420,15 +453,15 @@ dependencies = [ [[package]] name = "ciborium-io" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf919175532b369853f5d5e20b26b43112613fd6fe7aee757e35f7a44642656" +checksum = "05afea1e0a06c9be33d539b876f1ce3692f4afea2cb41f740e7743225ed1c757" [[package]] name = "ciborium-ll" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defaa24ecc093c77630e6c15e17c51f5e187bf35ee514f4e2d67baaa96dae22b" +checksum = "57663b653d948a338bfb3eeba9bb2fd5fcfaecb9e199e87e1eda4d9e8b240fd9" dependencies = [ "ciborium-io", "half", @@ -436,9 +469,9 @@ dependencies = [ [[package]] name = "clang-sys" -version = "1.3.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cc00842eed744b858222c4c9faf7243aafc6d33f92f96935263ef4d8a41ce21" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", @@ -462,18 +495,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.4.7" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstyle", "clap_lex", @@ -481,9 +514,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "codespan-reporting" @@ -506,9 +539,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -516,9 +549,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpp_demangle" @@ -531,9 +564,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.1" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -560,8 +593,8 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli 0.28.0", - "hashbrown 0.14.1", + "gimli 0.28.1", + "hashbrown 0.14.3", "log", "regalloc2", "smallvec", @@ -640,18 +673,18 @@ dependencies = [ "cranelift-codegen", "cranelift-entity", "cranelift-frontend", - "itertools", + "itertools 0.10.5", "log", "smallvec", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-types", ] [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -665,10 +698,10 @@ dependencies = [ "anes", "cast", "ciborium", - "clap 4.4.7", + "clap 4.5.4", "criterion-plot", "is-terminal", - "itertools", + "itertools 0.10.5", "num-traits", "once_cell", "oorandom", @@ -689,52 +722,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" dependencies = [ "cast", - "itertools", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" -dependencies = [ - "cfg-if", - "crossbeam-utils", + "itertools 0.10.5", ] [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.7" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "cfg-if", "crossbeam-utils", - "lazy_static", - "memoffset 0.6.5", - "scopeguard", ] [[package]] name = "crossbeam-utils" -version = "0.8.7" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" -dependencies = [ - "cfg-if", - "lazy_static", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" [[package]] name = "crypto-common" @@ -748,9 +768,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.115" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de00f15a6fa069c99b88c5c78c4541d0e7899a33b86f7480e23df2431fce0bc" +checksum = "21db378d04296a84d8b7d047c36bb3954f0b46529db725d7e62fb02f9ba53ccc" dependencies = [ "cc", "cxxbridge-flags", @@ -760,9 +780,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.115" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a71e1e631fa2f2f5f92e8b0d860a00c198c6771623a6cefcc863e3554f0d8d6" +checksum = "3e5262a7fa3f0bae2a55b767c223ba98032d7c328f5c13fa5cdc980b77fc0658" dependencies = [ "cc", "codespan-reporting", @@ -770,31 +790,31 @@ dependencies = [ "proc-macro2", "quote", "scratch", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] name = "cxxbridge-flags" -version = "1.0.115" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3fed61d56ba497c4efef9144dfdbaa25aa58f2f6b3a7cf441d4591c583745c" +checksum = "be8dcadd2e2fb4a501e1d9e93d6e88e6ea494306d8272069c92d5a9edf8855c0" [[package]] name = "cxxbridge-macro" -version = "1.0.115" +version = "1.0.121" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8908e380a8efd42150c017b0cfa31509fc49b6d47f7cb6b33e93ffb8f4e3661e" +checksum = "ad08a837629ad949b73d032c637653d069e909cffe4ee7870b02301939ce39cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "debugid" @@ -808,9 +828,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", @@ -827,13 +847,23 @@ dependencies = [ ] [[package]] -name = "dirs-next" -version = "2.0.0" +name = "dirs" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ - "cfg-if", - "dirs-sys-next", + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +dependencies = [ + "libc", + "redox_users", + "winapi", ] [[package]] @@ -849,15 +879,15 @@ dependencies = [ [[package]] name = "either" -version = "1.6.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -913,7 +943,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e5768da2206272c81ef0b5e951a41862938a6070da63bcea197899942d3b947" dependencies = [ "cfg-if", - "rustix 0.38.31", + "rustix", "windows-sys 0.52.0", ] @@ -940,9 +970,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -955,7 +985,7 @@ checksum = "3a0b11eeb173ce52f84ebd943d42e58813a2ebb78a6a3ff0a243b71c5199cd7b" dependencies = [ "proc-macro2", "swc_macros_common", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -964,8 +994,8 @@ version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "033b337d725b97690d86893f9de22b67b80dcc4e9ad815f348254c38119db8fb" dependencies = [ - "io-lifetimes 2.0.3", - "rustix 0.38.31", + "io-lifetimes", + "rustix", "windows-sys 0.52.0", ] @@ -1051,7 +1081,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27d12c0aed7f1e24276a241aadc4cb8ea9f83000f34bc062b7cc2d51e3b0fabd" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "debugid", "fxhash", "serde", @@ -1060,9 +1090,9 @@ dependencies = [ [[package]] name = "generic-array" -version = "0.14.5" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ "typenum", "version_check", @@ -1070,13 +1100,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.5" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -1092,26 +1122,30 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator 0.3.0", - "indexmap 2.0.2", + "indexmap 2.2.6", "stable_deref_trait", ] [[package]] name = "glob" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "half" -version = "1.8.2" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" +checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +dependencies = [ + "cfg-if", + "crunchy", +] [[package]] name = "hashbrown" @@ -1130,9 +1164,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" dependencies = [ "ahash", ] @@ -1163,28 +1197,38 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + +[[package]] +name = "home" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] [[package]] name = "hstr" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de90d3db62411eb62eddabe402d706ac4970f7ac8d088c05f11069cad9be9857" +checksum = "5a9de2bdef6354361892492bab5e316b2d78a0ee9971db4d36da9b1eb0e11999" dependencies = [ + "hashbrown 0.14.3", "new_debug_unreachable", "once_cell", "phf", "rustc-hash", - "smallvec", + "triomphe", ] [[package]] name = "http" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32afd38673a8016f7c9ae69e5af41a58f81b1d31689040f2f1959594ce194ea" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" dependencies = [ "bytes", "fnv", @@ -1222,9 +1266,9 @@ checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "hyper" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5aa53871fc917b1a9ed87b683a5d86db645e23acb32c2e0785a353e522fb75" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" dependencies = [ "bytes", "futures-channel", @@ -1234,6 +1278,7 @@ dependencies = [ "httparse", "itoa", "pin-project-lite", + "smallvec", "tokio", "want", ] @@ -1276,9 +1321,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1303,11 +1348,17 @@ version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25a2bc672d1148e28034f176e01fffebb08b35768468cc954630da77a1449005" +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + [[package]] name = "idna" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1331,36 +1382,25 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.3", "serde", ] [[package]] name = "io-extras" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c301e73fb90e8a29e600a9f402d095765f74310d582916a952f618836a1bd1ed" +checksum = "c9f046b9af244f13b3bd939f55d16830ac3a201e8a9ba9661bfcb03e2be72b9b" dependencies = [ - "io-lifetimes 2.0.3", + "io-lifetimes", "windows-sys 0.52.0", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "io-lifetimes" version = "2.0.3" @@ -1375,43 +1415,50 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-macro" -version = "0.3.0" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4467ed1321b310c2625c5aa6c1b1ffc5de4d9e42668cf697a08fb033ee8265e" +checksum = "59a85abdc13717906baccb5a1e435556ce0df215f242892f721dff62bf25288f" dependencies = [ "Inflector", - "pmutil", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "f23ff5ef2b80d608d61efee834934d862cd92461afc0560dedf493e4c033738b" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes 1.0.11", - "rustix 0.37.26", - "windows-sys 0.48.0", + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.52.0", ] [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "ittapi" @@ -1435,18 +1482,20 @@ dependencies = [ [[package]] name = "javy" -version = "2.2.1-alpha.1" +version = "3.0.0-alpha.1" dependencies = [ "anyhow", - "quickjs-wasm-rs", + "quickcheck", "rmp-serde", + "rquickjs", + "serde", "serde-transcode", "serde_json", ] [[package]] name = "javy-apis" -version = "2.2.1-alpha.1" +version = "3.0.0-alpha.1" dependencies = [ "anyhow", "fastrand", @@ -1501,9 +1550,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1534,12 +1583,22 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libloading" -version = "0.7.3" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "winapi", + "windows-targets 0.52.4", +] + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.5.0", + "libc", ] [[package]] @@ -1553,24 +1612,15 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "log" -version = "0.4.17" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "mach" @@ -1589,33 +1639,24 @@ checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memfd" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc89ccdc6e10d6907450f753537ebc5c5d3460d2e4e62ea74bd571db62c0f9e" -dependencies = [ - "rustix 0.37.26", -] - -[[package]] -name = "memoffset" -version = "0.6.5" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "autocfg", + "rustix", ] [[package]] name = "memoffset" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" dependencies = [ "autocfg", ] @@ -1628,9 +1669,9 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -1642,7 +1683,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.48.0", ] @@ -1666,26 +1707,25 @@ dependencies = [ [[package]] name = "new_debug_unreachable" -version = "1.0.4" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" +checksum = "650eef8c711430f1a879fdd01d4745a7deea475becfb90269c06775983bbf086" [[package]] name = "nom" -version = "7.1.0" +version = "7.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" dependencies = [ "memchr", "minimal-lexical", - "version_check", ] [[package]] name = "num-bigint" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" dependencies = [ "autocfg", "num-integer", @@ -1705,42 +1745,41 @@ dependencies = [ [[package]] name = "num-integer" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" dependencies = [ - "autocfg", "num-traits", ] [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.3.9", "libc", ] [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.14.1", - "indexmap 2.0.2", + "hashbrown 0.14.3", + "indexmap 2.2.6", "memchr", ] @@ -1758,11 +1797,11 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl" -version = "0.10.60" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -1779,7 +1818,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -1790,9 +1829,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -1808,15 +1847,15 @@ checksum = "7f222829ae9293e33a9f5e9f440c6760a3d450a64affe1846486b140db81c1f4" [[package]] name = "paste" -version = "1.0.6" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0744126afe1a6dd7f394cb50a716dbe086cb06e255e53d8d0185d82828358fb5" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" @@ -1848,7 +1887,7 @@ dependencies = [ "phf_shared", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -1862,29 +1901,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1894,15 +1933,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plotters" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b639e642295546c50fcd545198c9d64ee2a38620a628724a3b266d5fbf97" +checksum = "d2c224ba00d7cadd4d5c660deaf2098e5e80e07846537c51f9cfa4be50c1fd45" dependencies = [ "num-traits", "plotters-backend", @@ -1913,44 +1952,43 @@ dependencies = [ [[package]] name = "plotters-backend" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "193228616381fecdc1224c62e96946dfbc73ff4384fba576e052ff8c1bea8142" +checksum = "9e76628b4d3a7581389a35d5b6e2139607ad7c75b17aed325f210aa91f4a9609" [[package]] name = "plotters-svg" -version = "0.3.3" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a81d2759aae1dae668f783c308bc5c8ebd191ff4184aaa1b37f65a6ae5a56f" +checksum = "38f6d39893cca0701371e3c27294f09797214b86f1fb951b89ade8ec04e2abab" dependencies = [ "plotters-backend", ] -[[package]] -name = "pmutil" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52a40bc70c2c58040d2d8b167ba9a5ff59fc9dab7ad44771cfde3dcfde7a09c6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.46", -] - [[package]] name = "ppv-lite86" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "8d3928fb5db768cb86f891ff014f0144589297e3c6a1aba6ed7cecfdace270c7" dependencies = [ "proc-macro2", - "syn 2.0.46", + "syn 2.0.58", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", ] [[package]] @@ -1979,18 +2017,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.74" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2de98502f212cfcea8d0bb305bd0f49d7ebdd75b64ba0a68f937d888f4e0d6db" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eca0fa5dd7c4c96e184cec588f0b1db1ee3165e678db21c09793105acb17e6f" +checksum = "5787f7cda34e3033a72192c018bc5883100330f362ef279a8cbccfce8bb4e874" dependencies = [ "cc", ] @@ -2035,9 +2073,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -2071,55 +2109,42 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ "getrandom", ] [[package]] name = "rayon" -version = "1.5.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "autocfg", - "crossbeam-deque", "either", "rayon-core", ] [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", - "num_cpus", -] - -[[package]] -name = "redox_syscall" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" -dependencies = [ - "bitflags 1.3.2", ] [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", - "redox_syscall", + "libredox", + "thiserror", ] [[package]] @@ -2137,9 +2162,21 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.6" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -2148,15 +2185,21 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" + +[[package]] +name = "relative-path" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc" [[package]] name = "rmp" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44519172358fd6d58656c86ab8e7fbc9e1490c3e8f14d35ed78ca0dd07403c9f" +checksum = "7f9860a6cc38ed1da53456442089b4dfa35e7cedaa326df63017af88385e6b20" dependencies = [ "byteorder", "num-traits", @@ -2174,11 +2217,55 @@ dependencies = [ "serde", ] +[[package]] +name = "rquickjs" +version = "0.6.1" +source = "git+https://github.com/Shopify/rquickjs?branch=improved-wasm-support#3d80f5757db52e9e1af2605cb6e1aaba6d44ceac" +dependencies = [ + "rquickjs-core", + "rquickjs-macro", +] + +[[package]] +name = "rquickjs-core" +version = "0.6.1" +source = "git+https://github.com/Shopify/rquickjs?branch=improved-wasm-support#3d80f5757db52e9e1af2605cb6e1aaba6d44ceac" +dependencies = [ + "relative-path", + "rquickjs-sys", +] + +[[package]] +name = "rquickjs-macro" +version = "0.6.1" +source = "git+https://github.com/Shopify/rquickjs?branch=improved-wasm-support#3d80f5757db52e9e1af2605cb6e1aaba6d44ceac" +dependencies = [ + "convert_case", + "fnv", + "ident_case", + "indexmap 2.2.6", + "proc-macro-crate", + "proc-macro-error", + "proc-macro2", + "quote", + "rquickjs-core", + "syn 2.0.58", +] + +[[package]] +name = "rquickjs-sys" +version = "0.6.1" +source = "git+https://github.com/Shopify/rquickjs?branch=improved-wasm-support#3d80f5757db52e9e1af2605cb6e1aaba6d44ceac" +dependencies = [ + "bindgen", + "cc", +] + [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc-hash" @@ -2197,44 +2284,30 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f3f8f960ed3b5a59055428714943298bf3fa2d4a1d53135084e0544829d995" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes 1.0.11", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", -] - -[[package]] -name = "rustix" -version = "0.38.31" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "errno", "itoa", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys", "once_cell", "windows-sys 0.52.0", ] [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -2247,11 +2320,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.42.0", + "windows-sys 0.52.0", ] [[package]] @@ -2260,12 +2333,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - [[package]] name = "scratch" version = "1.0.7" @@ -2274,9 +2341,9 @@ checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" [[package]] name = "security-framework" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -2287,9 +2354,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -2306,9 +2373,12 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +dependencies = [ + "serde", +] [[package]] name = "semver-parser" @@ -2351,7 +2421,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -2367,9 +2437,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -2378,11 +2448,11 @@ dependencies = [ [[package]] name = "shellexpand" -version = "2.1.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdb7831b2d85ddf4a7b148aa19d0587eddbe8671a436b7bd1182eaad0f2829" +checksum = "7ccc8076840c4da029af4f87e4e8daeb0fca6b87bbb02e10cb60b791450e11e4" dependencies = [ - "dirs-next", + "dirs", ] [[package]] @@ -2402,21 +2472,21 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" [[package]] name = "slice-group-by" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b634d87b960ab1a38c4fe143b508576f075e7c978bfad18217645ebfdfa2ec" +checksum = "826167069c09b99d56f31e9ae5c99049e932a98c9dc2dac47645b08dbbf76ba7" [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smartstring" @@ -2431,19 +2501,19 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "sourcemap" -version = "8.0.0" +version = "8.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf0b8c0d9d32f81aa0ab2b68ab634d9bbce287423606656fddb456ac8601aec3" +checksum = "208d40b9e8cad9f93613778ea295ed8f3c2b1824217c6cfc7219d3f6f45b96d4" dependencies = [ "base64-simd", "bitvec", @@ -2498,7 +2568,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -2552,9 +2622,9 @@ dependencies = [ [[package]] name = "swc_atoms" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d538eaaa6f085161d088a04cf0a3a5a52c5a7f2b3bd9b83f73f058b0ed357c0" +checksum = "04d9d1941a7d24fc503efa29c53f88dd61e6a15cc371947a75cca3b48d564b5b" dependencies = [ "hstr", "once_cell", @@ -2564,9 +2634,9 @@ dependencies = [ [[package]] name = "swc_common" -version = "0.33.21" +version = "0.33.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89598a0dfe7311750e6fad8464cafcec8ee010c649c2e04531b25e32362fdec7" +checksum = "a8f91d53367db183e55ecaa090c9a2b6e62ddbd1258aa2ac6c6925772eec9e2b" dependencies = [ "ast_node", "better_scoped_tls", @@ -2590,9 +2660,9 @@ dependencies = [ [[package]] name = "swc_core" -version = "0.90.26" +version = "0.90.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e18fa3e847ec83b97c27226233f683b62c03a10e24f44d139465fa876a5774a" +checksum = "fe7651ba172f4a82cd6f27b73e51d363e9b32aa97b9f6aab2e63e58f4df9ea62" dependencies = [ "swc_atoms", "swc_common", @@ -2604,11 +2674,11 @@ dependencies = [ [[package]] name = "swc_ecma_ast" -version = "0.112.6" +version = "0.112.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70656acd47c91918635f1e8589963428cb3170975b71d786c79fb7a25605f687" +checksum = "6bcd97ee367b48444f90416ea56e71d761600f816bcae9df4f99293d1fa36bd5" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "is-macro", "num-bigint", "phf", @@ -2616,14 +2686,14 @@ dependencies = [ "string_enum", "swc_atoms", "swc_common", - "unicode-id", + "unicode-id-start", ] [[package]] name = "swc_ecma_parser" -version = "0.143.11" +version = "0.143.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "192482230498a24c2e7c9c580ba334a80dc43b3899366e54aa548f8d7b0f12cd" +checksum = "5354a20ab66c2ec5001982271b6e7c750b7fca3409888ab9703ae3d3c845fed4" dependencies = [ "either", "new_debug_unreachable", @@ -2643,13 +2713,13 @@ dependencies = [ [[package]] name = "swc_ecma_transforms_base" -version = "0.137.16" +version = "0.137.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e9a23d6af398b6efd17bbdad2cfa580102f6c560611f85c63b48f76ffe8f0c" +checksum = "66b5818db80d8d9fcbc1d3453f1d246a7f56ea708ba136717a84a8caf0977afd" dependencies = [ "better_scoped_tls", - "bitflags 2.4.1", - "indexmap 2.0.2", + "bitflags 2.5.0", + "indexmap 2.2.6", "once_cell", "phf", "rustc-hash", @@ -2666,11 +2736,11 @@ dependencies = [ [[package]] name = "swc_ecma_utils" -version = "0.127.15" +version = "0.127.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f83263f449935d33f86b8ab17c88a13bc175a87a742752ebcc94be2006ab25" +checksum = "624c19fdbe1807275b16560892cf7a12a9ac3f631fb10ad45aaa3eeac903e6e5" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.2.6", "num_cpus", "once_cell", "rustc-hash", @@ -2704,7 +2774,7 @@ checksum = "695a1d8b461033d32429b5befbf0ad4d7a2c4d6ba9cd5ba4e0645c615839e8e4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -2715,14 +2785,14 @@ checksum = "50176cfc1cbc8bb22f41c6fe9d1ec53fbe057001219b5954961b8ad0f336fce9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] name = "swc_visit" -version = "0.5.10" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5b3e8d1269a7cb95358fed3412645d9c15aa0eb1f4ca003a25a38ef2f30f1b" +checksum = "0263be55289abfe9c877ffef83d877b5bdfac036ffe2de793f48f5e47e41dbae" dependencies = [ "either", "swc_visit_macros", @@ -2738,7 +2808,7 @@ dependencies = [ "proc-macro2", "quote", "swc_macros_common", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -2754,9 +2824,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.46" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89456b690ff72fddcecf231caedbe615c59480c93358a93dfae7fc29e3ebbf0e" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -2769,12 +2839,12 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0682e006dd35771e392a6623ac180999a9a854b1d4a6c12fb2e804941c2b1f58" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "cap-fs-ext", "cap-std", "fd-lock", - "io-lifetimes 2.0.3", - "rustix 0.38.31", + "io-lifetimes", + "rustix", "windows-sys 0.52.0", "winx", ] @@ -2787,9 +2857,9 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" @@ -2799,7 +2869,7 @@ checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand", - "rustix 0.38.31", + "rustix", "windows-sys 0.52.0", ] @@ -2823,22 +2893,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -2862,9 +2932,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" @@ -2891,7 +2961,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -2906,13 +2976,30 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] +[[package]] +name = "toml_datetime" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" + +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.2.6", + "toml_datetime", + "winnow", +] + [[package]] name = "tower" version = "0.4.13" @@ -2943,11 +3030,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2956,29 +3042,39 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", ] +[[package]] +name = "triomphe" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +dependencies = [ + "serde", + "stable_deref_trait", +] + [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typed-arena" @@ -2988,21 +3084,21 @@ checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" [[package]] name = "typenum" -version = "1.15.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-id" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d70b6494226b36008c8366c288d77190b3fad2eb4c10533139c1c1f461127f1a" +checksum = "b1b6def86329695390197b82c1e244a54a131ceb66c996f2088a3876e2ae083f" [[package]] name = "unicode-id-start" @@ -3012,30 +3108,30 @@ checksum = "b8f73150333cb58412db36f2aca8f2875b013049705cc77b94ded70a1ab1f5da" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.9.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unicode-xid" @@ -3045,9 +3141,9 @@ checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", "idna", @@ -3077,11 +3173,13 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "vergen" -version = "8.2.6" +version = "8.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" dependencies = [ "anyhow", + "cargo_metadata", + "regex", "rustversion", ] @@ -3131,20 +3229,13 @@ dependencies = [ [[package]] name = "want" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" dependencies = [ - "log", "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -3165,9 +3256,9 @@ dependencies = [ "cap-time-ext", "fs-set-times", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "once_cell", - "rustix 0.38.31", + "rustix", "system-interface", "tracing", "wasi-common", @@ -3181,12 +3272,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d888b611fee7d273dd057dc009d2dd3132736f36710ffd65657ac83628d1e3b" dependencies = [ "anyhow", - "bitflags 2.4.1", + "bitflags 2.5.0", "cap-rand", "cap-std", "io-extras", "log", - "rustix 0.38.31", + "rustix", "thiserror", "tracing", "wasmtime", @@ -3196,9 +3287,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3206,24 +3297,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.58", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3231,22 +3322,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-encoder" @@ -3275,6 +3366,15 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-encoder" +version = "0.202.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfd106365a7f5f7aa3c1916a98cbb3ad477f5ff96ddb130285a91c6e7429e67a" +dependencies = [ + "leb128", +] + [[package]] name = "wasm-opt" version = "0.116.1" @@ -3333,12 +3433,12 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.118.1" +version = "0.118.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ee9723b928e735d53000dec9eae7b07a60e490c85ab54abb66659fc61bfcd9" +checksum = "77f1154f1ab868e2a01d9834a805faca7bf8b50d041b4ca714d005d0dab1c50c" dependencies = [ - "indexmap 2.0.2", - "semver 1.0.17", + "indexmap 2.2.6", + "semver 1.0.22", ] [[package]] @@ -3347,9 +3447,9 @@ version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "bitflags 2.4.1", - "indexmap 2.0.2", - "semver 1.0.17", + "bitflags 2.5.0", + "indexmap 2.2.6", + "semver 1.0.22", ] [[package]] @@ -3358,16 +3458,16 @@ version = "0.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6998515d3cf3f8b980ef7c11b29a9b1017d4cf86b99ae93b546992df9931413" dependencies = [ - "bitflags 2.4.1", - "indexmap 2.0.2", - "semver 1.0.17", + "bitflags 2.5.0", + "indexmap 2.2.6", + "semver 1.0.22", ] [[package]] name = "wasmprinter" -version = "0.2.78" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e32c13c59fdc64d3f6998a1d52eb1d362b6904a88b754190ccb85661ad577a" +checksum = "60e73986a6b7fdfedb7c5bf9e7eb71135486507c8fbc4c0c42cffcb6532988b7" dependencies = [ "anyhow", "wasmparser 0.121.2", @@ -3396,7 +3496,7 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 2.0.2", + "indexmap 2.2.6", "libc", "log", "object", @@ -3408,7 +3508,7 @@ dependencies = [ "serde_json", "target-lexicon", "wasm-encoder 0.38.1", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-cache", "wasmtime-component-macro", "wasmtime-component-util", @@ -3442,7 +3542,7 @@ dependencies = [ "bincode", "directories-next", "log", - "rustix 0.38.31", + "rustix", "serde", "serde_derive", "sha2", @@ -3460,7 +3560,7 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", "wasmtime-component-util", "wasmtime-wit-bindgen", "wit-parser 0.13.2", @@ -3486,12 +3586,12 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli 0.28.0", + "gimli 0.28.1", "log", "object", "target-lexicon", "thiserror", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-cranelift-shared", "wasmtime-environ", "wasmtime-versioned-export-macros", @@ -3507,7 +3607,7 @@ dependencies = [ "cranelift-codegen", "cranelift-control", "cranelift-native", - "gimli 0.28.0", + "gimli 0.28.1", "object", "target-lexicon", "wasmtime-environ", @@ -3521,8 +3621,8 @@ checksum = "61eb64fb3e0da883e2df4a13a81d6282e072336e6cb6295021d0f7ab2e352754" dependencies = [ "anyhow", "cranelift-entity", - "gimli 0.28.0", - "indexmap 2.0.2", + "gimli 0.28.1", + "indexmap 2.2.6", "log", "object", "serde", @@ -3530,8 +3630,8 @@ dependencies = [ "target-lexicon", "thiserror", "wasm-encoder 0.38.1", - "wasmparser 0.118.1", - "wasmprinter 0.2.78", + "wasmparser 0.118.2", + "wasmprinter 0.2.80", "wasmtime-component-util", "wasmtime-types", ] @@ -3545,7 +3645,7 @@ dependencies = [ "anyhow", "cc", "cfg-if", - "rustix 0.38.31", + "rustix", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.48.0", @@ -3562,12 +3662,12 @@ dependencies = [ "bincode", "cfg-if", "cpp_demangle", - "gimli 0.28.0", + "gimli 0.28.1", "ittapi", "log", "object", "rustc-demangle", - "rustix 0.38.31", + "rustix", "serde", "serde_derive", "target-lexicon", @@ -3586,7 +3686,7 @@ checksum = "65e119affec40edb2fab9044f188759a00c2df9c3017278d047012a2de1efb4f" dependencies = [ "object", "once_cell", - "rustix 0.38.31", + "rustix", "wasmtime-versioned-export-macros", ] @@ -3611,15 +3711,15 @@ dependencies = [ "cc", "cfg-if", "encoding_rs", - "indexmap 2.0.2", + "indexmap 2.2.6", "libc", "log", "mach", "memfd", - "memoffset 0.9.0", + "memoffset", "paste", "psm", - "rustix 0.38.31", + "rustix", "sptr", "wasm-encoder 0.38.1", "wasmtime-asm-macros", @@ -3641,7 +3741,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "wasmparser 0.118.1", + "wasmparser 0.118.2", ] [[package]] @@ -3652,7 +3752,7 @@ checksum = "f55c5565959287c21dd0f4277ae3518dd2ae62679f655ee2dbc4396e19d210db" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", ] [[package]] @@ -3663,7 +3763,7 @@ checksum = "ccd8370078149d49a3a47e93741553fd79b700421464b6a27ca32718192ab130" dependencies = [ "anyhow", "async-trait", - "bitflags 2.4.1", + "bitflags 2.5.0", "bytes", "cap-fs-ext", "cap-net-ext", @@ -3673,11 +3773,11 @@ dependencies = [ "fs-set-times", "futures", "io-extras", - "io-lifetimes 2.0.3", + "io-lifetimes", "libc", "log", "once_cell", - "rustix 0.38.31", + "rustix", "system-interface", "thiserror", "tokio", @@ -3698,10 +3798,10 @@ checksum = "2c6f945ff9bad96e0a69973d74f193c19f627c8adbf250e7cb73ae7564b6cc8a" dependencies = [ "anyhow", "cranelift-codegen", - "gimli 0.28.0", + "gimli 0.28.1", "object", "target-lexicon", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", @@ -3715,7 +3815,7 @@ checksum = "f328b2d4a690270324756e886ed5be3a4da4c00be0eea48253f4595ad068062b" dependencies = [ "anyhow", "heck 0.4.1", - "indexmap 2.0.2", + "indexmap 2.2.6", "wit-parser 0.13.2", ] @@ -3736,30 +3836,31 @@ dependencies = [ [[package]] name = "wast" -version = "69.0.1" +version = "202.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ee37317321afde358e4d7593745942c48d6d17e0e6e943704de9bbee121e7a" +checksum = "1fbcb11204515c953c9b42ede0a46a1c5e17f82af05c4fae201a8efff1b0f4fe" dependencies = [ + "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.38.1", + "wasm-encoder 0.202.0", ] [[package]] name = "wat" -version = "1.0.82" +version = "1.202.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb338ee8dee4d4cd05e6426683f21c5087dc7cfc8903e839ccf48d43332da3c" +checksum = "4de4b15a47135c56a3573406e9977b9518787a6154459b4842a9b9d3d1684848" dependencies = [ - "wast 69.0.1", + "wast 202.0.0", ] [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -3767,13 +3868,14 @@ dependencies = [ [[package]] name = "which" -version = "4.2.4" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5a7e487e921cf220206864a94a89b6c6905bfc19f1057fa26a4cb360e5c1d2" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" dependencies = [ "either", - "lazy_static", - "libc", + "home", + "once_cell", + "rustix", ] [[package]] @@ -3784,7 +3886,7 @@ checksum = "0afb26cd3269289bb314a361ff0a6685e5ce793b62181a9fe3f81ace15051697" dependencies = [ "anyhow", "async-trait", - "bitflags 2.4.1", + "bitflags 2.5.0", "thiserror", "tracing", "wasmtime", @@ -3802,7 +3904,7 @@ dependencies = [ "proc-macro2", "quote", "shellexpand", - "syn 2.0.46", + "syn 2.0.58", "witx", ] @@ -3814,7 +3916,7 @@ checksum = "31ae1ec11a17ea481539ee9a5719a278c9790d974060fbf71db4b2c05378780b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.46", + "syn 2.0.58", "wiggle-generate", ] @@ -3836,9 +3938,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] @@ -3857,11 +3959,11 @@ checksum = "58e58c236a6abdd9ab454552b4f29e16cfa837a86897c1503313b2e62e7609ec" dependencies = [ "anyhow", "cranelift-codegen", - "gimli 0.28.0", + "gimli 0.28.1", "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-environ", ] @@ -3871,22 +3973,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", -] - -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm 0.42.1", - "windows_aarch64_msvc 0.42.1", - "windows_i686_gnu 0.42.1", - "windows_i686_msvc 0.42.1", - "windows_x86_64_gnu 0.42.1", - "windows_x86_64_gnullvm 0.42.1", - "windows_x86_64_msvc 0.42.1", + "windows-targets 0.52.4", ] [[package]] @@ -3895,7 +3982,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.48.5", ] [[package]] @@ -3904,164 +3991,131 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.4", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.1" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" - -[[package]] -name = "windows_i686_msvc" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] -name = "windows_x86_64_msvc" -version = "0.52.0" +name = "winnow" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] [[package]] name = "winx" @@ -4069,7 +4123,7 @@ version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9643b83820c0cd246ecabe5fa454dd04ba4fa67996369466d0747472d337346" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "windows-sys 0.52.0", ] @@ -4081,9 +4135,9 @@ checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" dependencies = [ "anyhow", "id-arena", - "indexmap 2.0.2", + "indexmap 2.2.6", "log", - "semver 1.0.17", + "semver 1.0.22", "serde", "serde_derive", "serde_json", @@ -4098,9 +4152,9 @@ checksum = "744237b488352f4f27bca05a10acb79474415951c450e52ebd0da784c1df2bcc" dependencies = [ "anyhow", "id-arena", - "indexmap 2.0.2", + "indexmap 2.2.6", "log", - "semver 1.0.17", + "semver 1.0.22", "serde", "serde_derive", "serde_json", @@ -4146,6 +4200,26 @@ dependencies = [ "tap", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.58", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" @@ -4167,11 +4241,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", - "libc", "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 3548b91d..d059fa9d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,7 +22,7 @@ wasmtime-wasi = "16" wasi-common = "16" anyhow = "1.0" once_cell = "1.19" -javy = { path = "crates/javy", version = "2.2.1-alpha.1" } +javy = { path = "crates/javy", version = "3.0.0-alpha.1" } [profile.release] lto = true diff --git a/Makefile b/Makefile index b3223760..9b0b5c2e 100644 --- a/Makefile +++ b/Makefile @@ -21,9 +21,6 @@ docs: cargo doc --package=javy-cli --open cargo doc --package=javy-core --open --target=wasm32-wasi -test-quickjs-wasm-rs: - cargo wasi test --package=quickjs-wasm-rs -- --nocapture - test-javy: cargo wasi test --package=javy --features json,messagepack -- --nocapture @@ -47,7 +44,7 @@ test-wpt: npm install --prefix wpt npm test --prefix wpt -tests: test-quickjs-wasm-rs test-javy test-apis test-core test-cli test-wpt +tests: test-javy test-apis test-core test-cli test-wpt fmt: fmt-quickjs-wasm-sys fmt-quickjs-wasm-rs fmt-javy fmt-apis fmt-core fmt-cli diff --git a/crates/apis/CHANGELOG.md b/crates/apis/CHANGELOG.md index 8cb293e6..888bcc22 100644 --- a/crates/apis/CHANGELOG.md +++ b/crates/apis/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Rewrite the APIs on top of Javy v3.0.0, which drops support for + `quickjs-wasm-rs` in favor of `rquickjs` + ## [2.2.0] - 2024-01-31 ### Changed diff --git a/crates/apis/Cargo.toml b/crates/apis/Cargo.toml index dea826fa..05f23fe3 100644 --- a/crates/apis/Cargo.toml +++ b/crates/apis/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "javy-apis" -version = "2.2.1-alpha.1" +version = "3.0.0-alpha.1" authors.workspace = true edition.workspace = true license.workspace = true diff --git a/crates/apis/README.md b/crates/apis/README.md index 824e926b..cc492007 100644 --- a/crates/apis/README.md +++ b/crates/apis/README.md @@ -7,14 +7,19 @@ APIs are registered by enabling crate features. ## Example usage ```rust -use javy::{quickjs::JSValue, Runtime}; -// with `console` feature enabled + +// With the `console` feature enabled. +use javy::{Runtime, from_js_error}; use javy_apis::RuntimeExt; +use anyhow::Result; fn main() -> Result<()> { let runtime = Runtime::new_with_defaults()?; let context = runtime.context(); - context.eval_global("hello.js", "console.log('hello!');")?; + context.with(|cx| { + cx.eval_with_options(Default::default(), "console.log('hello!');") + .map_err(|e| to_js_error(cx.clone(), e))? + }); Ok(()) } ``` @@ -30,7 +35,3 @@ If you want to customize the runtime or the APIs, you can use the `Runtime::new_ ## Publishing to crates.io To publish this crate to crates.io, run `./publish.sh`. - -## Using a custom WASI SDK - -This crate can be compiled using a custom [WASI SDK](https://github.com/WebAssembly/wasi-sdk). When building this crate, set the `QUICKJS_WASM_SYS_WASI_SDK_PATH` environment variable to the absolute path where you installed the SDK. diff --git a/crates/apis/src/console/mod.rs b/crates/apis/src/console/mod.rs index eb75d342..d4a0be17 100644 --- a/crates/apis/src/console/mod.rs +++ b/crates/apis/src/console/mod.rs @@ -1,9 +1,10 @@ use std::io::Write; -use anyhow::Result; +use anyhow::{Error, Result}; use javy::{ - quickjs::{JSContextRef, JSValue, JSValueRef}, - Runtime, + hold, hold_and_release, print, + quickjs::{prelude::MutFn, Context, Function, Object, Value}, + to_js_error, Args, Runtime, }; use crate::{APIConfig, JSApiSet}; @@ -31,50 +32,65 @@ impl JSApiSet for Console { } } -fn register_console(context: &JSContextRef, log_stream: T, error_stream: U) -> Result<()> +fn register_console(context: &Context, mut log_stream: T, mut error_stream: U) -> Result<()> where T: Write + 'static, U: Write + 'static, { - let console_log_callback = context.wrap_callback(console_log_to(log_stream))?; - let console_error_callback = context.wrap_callback(console_log_to(error_stream))?; - let console_object = context.object_value()?; - console_object.set_property("log", console_log_callback)?; - console_object.set_property("error", console_error_callback)?; - context - .global_object()? - .set_property("console", console_object)?; + context.with(|this| { + let globals = this.globals(); + let console = Object::new(this.clone())?; + + console.set( + "log", + Function::new( + this.clone(), + MutFn::new(move |cx, args| { + let (cx, args) = hold_and_release!(cx, args); + log(hold!(cx.clone(), args), &mut log_stream).map_err(|e| to_js_error(cx, e)) + }), + )?, + )?; + + console.set( + "error", + Function::new( + this.clone(), + MutFn::new(move |cx, args| { + let (cx, args) = hold_and_release!(cx, args); + log(hold!(cx.clone(), args), &mut error_stream).map_err(|e| to_js_error(cx, e)) + }), + )?, + )?; + + globals.set("console", console)?; + Ok::<_, Error>(()) + })?; Ok(()) } -fn console_log_to( - mut stream: T, -) -> impl FnMut(&JSContextRef, JSValueRef, &[JSValueRef]) -> Result -where - T: Write + 'static, -{ - move |_ctx: &JSContextRef, _this: JSValueRef, args: &[JSValueRef]| { - // Write full string to in-memory destination before writing to stream since each write call to the stream - // will invoke a hostcall. - let mut log_line = String::new(); - for (i, arg) in args.iter().enumerate() { - if i != 0 { - log_line.push(' '); - } - let line = arg.to_string(); - log_line.push_str(&line); +fn log<'js, T: Write>(args: Args<'js>, stream: &mut T) -> Result> { + let (ctx, args) = args.release(); + let mut buf = String::new(); + for (i, arg) in args.iter().enumerate() { + if i != 0 { + buf.push(' '); } + print(arg, &mut buf)?; + } - writeln!(stream, "{log_line}")?; + writeln!(stream, "{buf}")?; - Ok(JSValue::Undefined) - } + Ok(Value::new_undefined(ctx.clone())) } #[cfg(test)] mod tests { - use anyhow::Result; - use javy::Runtime; + use anyhow::{Error, Result}; + use javy::{ + quickjs::{Object, Value}, + Runtime, + }; use std::cell::RefCell; use std::rc::Rc; use std::{cmp, io}; @@ -88,9 +104,13 @@ mod tests { fn test_register() -> Result<()> { let runtime = Runtime::default(); Console::new().register(&runtime, &APIConfig::default())?; - let console = runtime.context().global_object()?.get_property("console")?; - assert!(console.get_property("log").is_ok()); - assert!(console.get_property("error").is_ok()); + runtime.context().with(|cx| { + let console: Object<'_> = cx.globals().get("console")?; + assert!(console.get::<&str, Value<'_>>("log").is_ok()); + assert!(console.get::<&str, Value<'_>>("error").is_ok()); + + Ok::<_, Error>(()) + })?; Ok(()) } @@ -102,24 +122,25 @@ mod tests { let ctx = runtime.context(); register_console(ctx, stream.clone(), stream.clone())?; - ctx.eval_global("main", "console.log(\"hello world\");")?; - assert_eq!(b"hello world\n", stream.buffer.borrow().as_slice()); + ctx.with(|this| { + this.eval("console.log(\"hello world\");")?; + assert_eq!(b"hello world\n", stream.buffer.borrow().as_slice()); + stream.clear(); - stream.clear(); + this.eval("console.log(\"bonjour\", \"le\", \"monde\")")?; + assert_eq!(b"bonjour le monde\n", stream.buffer.borrow().as_slice()); - ctx.eval_global("main", "console.log(\"bonjour\", \"le\", \"monde\")")?; - assert_eq!(b"bonjour le monde\n", stream.buffer.borrow().as_slice()); + stream.clear(); - stream.clear(); + this.eval("console.log(2.3, true, { foo: 'bar' }, null, undefined)")?; + assert_eq!( + b"2.3 true [object Object] null undefined\n", + stream.buffer.borrow().as_slice() + ); + + Ok::<_, Error>(()) + })?; - ctx.eval_global( - "main", - "console.log(2.3, true, { foo: 'bar' }, null, undefined)", - )?; - assert_eq!( - b"2.3 true [object Object] null undefined\n", - stream.buffer.borrow().as_slice() - ); Ok(()) } @@ -131,24 +152,25 @@ mod tests { let ctx = runtime.context(); register_console(ctx, stream.clone(), stream.clone())?; - ctx.eval_global("main", "console.error(\"hello world\");")?; - assert_eq!(b"hello world\n", stream.buffer.borrow().as_slice()); + ctx.with(|this| { + this.eval("console.error(\"hello world\");")?; + assert_eq!(b"hello world\n", stream.buffer.borrow().as_slice()); - stream.clear(); + stream.clear(); - ctx.eval_global("main", "console.error(\"bonjour\", \"le\", \"monde\")")?; - assert_eq!(b"bonjour le monde\n", stream.buffer.borrow().as_slice()); + this.eval("console.error(\"bonjour\", \"le\", \"monde\")")?; + assert_eq!(b"bonjour le monde\n", stream.buffer.borrow().as_slice()); - stream.clear(); + stream.clear(); + + this.eval("console.error(2.3, true, { foo: 'bar' }, null, undefined)")?; + assert_eq!( + b"2.3 true [object Object] null undefined\n", + stream.buffer.borrow().as_slice() + ); + Ok::<_, Error>(()) + })?; - ctx.eval_global( - "main", - "console.error(2.3, true, { foo: 'bar' }, null, undefined)", - )?; - assert_eq!( - b"2.3 true [object Object] null undefined\n", - stream.buffer.borrow().as_slice() - ); Ok(()) } diff --git a/crates/apis/src/random/mod.rs b/crates/apis/src/random/mod.rs index e7bbb570..89699cea 100644 --- a/crates/apis/src/random/mod.rs +++ b/crates/apis/src/random/mod.rs @@ -1,5 +1,8 @@ -use anyhow::Result; -use javy::{quickjs::JSValue, Runtime}; +use anyhow::{Error, Result}; +use javy::{ + quickjs::{prelude::Func, Object}, + Runtime, +}; use crate::{APIConfig, JSApiSet}; @@ -7,12 +10,14 @@ pub struct Random; impl JSApiSet for Random { fn register(&self, runtime: &Runtime, _config: &APIConfig) -> Result<()> { - let ctx = runtime.context(); - ctx.global_object()?.get_property("Math")?.set_property( - "random", - // TODO figure out if we can lazily initialize the PRNG - ctx.wrap_callback(|_ctx, _this, _args| Ok(JSValue::Float(fastrand::f64())))?, - )?; + runtime.context().with(|cx| { + let globals = cx.globals(); + let math: Object<'_> = globals.get("Math").expect("Math global to be defined"); + math.set("random", Func::from(fastrand::f64))?; + + Ok::<_, Error>(()) + })?; + Ok(()) } } @@ -20,18 +25,30 @@ impl JSApiSet for Random { #[cfg(test)] mod tests { use crate::{random::Random, APIConfig, JSApiSet}; - use anyhow::Result; - use javy::Runtime; + use anyhow::{Error, Result}; + use javy::{ + quickjs::{context::EvalOptions, Value}, + Runtime, + }; #[test] fn test_random() -> Result<()> { let runtime = Runtime::default(); Random.register(&runtime, &APIConfig::default())?; - let ctx = runtime.context(); - ctx.eval_global("test.js", "result = Math.random()")?; - let result = ctx.global_object()?.get_property("result")?.as_f64()?; - assert!(result >= 0.0); - assert!(result < 1.0); + runtime.context().with(|this| { + let mut eval_opts = EvalOptions::default(); + eval_opts.strict = false; + this.eval_with_options("result = Math.random()", eval_opts)?; + let result: f64 = this + .globals() + .get::<&str, Value<'_>>("result")? + .as_float() + .unwrap(); + assert!(result >= 0.0); + assert!(result < 1.0); + Ok::<_, Error>(()) + })?; + Ok(()) } } diff --git a/crates/apis/src/runtime_ext.rs b/crates/apis/src/runtime_ext.rs index d6491574..c7382f9b 100644 --- a/crates/apis/src/runtime_ext.rs +++ b/crates/apis/src/runtime_ext.rs @@ -26,6 +26,7 @@ impl RuntimeExt for Runtime { fn new_with_apis(config: Config, api_config: APIConfig) -> Result { let runtime = Runtime::new(config)?; crate::add_to_runtime(&runtime, api_config)?; + Ok(runtime) } diff --git a/crates/apis/src/stream_io/mod.rs b/crates/apis/src/stream_io/mod.rs index abdf1217..7496e150 100644 --- a/crates/apis/src/stream_io/mod.rs +++ b/crates/apis/src/stream_io/mod.rs @@ -1,68 +1,164 @@ -use anyhow::Result; -use std::io::{Read, Write}; +use anyhow::{anyhow, bail, Error, Result}; +use std::io::{Read, Stdin, Write}; -use javy::Runtime; +use javy::{ + hold, hold_and_release, + quickjs::{qjs::JS_GetArrayBuffer, Function, Object, Value}, + to_js_error, Args, Runtime, +}; use crate::{APIConfig, JSApiSet}; pub(super) struct StreamIO; -impl JSApiSet for StreamIO { - fn register(&self, runtime: &Runtime, _config: &APIConfig) -> Result<()> { - let context = runtime.context(); - let global = context.global_object()?; - - let mut javy_object = global.get_property("Javy")?; - if javy_object.is_undefined() { - javy_object = context.object_value()?; - global.set_property("Javy", javy_object)?; +fn extract_args<'a, 'js: 'a>( + args: &'a [Value<'js>], + for_func: &str, +) -> Result<( + &'a Value<'js>, + &'a Value<'js>, + &'a Value<'js>, + &'a Value<'js>, +)> { + let [fd, data, offset, length, ..] = args else { + bail!( + r#" + {} expects 4 parameters: the file descriptor, the + TypedArray buffer, the TypedArray byteOffset and the TypedArray + byteLength. + + Got: {} parameters. + "#, + for_func, + args.len() + ); + }; + + Ok((fd, data, offset, length)) +} + +fn write(args: Args<'_>) -> Result> { + enum Fd { + Stdout, + Stderr, + } + + let (cx, args) = args.release(); + let (fd, data, offset, length) = extract_args(&args, "Javy.IO.writeSync")?; + let fd = match fd + .as_int() + .ok_or_else(|| anyhow!("File descriptor must be a number"))? + { + 1 => Fd::Stdout, + 2 => Fd::Stderr, + x => anyhow::bail!( + "Unsupported file descriptor: {x}. Only stdout(1) and stderr(2) are supported" + ), + }; + let data = data + .as_object() + .ok_or_else(|| anyhow!("Data must be an Object"))? + .as_array_buffer() + .ok_or_else(|| anyhow!("Data must be an ArrayBuffer"))? + .as_bytes() + .ok_or_else(|| anyhow!("Could not represent data as &[u8]"))?; + + let offset = offset + .as_number() + .ok_or_else(|| anyhow!("offset must be a number"))? as usize; + let length = length + .as_number() + .ok_or_else(|| anyhow!("offset must be a number"))? as usize; + let data = &data[offset..(offset + length)]; + let n = match fd { + Fd::Stdout => { + let mut fd = std::io::stdout(); + let n = fd.write(data)?; + fd.flush()?; + n + } + Fd::Stderr => { + let mut fd = std::io::stderr(); + let n = fd.write(data)?; + fd.flush()?; + n } + }; + + Ok(Value::new_number(cx, n as f64)) +} + +fn read(args: Args<'_>) -> Result> { + let (cx, args) = args.release(); + let (fd, data, offset, length) = extract_args(&args, "Javy.IO.readSync")?; + + let mut fd: Stdin = match fd + .as_int() + .ok_or_else(|| anyhow!("File descriptor must be a number"))? + { + 0 => std::io::stdin(), + x => anyhow::bail!("Unsupported file descriptor: {x}. Only stdin(0) is supported"), + }; + + let offset = offset + .as_number() + .ok_or_else(|| anyhow!("offset must be a number"))? as usize; + let length = length + .as_number() + .ok_or_else(|| anyhow!("length must be a number"))? as usize; + + // Safety + // This is one of the unfortunate unsafe pieces of the APIs, currently. + // This is a port of the previous implementation. + // This should ideally be revisited in order to make it safe. + // This is unsafe only if the length of the buffer doesn't match the length + // and offset passed as arguments, the caller must ensure that this is true. + // We could make this API safe by changing the expectations of the + // JavaScript side of things in `io.js`. + let data = unsafe { + let mut len = 0; + let ptr = JS_GetArrayBuffer(cx.as_raw().as_ptr(), &mut len, data.as_raw()); + if ptr.is_null() { + bail!("Data must be an ArrayBuffer"); + } + + Ok::<_, Error>(std::slice::from_raw_parts_mut(ptr, len as _)) + }?; + + let data = &mut data[offset..(offset + length)]; + let n = fd.read(data)?; + + Ok(Value::new_number(cx, n as f64)) +} + +impl JSApiSet for StreamIO { + fn register<'js>(&self, runtime: &Runtime, _config: &APIConfig) -> Result<()> { + runtime.context().with(|this| { + let globals = this.globals(); + if globals.get::<_, Object>("Javy").is_err() { + globals.set("Javy", Object::new(this.clone())?)? + } + + globals.set( + "__javy_io_writeSync", + Function::new(this.clone(), |cx, args| { + let (cx, args) = hold_and_release!(cx, args); + write(hold!(cx.clone(), args)).map_err(|e| to_js_error(cx, e)) + }), + )?; + + globals.set( + "__javy_io_readSync", + Function::new(this.clone(), |cx, args| { + let (cx, args) = hold_and_release!(cx, args); + read(hold!(cx.clone(), args)).map_err(|e| to_js_error(cx, e)) + }), + )?; + + this.eval(include_str!("io.js"))?; + Ok::<_, Error>(()) + })?; - global.set_property( - "__javy_io_writeSync", - context.wrap_callback(|_, _this_arg, args| { - let [fd, data, offset, length, ..] = args else { - anyhow::bail!("Invalid number of parameters"); - }; - - let mut fd: Box = match fd.try_into()? { - 1 => Box::new(std::io::stdout()), - 2 => Box::new(std::io::stderr()), - _ => anyhow::bail!("Only stdout and stderr are supported"), - }; - let data: Vec = data.try_into()?; - let offset: usize = offset.try_into()?; - let length: usize = length.try_into()?; - let data = &data[offset..(offset + length)]; - let n = fd.write(data)?; - fd.flush()?; - Ok(n.into()) - })?, - )?; - - global.set_property( - "__javy_io_readSync", - context.wrap_callback(|_, _this_arg, args| { - let [fd, data, offset, length, ..] = args else { - anyhow::bail!("Invalid number of parameters"); - }; - let mut fd: Box = match fd.try_into()? { - 0 => Box::new(std::io::stdin()), - _ => anyhow::bail!("Only stdin is supported"), - }; - let offset: usize = offset.try_into()?; - let length: usize = length.try_into()?; - if !data.is_array_buffer() { - anyhow::bail!("Data needs to be an ArrayBuffer"); - } - let data = data.as_bytes_mut()?; - let data = &mut data[offset..(offset + length)]; - let n = fd.read(data)?; - Ok(n.into()) - })?, - )?; - - context.eval_global("io.js", include_str!("io.js"))?; Ok(()) } } diff --git a/crates/apis/src/text_encoding/mod.rs b/crates/apis/src/text_encoding/mod.rs index 7d800764..c7b8528a 100644 --- a/crates/apis/src/text_encoding/mod.rs +++ b/crates/apis/src/text_encoding/mod.rs @@ -1,102 +1,149 @@ -use std::{borrow::Cow, str}; +use std::str; -use anyhow::{anyhow, Result}; +use crate::{APIConfig, JSApiSet}; +use anyhow::{anyhow, bail, Error, Result}; use javy::{ - quickjs::{JSContextRef, JSError, JSValue, JSValueRef}, - Runtime, + hold, hold_and_release, + quickjs::{context::EvalOptions, Exception, Function, String as JSString, TypedArray, Value}, + to_js_error, to_string_lossy, Args, Runtime, }; -use crate::{APIConfig, JSApiSet}; - pub(super) struct TextEncoding; impl JSApiSet for TextEncoding { - fn register(&self, runtime: &Runtime, _config: &APIConfig) -> Result<()> { - let context = runtime.context(); - let global = context.global_object()?; - global.set_property( - "__javy_decodeUtf8BufferToString", - context.wrap_callback(decode_utf8_buffer_to_js_string())?, - )?; - global.set_property( - "__javy_encodeStringToUtf8Buffer", - context.wrap_callback(encode_js_string_to_utf8_buffer())?, - )?; - - context.eval_global("text-encoding.js", include_str!("./text-encoding.js"))?; + fn register<'js>(&self, runtime: &Runtime, _: &APIConfig) -> Result<()> { + runtime.context().with(|this| { + let globals = this.globals(); + globals.set( + "__javy_decodeUtf8BufferToString", + Function::new(this.clone(), |cx, args| { + let (cx, args) = hold_and_release!(cx, args); + decode(hold!(cx.clone(), args)).map_err(|e| to_js_error(cx, e)) + }), + )?; + globals.set( + "__javy_encodeStringToUtf8Buffer", + Function::new(this.clone(), |cx, args| { + let (cx, args) = hold_and_release!(cx, args); + encode(hold!(cx.clone(), args)).map_err(|e| to_js_error(cx, e)) + }), + )?; + let mut opts = EvalOptions::default(); + opts.strict = false; + this.eval_with_options(include_str!("./text-encoding.js"), opts)?; + + Ok::<_, Error>(()) + })?; + Ok(()) } } -fn decode_utf8_buffer_to_js_string( -) -> impl FnMut(&JSContextRef, JSValueRef, &[JSValueRef]) -> anyhow::Result { - move |_ctx: &JSContextRef, _this: JSValueRef, args: &[JSValueRef]| { - if args.len() != 5 { - return Err(anyhow!("Expecting 5 arguments, received {}", args.len())); - } - - let buffer: Vec = args[0].try_into()?; - let byte_offset: usize = args[1].try_into()?; - let byte_length: usize = args[2].try_into()?; - let fatal: bool = args[3].try_into()?; - let ignore_bom: bool = args[4].try_into()?; - - let mut view = buffer - .get(byte_offset..(byte_offset + byte_length)) - .ok_or_else(|| { - anyhow!("Provided offset and length is not valid for provided buffer") - })?; - - if !ignore_bom { - view = match view { - // [0xEF, 0xBB, 0xBF] is the UTF-8 BOM which we want to strip - [0xEF, 0xBB, 0xBF, rest @ ..] => rest, - _ => view, - }; - } - - let str = - if fatal { - Cow::from(str::from_utf8(view).map_err(|_| { - JSError::Type("The encoded data was not valid utf-8".to_string()) - })?) - } else { - String::from_utf8_lossy(view) - }; - Ok(str.to_string().into()) +/// Decode a UTF-8 byte buffer as a JavaScript String. +fn decode(args: Args<'_>) -> Result> { + let (cx, args) = args.release(); + if args.len() != 5 { + bail!( + "Wrong number of arguments. Expected 5 arguments. Got: {}", + args.len() + ); } -} -fn encode_js_string_to_utf8_buffer( -) -> impl FnMut(&JSContextRef, JSValueRef, &[JSValueRef]) -> anyhow::Result { - move |_ctx: &JSContextRef, _this: JSValueRef, args: &[JSValueRef]| { - if args.len() != 1 { - return Err(anyhow!("Expecting 1 argument, got {}", args.len())); - } + let buffer = args[0] + .as_object() + .ok_or_else(|| anyhow!("buffer must be an object"))? + .as_array_buffer() + .ok_or_else(|| anyhow!("buffer must be an ArrayBuffer"))? + .as_bytes() + .ok_or_else(|| anyhow!("Couldn't retrive &[u8] from buffer"))?; + + let byte_offset = args[1] + .as_number() + .ok_or_else(|| anyhow!("offset must be a number"))? as usize; + let byte_length = args[2] + .as_number() + .ok_or_else(|| anyhow!("byte_length must be a number"))? as usize; + let fatal = args[3] + .as_bool() + .ok_or_else(|| anyhow!("fatal must be a boolean"))?; + let ignore_bom = args[4] + .as_bool() + .ok_or_else(|| anyhow!("ignore_bom must be a boolean"))?; + + let mut view = buffer + .get(byte_offset..(byte_offset + byte_length)) + .ok_or_else(|| anyhow!("Provided offset and length is not valid for provided buffer"))?; + + if !ignore_bom { + view = match view { + // [0xEF, 0xBB, 0xBF] is the UTF-8 BOM which we want to strip + [0xEF, 0xBB, 0xBF, rest @ ..] => rest, + _ => view, + }; + } + + let js_string = if fatal { + JSString::from_str( + cx.clone(), + str::from_utf8(view) + .map_err(|_| Exception::throw_type(&cx, "The encoded data was not valid utf-8"))?, + ) + } else { + let str = String::from_utf8_lossy(view); + JSString::from_str(cx, &str) + }; - let js_string: String = args[0].try_into()?; - Ok(js_string.into_bytes().into()) + Ok(Value::from_string(js_string?)) +} + +/// Encode a JavaScript String into a JavaScript UInt8Array. +fn encode(args: Args<'_>) -> Result> { + let (cx, args) = args.release(); + if args.len() != 1 { + bail!("Wrong number of arguments. Expected 1. Got {}", args.len()); } + + let js_string = args[0] + .as_string() + .ok_or_else(|| anyhow!("Argument must be a String"))?; + let encoded = js_string + // This is the fast path. + // The string is already utf-8. + .to_string() + .unwrap_or_else(|error| to_string_lossy(&cx, js_string, error)); + + Ok(TypedArray::new(cx, encoded.into_bytes())? + .as_value() + .to_owned()) } #[cfg(test)] mod tests { use crate::{APIConfig, JSApiSet}; - use anyhow::Result; - use javy::Runtime; + use anyhow::{Error, Result}; + use javy::{quickjs::Value, Runtime}; use super::TextEncoding; #[test] fn test_text_encoder_decoder() -> Result<()> { let runtime = Runtime::default(); - let context = runtime.context(); TextEncoding.register(&runtime, &APIConfig::default())?; - let result = context.eval_global( - "main", - "let encoder = new TextEncoder(); let buffer = encoder.encode('hello'); let decoder = new TextDecoder(); decoder.decode(buffer) == 'hello';" - )?; - assert!(result.as_bool()?); + + runtime.context().with(|this| { + let result: Value<'_> = this.eval( + r#" + let encoder = new TextEncoder(); + let decoder = new TextDecoder(); + + let buffer = encoder.encode('hello'); + decoder.decode(buffer) == 'hello'; + "#, + )?; + + assert!(result.as_bool().unwrap()); + Ok::<_, Error>(()) + })?; Ok(()) } } diff --git a/crates/cli/tests/dylib_test.rs b/crates/cli/tests/dylib_test.rs index 851d62f3..ba750c77 100644 --- a/crates/cli/tests/dylib_test.rs +++ b/crates/cli/tests/dylib_test.rs @@ -28,7 +28,7 @@ fn test_dylib_with_error() -> Result<()> { assert!(result.is_err()); let output = stderr.try_into_inner().unwrap().into_inner(); - let expected_log_output = "Error while running JS: Uncaught Error: foo error\n at foo (function.mjs)\n at (function.mjs:1)\n\n"; + let expected_log_output = "Error:1:24 foo error\n at foo (function.mjs:1:24)\n at (function.mjs:1:50)\n\n"; assert_eq!(expected_log_output, str::from_utf8(&output)?); Ok(()) diff --git a/crates/cli/tests/integration_test.rs b/crates/cli/tests/integration_test.rs index e07ac541..2fb8e410 100644 --- a/crates/cli/tests/integration_test.rs +++ b/crates/cli/tests/integration_test.rs @@ -10,7 +10,7 @@ fn test_identity() { let (output, _, fuel_consumed) = run_with_u8s(&mut runner, 42); assert_eq!(42, output); - assert_fuel_consumed_within_threshold(37907, fuel_consumed); + assert_fuel_consumed_within_threshold(43239, fuel_consumed); } #[test] @@ -46,7 +46,7 @@ fn test_encoding() { let (output, _, fuel_consumed) = run(&mut runner, "hello".as_bytes()); assert_eq!("el".as_bytes(), output); - assert_fuel_consumed_within_threshold(258_852, fuel_consumed); + assert_fuel_consumed_within_threshold(218_527, fuel_consumed); let (output, _, _) = run(&mut runner, "invalid".as_bytes()); assert_eq!("true".as_bytes(), output); @@ -67,7 +67,7 @@ fn test_logging() { "hello world from console.log\nhello world from console.error\n", logs.as_str(), ); - assert_fuel_consumed_within_threshold(22_296, fuel_consumed); + assert_fuel_consumed_within_threshold(34169, fuel_consumed); } #[test] @@ -76,7 +76,7 @@ fn test_readme_script() { let (output, _, fuel_consumed) = run(&mut runner, r#"{ "n": 2, "bar": "baz" }"#.as_bytes()); assert_eq!(r#"{"foo":3,"newBar":"baz!"}"#.as_bytes(), output); - assert_fuel_consumed_within_threshold(284_736, fuel_consumed); + assert_fuel_consumed_within_threshold(235_476, fuel_consumed); } #[cfg(feature = "experimental_event_loop")] @@ -98,7 +98,7 @@ fn test_promises() { let err = res.err().unwrap().downcast::().unwrap(); assert!(str::from_utf8(&err.stderr) .unwrap() - .contains("Adding tasks to the event queue is not supported")); + .contains("Pending jobs in the event queue.")); } #[test] @@ -106,7 +106,7 @@ fn test_exported_functions() { let mut runner = Runner::new_with_exports("exported-fn.js", "exported-fn.wit", "exported-fn"); let (_, logs, fuel_consumed) = run_fn(&mut runner, "foo", &[]); assert_eq!("Hello from top-level\nHello from foo\n", logs); - assert_fuel_consumed_within_threshold(54610, fuel_consumed); + assert_fuel_consumed_within_threshold(72552, fuel_consumed); let (_, logs, _) = run_fn(&mut runner, "foo-bar", &[]); assert_eq!("Hello from top-level\nHello from fooBar\n", logs); } @@ -155,7 +155,7 @@ fn test_error_handling() { let result = runner.exec(&[]); let err = result.err().unwrap().downcast::().unwrap(); - let expected_log_output = "Error while running JS: Uncaught Error: error\n at error (function.mjs:2)\n at (function.mjs:5)\n\n"; + let expected_log_output = "Error:2:9 error\n at error (function.mjs:2:9)\n at (function.mjs:5:1)\n\n"; assert_eq!(expected_log_output, str::from_utf8(&err.stderr).unwrap()); } @@ -180,7 +180,7 @@ fn test_exported_default_arrow_fn() { ); let (_, logs, fuel_consumed) = run_fn(&mut runner, "default", &[]); assert_eq!(logs, "42\n"); - assert_fuel_consumed_within_threshold(48_628, fuel_consumed); + assert_fuel_consumed_within_threshold(67547, fuel_consumed); } #[test] @@ -192,7 +192,7 @@ fn test_exported_default_fn() { ); let (_, logs, fuel_consumed) = run_fn(&mut runner, "default", &[]); assert_eq!(logs, "42\n"); - assert_fuel_consumed_within_threshold(49_748, fuel_consumed); + assert_fuel_consumed_within_threshold(67792, fuel_consumed); } fn run_with_u8s(r: &mut Runner, stdin: u8) -> (u8, String, u64) { diff --git a/crates/core/src/execution.rs b/crates/core/src/execution.rs index 992aacd9..9e026b39 100644 --- a/crates/core/src/execution.rs +++ b/crates/core/src/execution.rs @@ -1,39 +1,85 @@ use std::process; -use anyhow::{bail, Error, Result}; -use javy::{quickjs::JSContextRef, Runtime}; +use anyhow::{anyhow, bail, Error, Result}; +use javy::{ + from_js_error, + quickjs::{context::EvalOptions, Module, Value}, + to_js_error, Runtime, +}; +static EVENT_LOOP_ERR: &str = r#" + Pending jobs in the event queue. + Scheduling events is not supported when the + experimental_event_loop cargo feature is disabled. + "#; + +/// Evaluate the given bytecode. +/// +/// Evaluating also prepares (or "instantiates") the state of the JavaScript +/// engine given all the information encoded in the bytecode. pub fn run_bytecode(runtime: &Runtime, bytecode: &[u8]) { - let context = runtime.context(); - context - .eval_binary(bytecode) - .and_then(|_| process_event_loop(context)) - .unwrap_or_else(handle_error); + runtime + .context() + .with(|this| { + let module = unsafe { Module::load(this.clone(), bytecode)? }; + let (_, promise) = module.eval()?; + + if cfg!(feature = "experimental_event_loop") { + // If the experimental event loop is enabled, trigger it. + promise.finish::().map(|_| ()) + } else { + // Else we simply expect the promise to resolve immediately. + match promise.result() { + None => Err(to_js_error(this, anyhow!(EVENT_LOOP_ERR))), + Some(r) => r, + } + } + }) + .map_err(|e| runtime.context().with(|cx| from_js_error(cx.clone(), e))) + // Prefer calling `process_event_loop` *outside* of the `with` callback, + // to avoid errors regarding multiple mutable borrows. + .and_then(|_| process_event_loop(runtime)) + .unwrap_or_else(handle_error) } +/// Entry point to invoke an exported JavaScript function. +/// +/// This function will evaluate a JavaScript snippet that imports and invokes +/// the target function from a previously evaluated module. It's the caller's +/// reponsibility to ensure that the module containing the target function has +/// been previously evaluated. pub fn invoke_function(runtime: &Runtime, fn_module: &str, fn_name: &str) { - let context = runtime.context(); let js = if fn_name == "default" { format!("import {{ default as defaultFn }} from '{fn_module}'; defaultFn();") } else { format!("import {{ {fn_name} }} from '{fn_module}'; {fn_name}();") }; - context - .eval_module("runtime.mjs", &js) - .and_then(|_| process_event_loop(context)) - .unwrap_or_else(handle_error); + + runtime + .context() + .with(|this| { + let mut opts = EvalOptions::default(); + opts.strict = false; + opts.global = false; + this.eval_with_options::, _>(js, opts) + .map_err(|e| from_js_error(this.clone(), e)) + .map(|_| ()) + }) + .and_then(|_: ()| process_event_loop(runtime)) + .unwrap_or_else(handle_error) } -fn process_event_loop(context: &JSContextRef) -> Result<()> { +fn process_event_loop(rt: &Runtime) -> Result<()> { if cfg!(feature = "experimental_event_loop") { - context.execute_pending()?; - } else if context.is_pending() { - bail!("Adding tasks to the event queue is not supported"); + rt.resolve_pending_jobs()? + } else if rt.has_pending_jobs() { + bail!(EVENT_LOOP_ERR); } + Ok(()) } fn handle_error(e: Error) { - eprintln!("Error while running JS: {e}"); + eprintln!("{e}"); process::abort(); } diff --git a/crates/core/src/lib.rs b/crates/core/src/lib.rs index 5a56a940..c4a53db9 100644 --- a/crates/core/src/lib.rs +++ b/crates/core/src/lib.rs @@ -1,3 +1,4 @@ +use anyhow::anyhow; use javy::Runtime; use once_cell::sync::OnceCell; use std::slice; @@ -12,11 +13,18 @@ static mut COMPILE_SRC_RET_AREA: [u32; 2] = [0; 2]; static mut RUNTIME: OnceCell = OnceCell::new(); -/// Used by Wizer to preinitialize the module +/// Used by Wizer to preinitialize the module. #[export_name = "wizer.initialize"] pub extern "C" fn init() { let runtime = runtime::new_runtime().unwrap(); - unsafe { RUNTIME.set(runtime).unwrap() }; + unsafe { + RUNTIME + .set(runtime) + // `set` requires `T` to implement `Debug` but quickjs::{Runtime, + // Context} don't. + .map_err(|_| anyhow!("Could not pre-initialize javy::Runtime")) + .unwrap(); + }; } /// Compiles JS source code to QuickJS bytecode. @@ -37,15 +45,16 @@ pub unsafe extern "C" fn compile_src(js_src_ptr: *const u8, js_src_len: usize) - // Use fresh runtime to avoid depending on Wizened runtime let runtime = runtime::new_runtime().unwrap(); let js_src = str::from_utf8(slice::from_raw_parts(js_src_ptr, js_src_len)).unwrap(); + let bytecode = runtime - .context() - .compile_module(FUNCTION_MODULE_NAME, js_src) + .compile_to_bytecode(FUNCTION_MODULE_NAME, js_src) .unwrap(); - let bytecode_len = bytecode.len(); + // We need the bytecode buffer to live longer than this function so it can be read from memory + let len = bytecode.len(); let bytecode_ptr = Box::leak(bytecode.into_boxed_slice()).as_ptr(); COMPILE_SRC_RET_AREA[0] = bytecode_ptr as u32; - COMPILE_SRC_RET_AREA[1] = bytecode_len.try_into().unwrap(); + COMPILE_SRC_RET_AREA[1] = len.try_into().unwrap(); COMPILE_SRC_RET_AREA.as_ptr() } diff --git a/crates/core/src/main.rs b/crates/core/src/main.rs index 33056bcc..f3698119 100644 --- a/crates/core/src/main.rs +++ b/crates/core/src/main.rs @@ -1,3 +1,4 @@ +use anyhow::anyhow; use javy::Runtime; use once_cell::sync::OnceCell; use std::io::{self, Read}; @@ -21,13 +22,18 @@ pub extern "C" fn init() { let mut contents = String::new(); io::stdin().read_to_string(&mut contents).unwrap(); + let bytecode = runtime - .context() - .compile_module("function.mjs", &contents) + .compile_to_bytecode(FUNCTION_MODULE_NAME, &contents) .unwrap(); unsafe { - RUNTIME.set(runtime).unwrap(); + RUNTIME + .set(runtime) + // `set` requires `T` to implement `Debug` but quickjs::{Runtime, + // Context} don't. + .map_err(|_| anyhow!("Could not pre-initialize javy::Runtime")) + .unwrap(); BYTECODE.set(bytecode).unwrap(); } } diff --git a/crates/javy/CHANGELOG.md b/crates/javy/CHANGELOG.md index 68f15a2d..79e711b0 100644 --- a/crates/javy/CHANGELOG.md +++ b/crates/javy/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Introduce `rquickjs` to interface with QuickJS instead of `quickjs-wasm-rs`; + this version no longer includes re-exports from `quickjs-wasm-rs`. + ## [2.2.0] - 2024-01-31 ### Fixed diff --git a/crates/javy/Cargo.toml b/crates/javy/Cargo.toml index e7f0cda6..ffa02f2f 100644 --- a/crates/javy/Cargo.toml +++ b/crates/javy/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "javy" -version = "2.2.1-alpha.1" +version = "3.0.0-alpha.1" authors.workspace = true edition.workspace = true license.workspace = true @@ -11,10 +11,14 @@ categories = ["wasm"] [dependencies] anyhow = { workspace = true } -quickjs-wasm-rs = { version = "3.1.0-alpha.1", path = "../quickjs-wasm-rs" } +rquickjs = { git = "https://github.com/Shopify/rquickjs", branch = "improved-wasm-support", features = ["array-buffer", "bindgen", "no-free"] } +serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", optional = true } serde-transcode = { version = "1.1", optional = true } rmp-serde = { version = "^1.1", optional = true } +# TODO: cargo doesn't seem to pickup the fact that quickcheck is only used for +# tests. +quickcheck = "1" [features] export_alloc_fns = [] diff --git a/crates/javy/README.md b/crates/javy/README.md index 0a0760ff..43ad13b5 100644 --- a/crates/javy/README.md +++ b/crates/javy/README.md @@ -2,31 +2,35 @@ A configurable JavaScript runtime for WebAssembly. -Uses QuickJS through the `quickjs-wasm-rs` crate to evalulate JavaScript source code or QuickJS bytecode. +Uses QuickJS through the [`rquickjs`](https://docs.rs/rquickjs/latest/rquickjs/) +crate to evalulate JavaScript source code or QuickJS bytecode. ## Example usage ```rust -use anyhow::{anyhow, Result}; -use javy::{quickjs::JSValue, Runtime}; - -fn main() -> Result<()> { - let runtime = Runtime::default(); - let context = runtime.context(); - context.global_object()?.set_property( - "print", - context.wrap_callback(move |_ctx, _this, args| { - let str = args - .first() - .ok_or(anyhow!("Need to pass an argument"))? - .to_string(); - println!("{str}"); - Ok(JSValue::Undefined) - })?, +use anyhow::anyhow; +use javy::{Runtime, from_js_error}; +let runtime = Runtime::default(); +let context = runtime.context(); + +context.with(|cx| { + let globals = this.globals(); + globals.set( + "print_hello", + Function::new( + this.clone(), + MutFn::new(move |_, _| { + println!("Hello, world!"); + }), + )?, )?; - context.eval_global("hello.js", "print('hello!');")?; - Ok(()) -} + }); + +context.with(|cx| { + cx.eval_with_options(Default::default(), "print_hello();") + .map_err(|e| from_js_error(cx.clone(), e)) + .map(|_| ()) +}); ``` Create a `Runtime` and use the reference returned by `context()` to add functions and evaluate source code. @@ -40,7 +44,3 @@ Create a `Runtime` and use the reference returned by `context()` to add function ## Publishing to crates.io To publish this crate to crates.io, run `./publish.sh`. - -## Using a custom WASI SDK - -This crate can be compiled using a custom [WASI SDK](https://github.com/WebAssembly/wasi-sdk). When building this crate, set the `QUICKJS_WASM_SYS_WASI_SDK_PATH` environment variable to the absolute path where you installed the SDK. diff --git a/crates/javy/src/json.rs b/crates/javy/src/json.rs index 1ef15ffd..6d337321 100644 --- a/crates/javy/src/json.rs +++ b/crates/javy/src/json.rs @@ -1,21 +1,17 @@ +use crate::quickjs::{Ctx, Value}; +use crate::serde::{de::Deserializer, ser::Serializer}; use anyhow::Result; -use quickjs_wasm_rs::{Deserializer, JSContextRef, JSValueRef, Serializer}; -/// Transcodes a byte slice containing a JSON encoded payload into a [`JSValueRef`]. -/// -/// Arguments: -/// * `context` - A reference to the [`JSContextRef`] that will contain the -/// returned [`JSValueRef`]. -/// * `bytes` - A byte slice containing a JSON encoded payload. -pub fn transcode_input<'a>(context: &'a JSContextRef, bytes: &[u8]) -> Result> { +/// Transcodes a byte slice containing a JSON encoded payload into a [Value]. +pub fn transcode_input<'js>(context: Ctx<'js>, bytes: &[u8]) -> Result> { let mut deserializer = serde_json::Deserializer::from_slice(bytes); let mut serializer = Serializer::from_context(context)?; serde_transcode::transcode(&mut deserializer, &mut serializer)?; Ok(serializer.value) } -/// Transcodes a [`JSValueRef`] into a JSON encoded byte vector. -pub fn transcode_output(val: JSValueRef) -> Result> { +/// Transcodes a [Value] into a slice of JSON bytes. +pub fn transcode_output(val: Value<'_>) -> Result> { let mut output = Vec::new(); let mut deserializer = Deserializer::from(val); let mut serializer = serde_json::Serializer::new(&mut output); diff --git a/crates/javy/src/lib.rs b/crates/javy/src/lib.rs index ad0ffa09..3471a110 100644 --- a/crates/javy/src/lib.rs +++ b/crates/javy/src/lib.rs @@ -2,28 +2,29 @@ //! //! Example usage: //! ``` -//! # use anyhow::anyhow; -//! # use javy::{quickjs::JSValue, Runtime}; +//! use anyhow::anyhow; +//! use javy::{Runtime, from_js_error}; //! let runtime = Runtime::default(); //! let context = runtime.context(); -//! context -//! .global_object() -//! .unwrap() -//! .set_property( -//! "print", -//! context -//! .wrap_callback(move |_ctx, _this, args| { -//! let str = args -//! .first() -//! .ok_or(anyhow!("Need to pass an argument"))? -//! .to_string(); -//! println!("{str}"); -//! Ok(JSValue::Undefined) -//! }) -//! .unwrap(), -//! ) -//! .unwrap(); -//! context.eval_global("hello.js", "print('hello!');").unwrap(); +//! +//! context.with(|cx| { +//! let globals = this.globals(); +//! globals.set( +//! "print_hello", +//! Function::new( +//! this.clone(), +//! MutFn::new(move |_, _| { +//! println!("Hello, world!"); +//! }), +//! )?, +//! )?; +//! }); +//! +//! context.with(|cx| { +//! cx.eval_with_options(Default::default(), "print_hello();") +//! .map_err(|e| from_js_error(cx.clone(), e)) +//! .map(|_| ()) +//! }); //! ``` //! //! ## Core concepts @@ -40,15 +41,173 @@ //! and MessagePack byte slices pub use config::Config; -pub use quickjs_wasm_rs as quickjs; +pub use rquickjs as quickjs; pub use runtime::Runtime; +use std::str; pub mod alloc; mod config; mod runtime; +mod serde; + +use anyhow::{anyhow, Error, Result}; +use rquickjs::{ + prelude::Rest, qjs, Ctx, Error as JSError, Exception, String as JSString, Type, Value, +}; +use std::fmt::Write; #[cfg(feature = "messagepack")] pub mod messagepack; #[cfg(feature = "json")] pub mod json; + +/// Print the given JS value. +/// +/// The implementation matches the default JavaScript display format for each value. +pub fn print(val: &Value, sink: &mut String) -> Result<()> { + match val.type_of() { + Type::Undefined => write!(sink, "undefined").map_err(Into::into), + Type::Null => write!(sink, "null").map_err(Into::into), + Type::Bool => { + let b = val.as_bool().unwrap(); + write!(sink, "{}", b).map_err(Into::into) + } + Type::Int => { + let i = val.as_int().unwrap(); + write!(sink, "{}", i).map_err(Into::into) + } + Type::Float => { + let f = val.as_float().unwrap(); + write!(sink, "{}", f).map_err(Into::into) + } + Type::String => { + let s = val.as_string().unwrap(); + write!(sink, "{}", s.to_string()?).map_err(Into::into) + } + Type::Array => { + let inner = val.as_array().unwrap(); + for e in inner.iter() { + print(&e?, sink)? + } + Ok(()) + } + Type::Object => write!(sink, "[object Object]").map_err(Into::into), + // TODO: Implement the rest. + x => unimplemented!("{x}"), + } +} + +/// A struct to hold the current [`Ctx`] and [`Value`]s passed as arguments to Rust +/// functions. +/// A struct here is used to explicitly tie these values with a particular +/// lifetime. +// +// See: https://github.com/rust-lang/rfcs/pull/3216 +pub struct Args<'js>(Ctx<'js>, Rest>); + +impl<'js> Args<'js> { + /// Tie the [Ctx] and [Rest]. + pub fn hold(cx: Ctx<'js>, args: Rest>) -> Self { + Self(cx, args) + } + + /// Get the [Ctx] and [Rest]. + pub fn release(self) -> (Ctx<'js>, Rest>) { + (self.0, self.1) + } +} + +/// Alias for `Args::hold(cx, args).release()` +#[macro_export] +macro_rules! hold_and_release { + ($cx:expr, $args:expr) => { + Args::hold($cx, $args).release() + }; +} + +/// Alias for [Args::hold] +#[macro_export] +macro_rules! hold { + ($cx:expr, $args:expr) => { + Args::hold($cx, $args) + }; +} + +/// Handles a JavaScript error or exception and converts to [anyhow::Error]. +pub fn from_js_error(ctx: Ctx<'_>, e: JSError) -> Error { + if e.is_exception() { + let exception = ctx.catch().into_exception().unwrap(); + anyhow!("{exception}") + } else { + Into::into(e) + } +} + +/// Converts an [`anyhow::Error`] to a [`JSError`]. +/// +/// If the error is an [`anyhow::Error`] this function will construct and throw +/// a JS [`Exception`] in order to construct the [`JSError`]. +pub fn to_js_error(cx: Ctx, e: Error) -> JSError { + match e.downcast::() { + Ok(e) => e, + Err(e) => cx.throw(Value::from_exception( + Exception::from_message(cx.clone(), &e.to_string()) + .expect("creating an exception to succeed"), + )), + } +} + +/// Converts the JavaScript value to a string, replacing any invalid UTF-8 sequences with the +/// Unicode replacement character (U+FFFD). +// TODO: Upstream this? +pub fn to_string_lossy<'js>(cx: &Ctx<'js>, string: &JSString<'js>, error: JSError) -> String { + let mut len: qjs::size_t = 0; + let ptr = unsafe { qjs::JS_ToCStringLen2(cx.as_raw().as_ptr(), &mut len, string.as_raw(), 0) }; + let buffer = unsafe { std::slice::from_raw_parts(ptr as *const u8, len as usize) }; + + // The error here *must* be a Utf8 error; the `JSString::to_string()` may + // return `JSError::Unknown`, but at that point, something else has gone + // wrong too. + + let mut utf8_error = match error { + JSError::Utf8(e) => e, + _ => unreachable!("expected Utf8 error"), + }; + let mut res = String::new(); + let mut buffer = buffer; + loop { + let (valid, after_valid) = buffer.split_at(utf8_error.valid_up_to()); + res.push_str(unsafe { str::from_utf8_unchecked(valid) }); + res.push(char::REPLACEMENT_CHARACTER); + + // see https://simonsapin.github.io/wtf-8/#surrogate-byte-sequence + let lone_surrogate = matches!(after_valid, [0xED, 0xA0..=0xBF, 0x80..=0xBF, ..]); + + // https://simonsapin.github.io/wtf-8/#converting-wtf-8-utf-8 states that each + // 3-byte lone surrogate sequence should be replaced by 1 UTF-8 replacement + // char. Rust's `Utf8Error` reports each byte in the lone surrogate byte + // sequence as a separate error with an `error_len` of 1. Since we insert a + // replacement char for each error, this results in 3 replacement chars being + // inserted. So we use an `error_len` of 3 instead of 1 to treat the entire + // 3-byte sequence as 1 error instead of as 3 errors and only emit 1 + // replacement char. + let error_len = if lone_surrogate { + 3 + } else { + utf8_error + .error_len() + .expect("Error length should always be available on underlying buffer") + }; + + buffer = &after_valid[error_len..]; + match str::from_utf8(buffer) { + Ok(valid) => { + res.push_str(valid); + break; + } + Err(e) => utf8_error = e, + } + } + res +} diff --git a/crates/javy/src/messagepack.rs b/crates/javy/src/messagepack.rs index 8f68648b..a0c42952 100644 --- a/crates/javy/src/messagepack.rs +++ b/crates/javy/src/messagepack.rs @@ -1,5 +1,6 @@ +use crate::quickjs::{Ctx, Value}; +use crate::serde::{de::Deserializer, ser::Serializer}; use anyhow::Result; -use quickjs_wasm_rs::{Deserializer, JSContextRef, JSValueRef, Serializer}; /// Transcodes a byte slice containing a MessagePack encoded payload into a [`JSValueRef`]. /// @@ -7,15 +8,15 @@ use quickjs_wasm_rs::{Deserializer, JSContextRef, JSValueRef, Serializer}; /// * `context` - A reference to the [`JSContextRef`] that will contain the /// returned [`JSValueRef`]. /// * `bytes` - A byte slice containing a MessagePack encoded payload. -pub fn transcode_input<'a>(context: &'a JSContextRef, bytes: &[u8]) -> Result> { +pub fn transcode_input<'js>(context: Ctx<'js>, bytes: &[u8]) -> Result> { let mut deserializer = rmp_serde::Deserializer::from_read_ref(bytes); - let mut serializer = Serializer::from_context(context)?; + let mut serializer = Serializer::from_context(context.clone())?; serde_transcode::transcode(&mut deserializer, &mut serializer)?; Ok(serializer.value) } /// Transcodes a [`JSValueRef`] into a MessagePack encoded byte vector. -pub fn transcode_output(val: JSValueRef) -> Result> { +pub fn transcode_output(val: Value<'_>) -> Result> { let mut output = Vec::new(); let mut deserializer = Deserializer::from(val); let mut serializer = rmp_serde::Serializer::new(&mut output); diff --git a/crates/javy/src/runtime.rs b/crates/javy/src/runtime.rs index 353e26e2..0355501d 100644 --- a/crates/javy/src/runtime.rs +++ b/crates/javy/src/runtime.rs @@ -1,59 +1,86 @@ -use crate::quickjs::JSContextRef; -use anyhow::Result; +// use crate::quickjs::JSContextRef; +use super::from_js_error; +use anyhow::{bail, Result}; +use rquickjs::{Context, Module, Runtime as QRuntime}; +use std::mem::ManuallyDrop; use crate::Config; /// A JavaScript Runtime. /// -/// Provides a [`Self::context()`] method for working with the underlying [`JSContextRef`]. -/// -/// ## Examples -/// -/// ``` -/// # use anyhow::anyhow; -/// # use javy::{quickjs::JSValue, Runtime}; -/// let runtime = Runtime::default(); -/// let context = runtime.context(); -/// context -/// .global_object() -/// .unwrap() -/// .set_property( -/// "print", -/// context -/// .wrap_callback(move |_ctx, _this, args| { -/// let str = args -/// .first() -/// .ok_or(anyhow!("Need to pass an argument"))? -/// .to_string(); -/// println!("{str}"); -/// Ok(JSValue::Undefined) -/// }) -/// .unwrap(), -/// ) -/// .unwrap(); -/// context.eval_global("hello.js", "print('hello!');").unwrap(); -/// ``` -#[derive(Debug)] +/// Javy's [`Runtime`] holds a [`rquickjs::Runtime`] and [`rquickjs::Context`], +/// and provides accessors these two propoerties which enable working with +/// [`rquickjs`] APIs. pub struct Runtime { - context: JSContextRef, + /// The QuickJS context. + // We use `ManuallyDrop` to avoid incurring in the cost of dropping the + // `rquickjs::Context` and its associated objects, which takes a substantial + // amount of time. + // + // This assumes that Javy is used for short-lived programs where the host + // will collect the instance's memory when execution ends, making these + // drops unnecessary. + // + // This might not be suitable for all use-cases, so we'll make this + // behaviour configurable. + context: ManuallyDrop, + /// The inner QuickJS runtime representation. + // Read above on the usage of `ManuallyDrop`. + inner: ManuallyDrop, } impl Runtime { - /// Creates a new [`Runtime`]. + /// Creates a new [Runtime]. pub fn new(_config: Config) -> Result { - let context = JSContextRef::default(); - Ok(Self { context }) + let rt = ManuallyDrop::new(QRuntime::new()?); + + // See comment above about configuring GC behaviour. + rt.set_gc_threshold(usize::MAX); + let context = ManuallyDrop::new(Context::full(&rt)?); + Ok(Self { inner: rt, context }) } - /// A reference to a [`JSContextRef`]. - pub fn context(&self) -> &JSContextRef { + /// A reference to the inner [Context]. + pub fn context(&self) -> &Context { &self.context } + + /// Resolves all the pending jobs in the queue. + pub fn resolve_pending_jobs(&self) -> Result<()> { + if self.inner.is_job_pending() { + loop { + let result = self.inner.execute_pending_job(); + if let Ok(false) = result { + break; + } + + if let Err(e) = result { + bail!("{e}") + } + } + } + + Ok(()) + } + + /// Returns true if there are pending jobs in the queue. + pub fn has_pending_jobs(&self) -> bool { + self.inner.is_job_pending() + } + + /// Compiles the given module to bytecode. + pub fn compile_to_bytecode(&self, name: &str, contents: &str) -> Result> { + self.context() + .with(|this| Module::declare(this.clone(), name, contents)?.write_le()) + .map_err(|e| self.context().with(|cx| from_js_error(cx.clone(), e))) + } } impl Default for Runtime { - /// Returns a [`Runtime`] with a default configuration. Panics if there's - /// an error. + /// Returns a [`Runtime`] with a default configuration. + /// + /// # Panics + /// This function panics if there is an error setting up the runtime. fn default() -> Self { Self::new(Config::default()).unwrap() } diff --git a/crates/javy/src/serde/de.rs b/crates/javy/src/serde/de.rs new file mode 100644 index 00000000..6b638e3b --- /dev/null +++ b/crates/javy/src/serde/de.rs @@ -0,0 +1,428 @@ +use crate::quickjs::{object::ObjectIter, Array, Filter, Value}; +use crate::serde::err::{Error, Result}; +use crate::serde::{MAX_SAFE_INTEGER, MIN_SAFE_INTEGER}; +use crate::{from_js_error, to_string_lossy}; +use anyhow::anyhow; +use serde::de::{self, Error as SerError}; +use serde::forward_to_deserialize_any; + +use super::as_key; + +impl SerError for Error { + fn custom(msg: T) -> Self { + Error::Custom(anyhow!(msg.to_string())) + } +} + +/// `Deserializer` is a deserializer for [Value] values, implementing the `serde::Deserializer` trait. +/// +/// This struct is responsible for converting [Value], into Rust types using the Serde deserialization framework. +/// +/// # Example +/// +/// ``` +/// // Assuming you have a [Value] instance named value containing an i32. +/// let mut deserializer = Deserializer::from(value); +/// +/// // Use deserializer to deserialize the JavaScript value into a Rust type. +/// let number: i32 = serde::Deserialize::deserialize(deserializer)?; +/// ``` +pub struct Deserializer<'js> { + value: Value<'js>, + map_key: bool, + current_kv: Option<(Value<'js>, Value<'js>)>, +} + +impl<'de> From> for Deserializer<'de> { + fn from(value: Value<'de>) -> Self { + Self { + value, + map_key: false, + current_kv: None, + } + } +} +impl<'js> Deserializer<'js> { + fn deserialize_number<'de, V>(&mut self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + if self.value.is_int() { + return visitor.visit_i32( + self.value + .as_int() + .ok_or_else(|| anyhow!("Failed to convert value to i32"))?, + ); + } + + if self.value.is_float() { + let f64_representation = self + .value + .as_float() + .ok_or_else(|| anyhow!("Failed to convert value to f64"))?; + let is_positive = f64_representation.is_sign_positive(); + let safe_integer_range = (MIN_SAFE_INTEGER as f64)..=(MAX_SAFE_INTEGER as f64); + let whole = f64_representation.fract() == 0.0; + + if whole && is_positive && f64_representation <= u32::MAX as f64 { + return visitor.visit_u32(f64_representation as u32); + } + + if whole && safe_integer_range.contains(&f64_representation) { + let x = f64_representation as i64; + return visitor.visit_i64(x); + } + + return visitor.visit_f64(f64_representation); + } + unreachable!() + } +} + +impl<'de, 'a> de::Deserializer<'de> for &'a mut Deserializer<'de> { + type Error = Error; + + fn deserialize_any(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + if self.value.is_number() { + return self.deserialize_number(visitor); + } + + if self.value.is_bool() { + let val = self.value.as_bool().unwrap(); + return visitor.visit_bool(val); + } + + if self.value.is_null() || self.value.is_undefined() { + return visitor.visit_unit(); + } + + if self.value.is_string() { + if self.map_key { + self.map_key = false; + let key = as_key(&self.value)?; + return visitor.visit_str(&key); + } else { + let val = self + .value + .as_string() + .map(|s| { + s.to_string() + .unwrap_or_else(|e| to_string_lossy(self.value.ctx(), s, e)) + }) + .unwrap(); + return visitor.visit_str(&val); + } + } + + if self.value.is_array() { + let arr = self.value.as_array().unwrap().clone(); + let length = arr.len(); + let seq_access = SeqAccess { + de: self, + length, + seq: arr, + index: 0, + }; + return visitor.visit_seq(seq_access); + } + + if self.value.is_object() { + let filter = Filter::new().enum_only().symbol().string(); + let obj = self.value.as_object().unwrap(); + let properties: ObjectIter<'_, _, Value<'_>> = + obj.own_props::, Value<'_>>(filter); + let map_access = MapAccess { + de: self, + properties, + }; + return visitor.visit_map(map_access); + } + + Err(Error::Custom(anyhow!( + "Couldn't deserialize value: {:?}", + self.value + ))) + } + + fn is_human_readable(&self) -> bool { + false + } + + fn deserialize_option(self, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + if self.value.is_null() || self.value.is_undefined() { + visitor.visit_none() + } else { + visitor.visit_some(self) + } + } + + fn deserialize_newtype_struct(self, _name: &'static str, visitor: V) -> Result + where + V: de::Visitor<'de>, + { + visitor.visit_newtype_struct(self) + } + + fn deserialize_enum( + self, + _name: &'static str, + _variants: &'static [&'static str], + _visitor: V, + ) -> Result + where + V: de::Visitor<'de>, + { + unimplemented!() + } + + forward_to_deserialize_any! { + bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str string + bytes byte_buf unit unit_struct seq tuple + tuple_struct map struct identifier ignored_any + } +} + +struct MapAccess<'a, 'de: 'a> { + de: &'a mut Deserializer<'de>, + properties: ObjectIter<'de, Value<'de>, Value<'de>>, +} + +impl<'a, 'de> de::MapAccess<'de> for MapAccess<'a, 'de> { + type Error = Error; + + fn next_key_seed(&mut self, seed: K) -> Result> + where + K: de::DeserializeSeed<'de>, + { + if let Some(kv) = self.properties.next() { + let (k, v) = kv.map_err(|e| from_js_error(self.de.value.ctx().clone(), e))?; + self.de.value = k.clone(); + self.de.map_key = true; + self.de.current_kv = Some((k, v)); + seed.deserialize(&mut *self.de).map(Some) + } else { + Ok(None) + } + } + + fn next_value_seed(&mut self, seed: V) -> Result + where + V: de::DeserializeSeed<'de>, + { + self.de.value = self.de.current_kv.clone().unwrap().1; + seed.deserialize(&mut *self.de) + } +} + +struct SeqAccess<'a, 'de: 'a> { + de: &'a mut Deserializer<'de>, + seq: Array<'de>, + length: usize, + index: usize, +} + +impl<'a, 'de> de::SeqAccess<'de> for SeqAccess<'a, 'de> { + type Error = Error; + + fn next_element_seed(&mut self, seed: T) -> Result> + where + T: de::DeserializeSeed<'de>, + { + if self.index < self.length { + self.de.value = self + .seq + .get(self.index) + .map_err(|e| from_js_error(self.seq.ctx().clone(), e))?; + self.index += 1; + seed.deserialize(&mut *self.de).map(Some) + } else { + Ok(None) + } + } +} + +#[cfg(test)] +mod tests { + use std::collections::BTreeMap; + + use super::Deserializer as ValueDeserializer; + use crate::{quickjs::Value, serde::MAX_SAFE_INTEGER, Runtime}; + use serde::de::DeserializeOwned; + + fn deserialize_value(v: Value<'_>) -> T + where + T: DeserializeOwned, + { + let mut deserializer = ValueDeserializer::from(v); + T::deserialize(&mut deserializer).unwrap() + } + + #[test] + fn test_null() { + let rt = Runtime::default(); + rt.context().with(|cx| { + let val = Value::new_null(cx); + deserialize_value::<()>(val); + }); + } + + #[test] + fn test_undefined() { + let rt = Runtime::default(); + rt.context().with(|cx| { + let val = Value::new_undefined(cx); + deserialize_value::<()>(val); + }); + } + + #[test] + fn test_nan() { + let rt = Runtime::default(); + rt.context().with(|cx| { + let val = Value::new_float(cx, f64::NAN); + let actual = deserialize_value::(val); + assert!(actual.is_nan()); + }); + } + + #[test] + fn test_infinity() { + let rt = Runtime::default(); + + rt.context().with(|cx| { + let val = Value::new_float(cx, f64::INFINITY); + let actual = deserialize_value::(val); + assert!(actual.is_infinite() && actual.is_sign_positive()); + }); + } + + #[test] + fn test_negative_infinity() { + let rt = Runtime::default(); + rt.context().with(|cx| { + let val = Value::new_float(cx, f64::NEG_INFINITY); + let actual = deserialize_value::(val); + assert!(actual.is_infinite() && actual.is_sign_negative()); + }) + } + + #[test] + fn test_map_always_converts_keys_to_string() { + let rt = Runtime::default(); + // Sanity check to make sure the quickjs VM always store object + // object keys as a string an not a numerical value. + rt.context().with(|c| { + c.eval::, _>("var a = {1337: 42};").unwrap(); + let val = c.globals().get("a").unwrap(); + let actual = deserialize_value::>(val); + + assert_eq!(42, *actual.get("1337").unwrap()) + }); + } + + #[test] + #[should_panic] + fn test_map_does_not_support_non_string_keys() { + let rt = Runtime::default(); + // Sanity check to make sure it's not possible to deserialize + // to a map where keys are not strings (e.g. numerical value). + rt.context().with(|c| { + c.eval::, _>("var a = {1337: 42};").unwrap(); + let val = c.globals().get("a").unwrap(); + deserialize_value::>(val); + }); + } + + #[test] + fn test_u64_bounds() { + let rt = Runtime::default(); + rt.context().with(|c| { + let max = u64::MAX; + let val = Value::new_number(c.clone(), max as f64); + let actual = deserialize_value::(val); + assert_eq!(max as f64, actual); + + let min = u64::MIN; + let val = Value::new_number(c.clone(), min as f64); + let actual = deserialize_value::(val); + assert_eq!(min as f64, actual); + }); + } + + #[test] + fn test_i64_bounds() { + let rt = Runtime::default(); + + rt.context().with(|c| { + let max = i64::MAX; + let val = Value::new_number(c.clone(), max as _); + let actual = deserialize_value::(val); + assert_eq!(max as f64, actual); + + let min = i64::MIN; + let val = Value::new_number(c.clone(), min as _); + let actual = deserialize_value::(val); + assert_eq!(min as f64, actual); + }); + } + + #[test] + fn test_float_to_integer_conversion() { + let rt = Runtime::default(); + + rt.context().with(|c| { + let expected = MAX_SAFE_INTEGER - 1; + let val = Value::new_float(c.clone(), expected as _); + let actual = deserialize_value::(val); + assert_eq!(expected, actual); + + let expected = MAX_SAFE_INTEGER + 1; + let val = Value::new_float(c.clone(), expected as _); + let actual = deserialize_value::(val); + assert_eq!(expected as f64, actual); + }); + } + + #[test] + fn test_u32_upper_bound() { + let rt = Runtime::default(); + + rt.context().with(|c| { + let expected = u32::MAX; + let val = Value::new_number(c, expected as _); + let actual = deserialize_value::(val); + assert_eq!(expected, actual); + }); + } + + #[test] + fn test_u32_lower_bound() { + let rt = Runtime::default(); + + rt.context().with(|cx| { + let expected = i32::MAX as u32 + 1; + let val = Value::new_number(cx, expected as _); + let actual = deserialize_value::(val); + assert_eq!(expected, actual); + }); + } + + #[test] + fn test_array() { + let rt = Runtime::default(); + rt.context().with(|cx| { + cx.eval::, _>("var a = [1, 2, 3];").unwrap(); + let v = cx.globals().get("a").unwrap(); + + let val = deserialize_value::>(v); + + assert_eq!(vec![1, 2, 3], val); + }); + } +} diff --git a/crates/javy/src/serde/err.rs b/crates/javy/src/serde/err.rs new file mode 100644 index 00000000..622ca6e1 --- /dev/null +++ b/crates/javy/src/serde/err.rs @@ -0,0 +1,23 @@ +use std::{error, fmt}; +pub type Result = std::result::Result; + +#[derive(Debug)] +pub enum Error { + Custom(anyhow::Error), +} + +impl error::Error for Error {} + +impl fmt::Display for Error { + fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { + match self { + Error::Custom(e) => formatter.write_str(&e.to_string()), + } + } +} + +impl From for Error { + fn from(e: anyhow::Error) -> Self { + Error::Custom(e) + } +} diff --git a/crates/javy/src/serde/mod.rs b/crates/javy/src/serde/mod.rs new file mode 100644 index 00000000..93e9fb72 --- /dev/null +++ b/crates/javy/src/serde/mod.rs @@ -0,0 +1,304 @@ +pub mod de; +pub mod err; +pub mod ser; + +use crate::quickjs::Value; +use crate::to_string_lossy; + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MAX_SAFE_INTEGER#description +pub const MAX_SAFE_INTEGER: i64 = 2_i64.pow(53) - 1; + +// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/MIN_SAFE_INTEGER#description +pub const MIN_SAFE_INTEGER: i64 = -MAX_SAFE_INTEGER; + +fn as_key(v: &Value) -> anyhow::Result { + if v.is_string() { + let js_str = v.as_string().unwrap(); + let v = js_str + .to_string() + .unwrap_or_else(|e| to_string_lossy(js_str.ctx(), js_str, e)); + Ok(v) + } else { + anyhow::bail!("map keys must be a string") + } +} + +#[cfg(test)] +mod tests { + use super::de::Deserializer as ValueDeserializer; + use super::ser::Serializer as ValueSerializer; + use crate::serde::{MAX_SAFE_INTEGER, MIN_SAFE_INTEGER}; + use crate::Runtime; + use anyhow::Result; + use quickcheck::quickcheck; + use serde::de::DeserializeOwned; + use serde::{Deserialize, Serialize}; + use std::collections::BTreeMap; + + quickcheck! { + fn test_str(expected: String) -> Result { + let actual = do_roundtrip::<_, String>(&expected); + Ok(expected == actual) + } + + fn test_u8(expected: u8) -> Result { + let actual = do_roundtrip::<_, u8>(&expected); + Ok(expected == actual) + } + + fn test_u16(expected: u16) -> Result { + let actual = do_roundtrip::<_, u16>(&expected); + Ok(expected == actual) + } + + fn test_f32(expected: f32) -> quickcheck::TestResult { + if expected.is_nan() { + return quickcheck::TestResult::discard(); + } + + let actual = do_roundtrip::<_, f32>(&expected); + quickcheck::TestResult::from_bool(expected == actual) + } + + fn test_i32(expected: i32) -> Result { + let actual = do_roundtrip::<_, i32>(&expected); + Ok(expected == actual) + } + + // This test is not representative of what is happening in the real world. Since we are transcoding + // from msgpack, only values greather than or equal to u32::MAX would be serialized as `BigInt`. Any other values would + // be serialized as a `number`. + // + // See https://github.com/3Hren/msgpack-rust/blob/aa3c4a77b2b901fe73a555c615b92773b40905fc/rmp/src/encode/sint.rs#L170. + // + // This test works here since we are explicitly calling serialize_i64 and deserialize_i64. + fn test_i64(expected: i64) -> Result { + if (MIN_SAFE_INTEGER..=MAX_SAFE_INTEGER).contains(&expected) { + let actual = do_roundtrip::<_, i64>(&expected); + Ok(expected == actual) + } else { + let expected_f64 = expected as f64; + let actual = do_roundtrip::<_, f64>(&expected_f64); + Ok(expected_f64 == actual) + } + } + + fn test_u32(expected: u32) -> Result { + let actual = do_roundtrip::<_, u32>(&expected); + Ok(expected == actual) + } + + // This test is not representative of what is happening in the real world. Since we are transcoding + // from msgpack, only values larger than i64::MAX would be serialized as BigInt. Any other values would + // be serialized as a number. + // + // See https://github.com/3Hren/msgpack-rust/blob/aa3c4a77b2b901fe73a555c615b92773b40905fc/rmp/src/encode/sint.rs#L170. + // + // This test works here since we are explicitly calling serialize_u64 and deserialize_u64. + fn test_u64(expected: u64) -> Result { + if expected <= MAX_SAFE_INTEGER as u64 { + let actual = do_roundtrip::<_, u64>(&expected); + Ok(expected == actual) + } else { + let expected_f64 = expected as f64; + let actual = do_roundtrip::<_, f64>(&expected_f64); + Ok(expected_f64 == actual) + } + } + + fn test_bool(expected: bool) -> Result { + let actual = do_roundtrip::<_, bool>(&expected); + Ok(expected == actual) + } + } + + #[test] + fn test_map() { + let mut expected = BTreeMap::::new(); + expected.insert("foo".to_string(), "bar".to_string()); + expected.insert("hello".to_string(), "world".to_string()); + + let actual = do_roundtrip::<_, BTreeMap>(&expected); + + assert_eq!(expected, actual); + } + + #[test] + fn test_struct_into_map() { + #[derive(Debug, Serialize, Deserialize, PartialEq)] + struct MyObject { + foo: String, + bar: u32, + } + let expected = MyObject { + foo: "hello".to_string(), + bar: 1337, + }; + + let actual = do_roundtrip::<_, MyObject>(&expected); + + assert_eq!(expected, actual); + } + + #[test] + fn test_nested_maps() { + let mut expected = BTreeMap::>::new(); + let mut a = BTreeMap::new(); + a.insert("foo".to_string(), "bar".to_string()); + a.insert("hello".to_string(), "world".to_string()); + let mut b = BTreeMap::new(); + b.insert("toto".to_string(), "titi".to_string()); + expected.insert("aaa".to_string(), a); + expected.insert("bbb".to_string(), b); + + let actual = do_roundtrip::<_, BTreeMap>>(&expected); + + assert_eq!(expected, actual); + } + + #[test] + fn test_nested_structs_into_maps() { + #[derive(Debug, Serialize, Deserialize, PartialEq)] + struct MyObjectB { + toto: String, + titi: i32, + } + + #[derive(Debug, Serialize, Deserialize, PartialEq)] + struct MyObjectA { + foo: String, + bar: u32, + b: MyObjectB, + } + let expected = MyObjectA { + foo: "hello".to_string(), + bar: 1337, + b: MyObjectB { + toto: "world".to_string(), + titi: -42, + }, + }; + + let actual = do_roundtrip::<_, MyObjectA>(&expected); + + assert_eq!(expected, actual); + } + + #[test] + fn test_sequence() { + let expected = vec!["hello".to_string(), "world".to_string()]; + + let actual = do_roundtrip::<_, Vec>(&expected); + + assert_eq!(expected, actual); + } + + #[test] + fn test_nested_sequences() { + let mut expected = Vec::new(); + let a = vec!["foo".to_string(), "bar".to_string()]; + let b = vec!["toto".to_string(), "tata".to_string()]; + expected.push(a); + expected.push(b); + + let actual = do_roundtrip::<_, Vec>>(&expected); + + assert_eq!(expected, actual); + } + + #[test] + fn test_sanity() { + #[derive(Debug, Serialize, Deserialize, PartialEq)] + struct MyObject { + a: u8, + b: u16, + c: u32, + d: u64, + e: i8, + f: i16, + g: i32, + h: i64, + i: f32, + j: f64, + k: String, + l: bool, + m: BTreeMap, + n: Vec, + o: BTreeMap>, + p: Vec>, + bb: MyObjectB, + } + + #[derive(Debug, Serialize, Deserialize, PartialEq)] + struct MyObjectB { + a: u32, + cc: MyObjectC, + } + + #[derive(Debug, Serialize, Deserialize, PartialEq)] + struct MyObjectC { + a: Vec, + b: BTreeMap, + } + + let mut cc_b = BTreeMap::new(); + cc_b.insert("a".to_string(), 123); + cc_b.insert("b".to_string(), 456); + let cc = MyObjectC { + a: vec![1337, 42], + b: cc_b, + }; + + let bb = MyObjectB { a: 789, cc }; + + let mut m = BTreeMap::new(); + m.insert("a".to_string(), 123); + m.insert("b".to_string(), 456); + m.insert("c".to_string(), 789); + + let mut oo = BTreeMap::new(); + oo.insert("e".to_string(), 123); + + let mut o = BTreeMap::new(); + o.insert("d".to_string(), oo); + + let expected = MyObject { + a: u8::MAX, + b: u16::MAX, + c: u32::MAX, + d: MAX_SAFE_INTEGER as u64, + e: i8::MAX, + f: i16::MAX, + g: i32::MAX, + h: MIN_SAFE_INTEGER, + i: f32::MAX, + j: f64::MAX, + k: "hello world".to_string(), + l: true, + m, + n: vec![1, 2, 3, 4, 5], + o, + p: vec![vec![1, 2], vec![3, 4, 5]], + bb, + }; + + let actual = do_roundtrip::<_, MyObject>(&expected); + + assert_eq!(expected, actual); + } + + fn do_roundtrip(expected: &E) -> A + where + E: Serialize, + A: DeserializeOwned, + { + let rt = Runtime::default(); + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx).unwrap(); + expected.serialize(&mut serializer).unwrap(); + let mut deserializer = ValueDeserializer::from(serializer.value); + let actual = A::deserialize(&mut deserializer).unwrap(); + actual + }) + } +} diff --git a/crates/javy/src/serde/ser.rs b/crates/javy/src/serde/ser.rs new file mode 100644 index 00000000..1cda98aa --- /dev/null +++ b/crates/javy/src/serde/ser.rs @@ -0,0 +1,704 @@ +use crate::from_js_error; +use crate::quickjs::{Array, Ctx, Error as JSError, Object, String as JSString, Value}; +use crate::serde::err::{Error, Result}; +use anyhow::anyhow; + +use serde::{ser, ser::Error as SerError, Serialize}; + +use super::as_key; + +/// `Serializer` is a serializer for [Value] values, implementing the `serde::Serializer` trait. +/// +/// This struct is responsible for converting Rust types into [Value] using the Serde +/// serialization framework. +/// +/// ``` +/// // Assuming you have [Ctx] instance named context +/// let serializer = Serializer::from_context(context)?; +/// let value: Value = serializer.serialize_u32(42)?; +/// ``` +pub struct Serializer<'js> { + pub context: Ctx<'js>, + pub value: Value<'js>, + pub key: Value<'js>, +} + +impl SerError for Error { + fn custom(msg: T) -> Self { + Error::Custom(anyhow!(msg.to_string())) + } +} + +impl<'js> Serializer<'js> { + pub fn from_context(context: Ctx<'js>) -> Result { + Ok(Self { + context: context.clone(), + value: Value::new_undefined(context.clone()), + key: Value::new_undefined(context), + }) + } +} + +impl<'a> ser::Serializer for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + type SerializeSeq = Self; + type SerializeTuple = Self; + type SerializeTupleStruct = Self; + type SerializeTupleVariant = Self; + type SerializeMap = Self; + type SerializeStruct = Self; + type SerializeStructVariant = Self; + + fn serialize_i8(self, v: i8) -> Result<()> { + self.serialize_i32(i32::from(v)) + } + + fn serialize_i16(self, v: i16) -> Result<()> { + self.serialize_i32(i32::from(v)) + } + + fn serialize_i32(self, v: i32) -> Result<()> { + self.value = Value::new_int(self.context.clone(), v); + Ok(()) + } + + fn serialize_i64(self, v: i64) -> Result<()> { + self.value = Value::new_number(self.context.clone(), v as _); + Ok(()) + } + + fn serialize_u8(self, v: u8) -> Result<()> { + self.serialize_i32(i32::from(v)) + } + + fn serialize_u16(self, v: u16) -> Result<()> { + self.serialize_i32(i32::from(v)) + } + + fn serialize_u32(self, v: u32) -> Result<()> { + // NOTE: See optimization note in serialize_f64. + self.serialize_f64(f64::from(v)) + } + + fn serialize_u64(self, v: u64) -> Result<()> { + self.value = Value::new_number(self.context.clone(), v as _); + Ok(()) + } + + fn serialize_f32(self, v: f32) -> Result<()> { + // NOTE: See optimization note in serialize_f64. + self.serialize_f64(f64::from(v)) + } + + fn serialize_f64(self, v: f64) -> Result<()> { + // NOTE: QuickJS will create a number value backed by an i32 when the value is within + // the i32::MIN..=i32::MAX as an optimization. Otherwise the value will be backed by a f64. + self.value = Value::new_float(self.context.clone(), v); + Ok(()) + } + + fn serialize_bool(self, b: bool) -> Result<()> { + self.value = Value::new_bool(self.context.clone(), b); + Ok(()) + } + + fn serialize_char(self, v: char) -> Result<()> { + self.serialize_str(&v.to_string()) + } + + fn serialize_str(self, v: &str) -> Result<()> { + let js_string = JSString::from_str(self.context.clone(), v) + .map_err(|e: JSError| Error::custom(e.to_string()))?; + self.value = Value::from(js_string); + Ok(()) + } + + fn serialize_none(self) -> Result<()> { + self.serialize_unit() + } + + fn serialize_unit(self) -> Result<()> { + self.value = Value::new_null(self.context.clone()); + Ok(()) + } + + fn serialize_unit_struct(self, _name: &'static str) -> Result<()> { + self.serialize_unit() + } + + fn serialize_some(self, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + value.serialize(self) + } + + fn serialize_unit_variant( + self, + _name: &'static str, + _variant_index: u32, + variant: &'static str, + ) -> Result<()> { + self.serialize_str(variant) + } + + fn serialize_newtype_struct(self, _name: &'static str, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + value.serialize(self) + } + + fn serialize_seq(self, _len: Option) -> Result { + let arr = Array::new(self.context.clone()).map_err(|e| Error::custom(e.to_string()))?; + self.value = Value::from(arr); + Ok(self) + } + + fn serialize_tuple(self, len: usize) -> Result { + self.serialize_seq(Some(len)) + } + + fn serialize_tuple_struct( + self, + _name: &'static str, + len: usize, + ) -> Result { + self.serialize_seq(Some(len)) + } + + fn serialize_map(self, _len: Option) -> Result { + let obj = Object::new(self.context.clone()).map_err(|e| Error::custom(e.to_string()))?; + self.value = Value::from(obj); + Ok(self) + } + + fn serialize_struct(self, _name: &'static str, len: usize) -> Result { + self.serialize_map(Some(len)) + } + + fn serialize_struct_variant( + self, + _name: &'static str, + _variant_index: u32, + _variant: &'static str, + len: usize, + ) -> Result { + self.serialize_map(Some(len)) + } + + fn serialize_tuple_variant( + self, + _name: &'static str, + _variant_index: u32, + _variant: &'static str, + len: usize, + ) -> Result { + self.serialize_map(Some(len)) + } + + fn serialize_newtype_variant( + self, + _name: &'static str, + _variant_index: u32, + variant: &'static str, + value: &T, + ) -> Result<()> + where + T: ?Sized + Serialize, + { + let obj = Object::new(self.context.clone()).map_err(|e| Error::custom(anyhow!("{e}")))?; + value.serialize(&mut *self)?; + obj.set(variant, self.value.clone()) + .map_err(|e| Error::custom(e.to_string()))?; + self.value = Value::from(obj); + + Ok(()) + } + + fn serialize_bytes(self, _: &[u8]) -> Result<()> { + Err(Error::custom(anyhow!("Cannot serialize bytes"))) + } +} + +impl<'a> ser::SerializeSeq for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + fn serialize_element(&mut self, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut element_serializer = Serializer::from_context(self.context.clone())?; + value.serialize(&mut element_serializer)?; + + if let Some(v) = self.value.as_array() { + return v + .set(v.len(), element_serializer.value.clone()) + .map_err(|e| { + let e = from_js_error(element_serializer.value.ctx().clone(), e); + Error::custom(e.to_string()) + }); + } + Err(Error::custom("Expected to be an array")) + } + + fn end(self) -> Result<()> { + Ok(()) + } +} + +impl<'a> ser::SerializeTuple for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + fn serialize_element(&mut self, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut element_serializer = Serializer::from_context(self.context.clone())?; + value.serialize(&mut element_serializer)?; + + if let Some(v) = self.value.as_array() { + return v + .set(v.len(), element_serializer.value.clone()) + .map_err(|e| { + let e = from_js_error(element_serializer.value.ctx().clone(), e); + Error::custom(e.to_string()) + }); + } + + Err(Error::custom("Expected to be an array")) + } + + fn end(self) -> Result<()> { + Ok(()) + } +} + +impl<'a> ser::SerializeTupleStruct for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + fn serialize_field(&mut self, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut field_serializer = Serializer::from_context(self.context.clone())?; + value.serialize(&mut field_serializer)?; + if let Some(v) = self.value.as_array() { + return v.set(v.len(), field_serializer.value.clone()).map_err(|e| { + let e = from_js_error(field_serializer.value.ctx().clone(), e); + Error::custom(e.to_string()) + }); + } + + Err(Error::custom("Expected to be an array")) + } + + fn end(self) -> Result<()> { + Ok(()) + } +} + +impl<'a> ser::SerializeTupleVariant for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + fn serialize_field(&mut self, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut field_serializer = Serializer::from_context(self.context.clone())?; + value.serialize(&mut field_serializer)?; + + if let Some(v) = self.value.as_array() { + return v.set(v.len(), field_serializer.value.clone()).map_err(|e| { + let e = from_js_error(field_serializer.value.ctx().clone(), e); + Error::custom(e.to_string()) + }); + } + + Err(Error::custom("Expected to be an array")) + } + + fn end(self) -> Result<()> { + Ok(()) + } +} + +impl<'a> ser::SerializeMap for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + fn serialize_key(&mut self, key: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut key_serializer = Serializer::from_context(self.context.clone())?; + key.serialize(&mut key_serializer)?; + self.key = key_serializer.value; + Ok(()) + } + + fn serialize_value(&mut self, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut map_serializer = Serializer::from_context(self.context.clone())?; + value.serialize(&mut map_serializer)?; + let key = as_key(&self.key)?; + + if let Some(o) = self.value.as_object() { + return o.set(key, map_serializer.value.clone()).map_err(|e| { + let e = from_js_error(map_serializer.value.ctx().clone(), e); + Error::custom(e.to_string()) + }); + } + + Err(Error::custom("Expected to be an object")) + } + + fn end(self) -> Result<()> { + Ok(()) + } +} + +impl<'a> ser::SerializeStruct for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut field_serializer = Serializer::from_context(self.context.clone())?; + value.serialize(&mut field_serializer)?; + + if let Some(o) = self.value.as_object() { + return o.set(key, field_serializer.value.clone()).map_err(|e| { + let e = from_js_error(field_serializer.value.ctx().clone(), e); + Error::custom(e.to_string()) + }); + } + + Err(Error::custom("Expected to be an object")) + } + + fn end(self) -> Result<()> { + Ok(()) + } +} + +impl<'a> ser::SerializeStructVariant for &'a mut Serializer<'_> { + type Ok = (); + type Error = Error; + + fn serialize_field(&mut self, key: &'static str, value: &T) -> Result<()> + where + T: ?Sized + Serialize, + { + let mut field_serializer = Serializer::from_context(self.context.clone())?; + value.serialize(&mut field_serializer)?; + + if let Some(o) = self.value.as_object() { + return o.set(key, field_serializer.value.clone()).map_err(|e| { + let e = from_js_error(field_serializer.value.ctx().clone(), e); + Error::custom(e.to_string()) + }); + } + + Err(Error::custom("Expected to be an object")) + } + + fn end(self) -> Result<()> { + Ok(()) + } +} + +#[cfg(test)] +mod tests { + use std::collections::BTreeMap; + + use super::Serializer as ValueSerializer; + use crate::serde::{MAX_SAFE_INTEGER, MIN_SAFE_INTEGER}; + use crate::Runtime; + use anyhow::Result; + use quickcheck::quickcheck; + use serde::{Serialize, Serializer}; + + fn with_serializer Result>( + rt: &Runtime, + mut w: F, + ) -> Result { + rt.context().with(|c| { + let mut serializer = ValueSerializer::from_context(c.clone()).unwrap(); + w(&mut serializer) + }) + } + + quickcheck! { + fn test_i16(v: i16) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + serializer.serialize_i16(v)?; + Ok(serializer.value.is_int()) + }) + } + + fn test_i32(v: i32) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + serializer.serialize_i32(v)?; + Ok(serializer.value.is_int()) + }) + } + + fn test_i64(v: i64) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + if (MIN_SAFE_INTEGER..=MAX_SAFE_INTEGER).contains(&v) { + serializer.serialize_i64(v)?; + Ok(serializer.value.is_number()) + } else { + serializer.serialize_f64(v as f64)?; + Ok(serializer.value.is_number()) + } + }) + } + + fn test_u64(v: u64) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + if v <= MAX_SAFE_INTEGER as u64 { + serializer.serialize_u64(v)?; + Ok(serializer.value.is_number()) + } else { + serializer.serialize_f64(v as f64)?; + Ok(serializer.value.is_number()) + } + }) + } + + fn test_u16(v: u16) -> Result { + let rt = Runtime::default(); + + with_serializer(&rt, |serializer| { + serializer.serialize_u16(v)?; + Ok(serializer.value.is_int()) + }) + } + + fn test_u32(v: u32) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + serializer.serialize_u32(v)?; + // QuickJS optimizes numbers in the range of [i32::MIN..=i32::MAX] + // as ints + if v > i32::MAX as u32 { + Ok(serializer.value.is_float()) + } else { + Ok(serializer.value.is_int()) + } + }) + + } + + fn test_f32(v: f32) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + serializer.serialize_f32(v)?; + + if v == 0.0_f32 { + if v.is_sign_positive() { + return Ok(serializer.value.is_int()); + } + + + if v.is_sign_negative() { + return Ok(serializer.value.is_float()); + } + } + + // The same (int) optimization is happening at this point, + // but here we need to account for signs + let zero_fractional_part = v.fract() == 0.0; + let range = (i32::MIN as f32)..=(i32::MAX as f32); + + if zero_fractional_part && range.contains(&v) { + Ok(serializer.value.is_int()) + } else { + Ok(serializer.value.is_float()) + } + }) + } + + fn test_f64(v: f64) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + serializer.serialize_f64(v)?; + + if v == 0.0_f64 { + if v.is_sign_positive() { + return Ok(serializer.value.is_int()); + } + + + if v.is_sign_negative() { + return Ok(serializer.value.is_float()); + } + } + + // The same (int) optimization is happening at this point, + // but here we need to account for signs + let zero_fractional_part = v.fract() == 0.0; + let range = (i32::MIN as f64)..=(i32::MAX as f64); + + if zero_fractional_part && range.contains(&v) { + Ok(serializer.value.is_int()) + } else { + Ok(serializer.value.is_float()) + } + }) + } + + fn test_bool(v: bool) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + serializer.serialize_bool(v)?; + Ok(serializer.value.is_bool()) + }) + } + + fn test_str(v: String) -> Result { + let rt = Runtime::default(); + with_serializer(&rt, |serializer| { + serializer.serialize_str(v.as_str())?; + + Ok(serializer.value.is_string()) + }) + } + } + + #[test] + fn test_null() -> Result<()> { + let rt = Runtime::default(); + + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + serializer.serialize_unit().unwrap(); + + assert!(serializer.value.is_null()); + }); + Ok(()) + } + + #[test] + fn test_nan() -> Result<()> { + let rt = Runtime::default(); + + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + serializer.serialize_f64(f64::NAN).unwrap(); + assert!(serializer.value.is_number()); + }); + Ok(()) + } + + #[test] + fn test_infinity() -> Result<()> { + let rt = Runtime::default(); + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + serializer.serialize_f64(f64::INFINITY).unwrap(); + assert!(serializer.value.is_number()); + }); + Ok(()) + } + + #[test] + fn test_negative_infinity() -> Result<()> { + let rt = Runtime::default(); + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + serializer.serialize_f64(f64::NEG_INFINITY).unwrap(); + assert!(serializer.value.is_number()); + }); + Ok(()) + } + + #[test] + fn test_map_with_invalid_key_type() { + // This is technically possible since msgpack supports maps + // with any other valid msgpack type. However, we try to enforce + // using `K: String` since it allow transcoding from json<->msgpack. + let rt = Runtime::default(); + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + + let mut map = BTreeMap::new(); + map.insert(42, "bar"); + map.insert(43, "titi"); + + let err = map.serialize(&mut serializer).unwrap_err(); + assert_eq!("map keys must be a string".to_string(), err.to_string()); + }); + } + + #[test] + fn test_map() { + let rt = Runtime::default(); + + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + + let mut map = BTreeMap::new(); + map.insert("foo", "bar"); + map.insert("toto", "titi"); + + map.serialize(&mut serializer).unwrap(); + + assert!(serializer.value.is_object()) + }); + } + + #[test] + fn test_struct_into_map() { + let rt = Runtime::default(); + + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + + #[derive(serde::Serialize)] + struct MyObject { + foo: String, + bar: u32, + } + + let my_object = MyObject { + foo: "hello".to_string(), + bar: 1337, + }; + my_object.serialize(&mut serializer).unwrap(); + + assert!(serializer.value.is_object()); + }); + } + + #[test] + fn test_sequence() { + let rt = Runtime::default(); + + rt.context().with(|cx| { + let mut serializer = ValueSerializer::from_context(cx.clone()).unwrap(); + + let sequence = vec!["hello", "world"]; + + sequence.serialize(&mut serializer).unwrap(); + + assert!(serializer.value.is_array()); + }); + } +} diff --git a/supply-chain/audits.toml b/supply-chain/audits.toml index 416b30d8..3ea2e537 100644 --- a/supply-chain/audits.toml +++ b/supply-chain/audits.toml @@ -237,6 +237,12 @@ user-id = 6825 # Dan Gohman (sunfishcode) start = "2021-06-12" end = "2024-07-25" +[[trusted.is-terminal]] +criteria = "safe-to-deploy" +user-id = 6825 # Dan Gohman (sunfishcode) +start = "2022-01-22" +end = "2025-04-16" + [[trusted.itoa]] criteria = "safe-to-deploy" user-id = 3618 # David Tolnay (dtolnay) @@ -531,6 +537,12 @@ user-id = 73222 # wasmtime-publish start = "2023-08-21" end = "2025-01-03" +[[trusted.web-sys]] +criteria = "safe-to-deploy" +user-id = 1 # Alex Crichton (alexcrichton) +start = "2019-03-04" +end = "2025-04-16" + [[trusted.winapi-util]] criteria = "safe-to-deploy" user-id = 189 # Andrew Gallant (BurntSushi) diff --git a/supply-chain/config.toml b/supply-chain/config.toml index 71ea613e..6c55ad46 100644 --- a/supply-chain/config.toml +++ b/supply-chain/config.toml @@ -10,11 +10,11 @@ url = "https://raw.githubusercontent.com/bytecodealliance/wasmtime/main/supply-c [imports.embark-studios] url = "https://raw.githubusercontent.com/EmbarkStudios/rust-ecosystem/main/audits.toml" +[imports.fermyon] +url = "https://raw.githubusercontent.com/fermyon/spin/main/supply-chain/audits.toml" + [imports.google] -url = [ - "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT", - "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT", -] +url = "https://raw.githubusercontent.com/google/supply-chain/main/audits.toml" [imports.isrg] url = "https://raw.githubusercontent.com/divviup/libprio-rs/main/supply-chain/audits.toml" @@ -34,6 +34,18 @@ audit-as-crates-io = false [policy.quickjs-wasm-sys] audit-as-crates-io = false +[policy.rquickjs] +audit-as-crates-io = false + +[policy.rquickjs-core] +audit-as-crates-io = false + +[policy.rquickjs-macro] +audit-as-crates-io = false + +[policy.rquickjs-sys] +audit-as-crates-io = false + [[exemptions.Inflector]] version = "0.11.4" criteria = "safe-to-deploy" @@ -43,7 +55,7 @@ version = "0.19.0" criteria = "safe-to-deploy" [[exemptions.ahash]] -version = "0.8.3" +version = "0.8.11" criteria = "safe-to-deploy" [[exemptions.alloc-no-stdlib]] @@ -63,7 +75,11 @@ version = "0.9.6" criteria = "safe-to-deploy" [[exemptions.backtrace]] -version = "0.3.69" +version = "0.3.71" +criteria = "safe-to-deploy" + +[[exemptions.base64]] +version = "0.21.7" criteria = "safe-to-deploy" [[exemptions.base64-simd]] @@ -95,41 +111,53 @@ version = "3.5.0" criteria = "safe-to-deploy" [[exemptions.brotli-decompressor]] -version = "2.5.0" +version = "2.5.1" +criteria = "safe-to-deploy" + +[[exemptions.bumpalo]] +version = "3.16.0" criteria = "safe-to-deploy" [[exemptions.bytes]] -version = "1.5.0" +version = "1.6.0" +criteria = "safe-to-deploy" + +[[exemptions.camino]] +version = "1.1.6" +criteria = "safe-to-deploy" + +[[exemptions.cargo-platform]] +version = "0.1.8" criteria = "safe-to-deploy" [[exemptions.cast]] version = "0.3.0" criteria = "safe-to-run" +[[exemptions.cc]] +version = "1.0.92" +criteria = "safe-to-deploy" + [[exemptions.ciborium]] -version = "0.2.1" +version = "0.2.2" criteria = "safe-to-run" [[exemptions.ciborium-io]] -version = "0.2.1" +version = "0.2.2" criteria = "safe-to-run" [[exemptions.ciborium-ll]] -version = "0.2.1" +version = "0.2.2" criteria = "safe-to-run" [[exemptions.clang-sys]] -version = "1.3.1" +version = "1.7.0" criteria = "safe-to-deploy" [[exemptions.clap]] version = "2.34.0" criteria = "safe-to-deploy" -[[exemptions.clap]] -version = "4.4.7" -criteria = "safe-to-run" - [[exemptions.convert_case]] version = "0.6.0" criteria = "safe-to-deploy" @@ -139,11 +167,11 @@ version = "0.3.5" criteria = "safe-to-deploy" [[exemptions.cpufeatures]] -version = "0.2.1" +version = "0.2.12" criteria = "safe-to-deploy" [[exemptions.crc32fast]] -version = "1.3.2" +version = "1.4.0" criteria = "safe-to-deploy" [[exemptions.criterion]] @@ -154,24 +182,20 @@ criteria = "safe-to-run" version = "0.4.5" criteria = "safe-to-run" -[[exemptions.crossbeam-channel]] -version = "0.5.2" -criteria = "safe-to-deploy" - [[exemptions.crossbeam-deque]] -version = "0.8.1" +version = "0.8.5" criteria = "safe-to-deploy" [[exemptions.crossbeam-epoch]] -version = "0.9.7" +version = "0.9.18" criteria = "safe-to-deploy" [[exemptions.crossbeam-utils]] -version = "0.8.7" +version = "0.8.8" criteria = "safe-to-deploy" [[exemptions.data-encoding]] -version = "2.4.0" +version = "2.5.0" criteria = "safe-to-deploy" [[exemptions.digest]] @@ -182,10 +206,26 @@ criteria = "safe-to-deploy" version = "2.0.0" criteria = "safe-to-deploy" +[[exemptions.dirs]] +version = "4.0.0" +criteria = "safe-to-deploy" + +[[exemptions.dirs-sys]] +version = "0.3.7" +criteria = "safe-to-deploy" + [[exemptions.dirs-sys-next]] version = "0.1.2" criteria = "safe-to-deploy" +[[exemptions.either]] +version = "1.10.0" +criteria = "safe-to-deploy" + +[[exemptions.env_logger]] +version = "0.8.4" +criteria = "safe-to-deploy" + [[exemptions.fallible-iterator]] version = "0.2.0" criteria = "safe-to-deploy" @@ -231,21 +271,25 @@ version = "0.3.30" criteria = "safe-to-deploy" [[exemptions.generic-array]] -version = "0.14.5" +version = "0.14.7" criteria = "safe-to-deploy" [[exemptions.getrandom]] -version = "0.2.5" +version = "0.2.2" criteria = "safe-to-deploy" [[exemptions.gimli]] -version = "0.26.1" +version = "0.26.2" criteria = "safe-to-deploy" [[exemptions.gimli]] -version = "0.26.2" +version = "0.28.1" criteria = "safe-to-deploy" +[[exemptions.half]] +version = "2.4.1" +criteria = "safe-to-run" + [[exemptions.heck]] version = "0.3.3" criteria = "safe-to-deploy" @@ -255,11 +299,19 @@ version = "0.1.19" criteria = "safe-to-deploy" [[exemptions.hermit-abi]] -version = "0.3.1" +version = "0.3.9" +criteria = "safe-to-deploy" + +[[exemptions.home]] +version = "0.5.9" criteria = "safe-to-deploy" [[exemptions.hstr]] -version = "0.2.6" +version = "0.2.9" +criteria = "safe-to-deploy" + +[[exemptions.iana-time-zone]] +version = "0.1.60" criteria = "safe-to-deploy" [[exemptions.if_chain]] @@ -271,7 +323,7 @@ version = "1.9.3" criteria = "safe-to-deploy" [[exemptions.indexmap]] -version = "2.0.2" +version = "2.2.6" criteria = "safe-to-deploy" [[exemptions.ipnet]] @@ -279,7 +331,7 @@ version = "2.9.0" criteria = "safe-to-deploy" [[exemptions.is-macro]] -version = "0.3.0" +version = "0.3.5" criteria = "safe-to-deploy" [[exemptions.itertools]] @@ -295,7 +347,15 @@ version = "1.3.0" criteria = "safe-to-deploy" [[exemptions.libloading]] -version = "0.7.3" +version = "0.8.3" +criteria = "safe-to-deploy" + +[[exemptions.libredox]] +version = "0.1.3" +criteria = "safe-to-deploy" + +[[exemptions.log]] +version = "0.4.21" criteria = "safe-to-deploy" [[exemptions.mach]] @@ -307,19 +367,23 @@ version = "0.3.4" criteria = "safe-to-deploy" [[exemptions.memoffset]] -version = "0.6.5" +version = "0.9.1" criteria = "safe-to-deploy" [[exemptions.minimal-lexical]] version = "0.2.1" criteria = "safe-to-deploy" +[[exemptions.miniz_oxide]] +version = "0.7.2" +criteria = "safe-to-deploy" + [[exemptions.mio]] version = "0.8.11" criteria = "safe-to-deploy" -[[exemptions.nom]] -version = "7.1.0" +[[exemptions.new_debug_unreachable]] +version = "1.0.6" criteria = "safe-to-deploy" [[exemptions.num-format]] @@ -327,23 +391,19 @@ version = "0.4.4" criteria = "safe-to-run" [[exemptions.object]] -version = "0.32.1" +version = "0.32.2" criteria = "safe-to-deploy" [[exemptions.once_cell]] version = "1.16.0" criteria = "safe-to-deploy" -[[exemptions.oorandom]] -version = "11.1.3" -criteria = "safe-to-run" - [[exemptions.openssl]] -version = "0.10.60" +version = "0.10.64" criteria = "safe-to-deploy" [[exemptions.openssl-sys]] -version = "0.9.96" +version = "0.9.102" criteria = "safe-to-deploy" [[exemptions.outref]] @@ -367,39 +427,47 @@ version = "0.10.0" criteria = "safe-to-deploy" [[exemptions.pin-project]] -version = "1.1.3" +version = "1.1.5" criteria = "safe-to-deploy" [[exemptions.pin-project-internal]] -version = "1.1.3" +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" [[exemptions.plotters]] -version = "0.3.4" +version = "0.3.5" criteria = "safe-to-run" [[exemptions.plotters-backend]] -version = "0.3.4" +version = "0.3.5" criteria = "safe-to-run" [[exemptions.plotters-svg]] -version = "0.3.3" +version = "0.3.5" criteria = "safe-to-run" -[[exemptions.pmutil]] -version = "0.6.1" -criteria = "safe-to-deploy" - [[exemptions.ppv-lite86]] version = "0.2.16" criteria = "safe-to-deploy" +[[exemptions.proc-macro-crate]] +version = "1.3.1" +criteria = "safe-to-deploy" + [[exemptions.proc-macro-error]] version = "1.0.4" criteria = "safe-to-deploy" [[exemptions.psm]] -version = "0.1.17" +version = "0.1.21" criteria = "safe-to-deploy" [[exemptions.radium]] @@ -410,28 +478,32 @@ criteria = "safe-to-deploy" version = "0.8.5" criteria = "safe-to-deploy" -[[exemptions.redox_syscall]] -version = "0.2.10" +[[exemptions.redox_users]] +version = "0.4.5" criteria = "safe-to-deploy" -[[exemptions.redox_users]] -version = "0.4.0" +[[exemptions.relative-path]] +version = "1.9.2" criteria = "safe-to-deploy" [[exemptions.rmp]] -version = "0.8.11" +version = "0.8.12" criteria = "safe-to-deploy" [[exemptions.rmp-serde]] version = "1.1.2" criteria = "safe-to-deploy" +[[exemptions.rustc-demangle]] +version = "0.1.23" +criteria = "safe-to-deploy" + [[exemptions.rustc_version]] version = "0.2.3" criteria = "safe-to-deploy" [[exemptions.schannel]] -version = "0.1.21" +version = "0.1.23" criteria = "safe-to-deploy" [[exemptions.scoped-tls]] @@ -439,17 +511,21 @@ version = "1.0.1" criteria = "safe-to-deploy" [[exemptions.security-framework]] -version = "2.9.1" +version = "2.10.0" criteria = "safe-to-deploy" [[exemptions.security-framework-sys]] -version = "2.9.0" +version = "2.10.0" criteria = "safe-to-deploy" [[exemptions.semver]] version = "0.9.0" criteria = "safe-to-deploy" +[[exemptions.semver]] +version = "1.0.22" +criteria = "safe-to-deploy" + [[exemptions.semver-parser]] version = "0.7.0" criteria = "safe-to-deploy" @@ -458,8 +534,12 @@ criteria = "safe-to-deploy" version = "1.1.1" criteria = "safe-to-deploy" +[[exemptions.sha2]] +version = "0.10.8" +criteria = "safe-to-deploy" + [[exemptions.shellexpand]] -version = "2.1.0" +version = "2.1.2" criteria = "safe-to-deploy" [[exemptions.shlex]] @@ -471,7 +551,7 @@ version = "0.7.1" criteria = "safe-to-deploy" [[exemptions.siphasher]] -version = "0.3.10" +version = "0.3.11" criteria = "safe-to-deploy" [[exemptions.slice-group-by]] @@ -483,11 +563,11 @@ version = "1.0.1" criteria = "safe-to-deploy" [[exemptions.socket2]] -version = "0.5.5" +version = "0.5.6" criteria = "safe-to-deploy" [[exemptions.sourcemap]] -version = "8.0.0" +version = "8.0.1" criteria = "safe-to-deploy" [[exemptions.stable_deref_trait]] @@ -515,31 +595,31 @@ version = "0.4.18" criteria = "safe-to-deploy" [[exemptions.swc_atoms]] -version = "0.6.5" +version = "0.6.6" criteria = "safe-to-deploy" [[exemptions.swc_common]] -version = "0.33.21" +version = "0.33.22" criteria = "safe-to-deploy" [[exemptions.swc_core]] -version = "0.90.26" +version = "0.90.30" criteria = "safe-to-deploy" [[exemptions.swc_ecma_ast]] -version = "0.112.6" +version = "0.112.7" criteria = "safe-to-deploy" [[exemptions.swc_ecma_parser]] -version = "0.143.11" +version = "0.143.13" criteria = "safe-to-deploy" [[exemptions.swc_ecma_transforms_base]] -version = "0.137.16" +version = "0.137.17" criteria = "safe-to-deploy" [[exemptions.swc_ecma_utils]] -version = "0.127.15" +version = "0.127.17" criteria = "safe-to-deploy" [[exemptions.swc_ecma_visit]] @@ -555,7 +635,7 @@ version = "0.3.9" criteria = "safe-to-deploy" [[exemptions.swc_visit]] -version = "0.5.10" +version = "0.5.13" criteria = "safe-to-deploy" [[exemptions.swc_visit_macros]] @@ -570,12 +650,20 @@ criteria = "safe-to-deploy" version = "0.11.0" criteria = "safe-to-deploy" -[[exemptions.tinytemplate]] -version = "1.2.1" -criteria = "safe-to-run" +[[exemptions.tinyvec_macros]] +version = "0.1.1" +criteria = "safe-to-deploy" [[exemptions.toml]] -version = "0.5.8" +version = "0.5.7" +criteria = "safe-to-deploy" + +[[exemptions.toml_datetime]] +version = "0.6.5" +criteria = "safe-to-deploy" + +[[exemptions.toml_edit]] +version = "0.19.15" criteria = "safe-to-deploy" [[exemptions.tower]] @@ -591,15 +679,23 @@ version = "0.3.2" criteria = "safe-to-deploy" [[exemptions.tracing]] -version = "0.1.34" +version = "0.1.40" criteria = "safe-to-deploy" [[exemptions.tracing-attributes]] -version = "0.1.26" +version = "0.1.27" criteria = "safe-to-deploy" [[exemptions.tracing-core]] -version = "0.1.31" +version = "0.1.32" +criteria = "safe-to-deploy" + +[[exemptions.triomphe]] +version = "0.1.11" +criteria = "safe-to-deploy" + +[[exemptions.try-lock]] +version = "0.2.5" criteria = "safe-to-deploy" [[exemptions.typed-arena]] @@ -607,11 +703,11 @@ version = "2.0.2" criteria = "safe-to-deploy" [[exemptions.typenum]] -version = "1.15.0" +version = "1.17.0" criteria = "safe-to-deploy" [[exemptions.unicode-id]] -version = "0.3.3" +version = "0.3.4" criteria = "safe-to-deploy" [[exemptions.unicode-id-start]] @@ -623,7 +719,7 @@ version = "1.8.0" criteria = "safe-to-deploy" [[exemptions.vergen]] -version = "8.2.6" +version = "8.3.1" criteria = "safe-to-deploy" [[exemptions.walrus]] @@ -634,14 +730,22 @@ criteria = "safe-to-deploy" version = "0.19.0" criteria = "safe-to-deploy" -[[exemptions.wasi]] -version = "0.10.2+wasi-snapshot-preview1" +[[exemptions.want]] +version = "0.3.1" criteria = "safe-to-deploy" [[exemptions.wasi]] version = "0.11.0+wasi-snapshot-preview1" criteria = "safe-to-deploy" +[[exemptions.wasm-bindgen]] +version = "0.2.92" +criteria = "safe-to-deploy" + +[[exemptions.wasm-encoder]] +version = "0.202.0" +criteria = "safe-to-deploy" + [[exemptions.wasm-opt]] version = "0.116.1" criteria = "safe-to-deploy" @@ -654,12 +758,16 @@ criteria = "safe-to-deploy" version = "0.116.0" criteria = "safe-to-deploy" -[[exemptions.web-sys]] -version = "0.3.58" -criteria = "safe-to-run" +[[exemptions.wast]] +version = "202.0.0" +criteria = "safe-to-deploy" + +[[exemptions.wat]] +version = "1.202.0" +criteria = "safe-to-deploy" [[exemptions.which]] -version = "4.2.4" +version = "4.4.2" criteria = "safe-to-deploy" [[exemptions.winapi]] @@ -674,6 +782,10 @@ criteria = "safe-to-deploy" version = "0.4.0" criteria = "safe-to-deploy" +[[exemptions.winnow]] +version = "0.5.40" +criteria = "safe-to-deploy" + [[exemptions.witx]] version = "0.9.1" criteria = "safe-to-deploy" @@ -682,6 +794,14 @@ criteria = "safe-to-deploy" version = "0.5.1" criteria = "safe-to-deploy" +[[exemptions.zerocopy]] +version = "0.7.32" +criteria = "safe-to-deploy" + +[[exemptions.zerocopy-derive]] +version = "0.7.32" +criteria = "safe-to-deploy" + [[exemptions.zstd]] version = "0.11.2+zstd.1.5.2" criteria = "safe-to-deploy" @@ -691,5 +811,5 @@ version = "5.0.2+zstd.1.5.2" criteria = "safe-to-deploy" [[exemptions.zstd-sys]] -version = "2.0.8+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" criteria = "safe-to-deploy" diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock index 6d114f6a..43a5ac16 100644 --- a/supply-chain/imports.lock +++ b/supply-chain/imports.lock @@ -2,22 +2,22 @@ # cargo-vet imports lock [[publisher.aho-corasick]] -version = "0.7.18" -when = "2021-04-30" +version = "1.1.3" +when = "2024-03-20" user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" [[publisher.anstyle]] -version = "1.0.4" -when = "2023-09-28" +version = "1.0.6" +when = "2024-02-05" user-id = 6743 user-login = "epage" user-name = "Ed Page" [[publisher.anyhow]] -version = "1.0.81" -when = "2024-03-12" +version = "1.0.82" +when = "2024-04-10" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" @@ -30,15 +30,15 @@ user-login = "fitzgen" user-name = "Nick Fitzgerald" [[publisher.async-trait]] -version = "0.1.77" -when = "2024-01-02" +version = "0.1.79" +when = "2024-03-24" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.byteorder]] -version = "1.4.3" -when = "2021-03-10" +version = "1.5.0" +when = "2023-10-06" user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" @@ -85,13 +85,6 @@ user-id = 6825 user-login = "sunfishcode" user-name = "Dan Gohman" -[[publisher.cc]] -version = "1.0.90" -when = "2024-03-06" -user-id = 2915 -user-login = "Amanieu" -user-name = "Amanieu d'Antras" - [[publisher.cexpr]] version = "0.6.0" when = "2021-10-11" @@ -100,15 +93,15 @@ user-login = "emilio" user-name = "Emilio Cobos Álvarez" [[publisher.clap_builder]] -version = "4.4.7" -when = "2023-10-24" +version = "4.5.2" +when = "2024-03-06" user-id = 6743 user-login = "epage" user-name = "Ed Page" [[publisher.clap_lex]] -version = "0.6.0" -when = "2023-10-24" +version = "0.7.0" +when = "2024-02-08" user-id = 6743 user-login = "epage" user-name = "Ed Page" @@ -188,36 +181,36 @@ user-id = 73222 user-login = "wasmtime-publish" [[publisher.cxx]] -version = "1.0.115" -when = "2024-01-06" +version = "1.0.121" +when = "2024-04-08" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.cxx-build]] -version = "1.0.115" -when = "2024-01-06" +version = "1.0.121" +when = "2024-04-08" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.cxxbridge-flags]] -version = "1.0.115" -when = "2024-01-06" +version = "1.0.121" +when = "2024-04-08" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.cxxbridge-macro]] -version = "1.0.115" -when = "2024-01-06" +version = "1.0.121" +when = "2024-04-08" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.encoding_rs]] -version = "0.8.33" -when = "2023-08-23" +version = "0.8.34" +when = "2024-04-10" user-id = 4484 user-login = "hsivonen" user-name = "Henri Sivonen" @@ -251,15 +244,15 @@ user-login = "sunfishcode" user-name = "Dan Gohman" [[publisher.hashbrown]] -version = "0.14.1" -when = "2023-09-29" +version = "0.14.3" +when = "2023-11-26" user-id = 2915 user-login = "Amanieu" user-name = "Amanieu d'Antras" [[publisher.http]] -version = "1.0.0" -when = "2023-11-15" +version = "1.1.0" +when = "2024-03-04" user-id = 359 user-login = "seanmonstar" user-name = "Sean McArthur" @@ -279,8 +272,8 @@ user-login = "seanmonstar" user-name = "Sean McArthur" [[publisher.hyper]] -version = "1.1.0" -when = "2023-12-18" +version = "1.2.0" +when = "2024-02-21" user-id = 359 user-login = "seanmonstar" user-name = "Sean McArthur" @@ -300,36 +293,36 @@ user-login = "seanmonstar" user-name = "Sean McArthur" [[publisher.io-extras]] -version = "0.18.1" -when = "2023-12-01" +version = "0.18.2" +when = "2024-03-29" user-id = 6825 user-login = "sunfishcode" user-name = "Dan Gohman" [[publisher.io-lifetimes]] -version = "1.0.11" -when = "2023-05-24" +version = "2.0.3" +when = "2023-12-01" user-id = 6825 user-login = "sunfishcode" user-name = "Dan Gohman" -[[publisher.io-lifetimes]] -version = "2.0.3" -when = "2023-12-01" +[[publisher.is-terminal]] +version = "0.4.12" +when = "2024-02-09" user-id = 6825 user-login = "sunfishcode" user-name = "Dan Gohman" [[publisher.itoa]] -version = "1.0.4" -when = "2022-10-06" +version = "1.0.11" +when = "2024-03-26" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.js-sys]] -version = "0.3.58" -when = "2022-06-14" +version = "0.3.69" +when = "2024-03-04" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" @@ -342,57 +335,50 @@ user-login = "JohnTitor" user-name = "Yuki Okushi" [[publisher.linux-raw-sys]] -version = "0.3.8" -when = "2023-05-19" -user-id = 6825 -user-login = "sunfishcode" -user-name = "Dan Gohman" - -[[publisher.linux-raw-sys]] -version = "0.4.12" -when = "2023-11-30" +version = "0.4.13" +when = "2024-01-16" user-id = 6825 user-login = "sunfishcode" user-name = "Dan Gohman" [[publisher.memchr]] -version = "2.6.4" -when = "2023-10-01" +version = "2.7.2" +when = "2024-03-27" user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" [[publisher.num-traits]] -version = "0.2.16" -when = "2023-07-20" +version = "0.2.18" +when = "2024-02-08" user-id = 539 user-login = "cuviper" user-name = "Josh Stone" [[publisher.num_cpus]] -version = "1.13.1" -when = "2021-12-20" +version = "1.16.0" +when = "2023-06-29" user-id = 359 user-login = "seanmonstar" user-name = "Sean McArthur" [[publisher.paste]] -version = "1.0.6" -when = "2021-11-07" +version = "1.0.14" +when = "2023-07-15" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.prettyplease]] -version = "0.2.15" -when = "2023-09-07" +version = "0.2.17" +when = "2024-03-25" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.proc-macro2]] -version = "1.0.74" -when = "2024-01-02" +version = "1.0.79" +when = "2024-03-12" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" @@ -405,22 +391,15 @@ user-login = "BurntSushi" user-name = "Andrew Gallant" [[publisher.quote]] -version = "1.0.35" -when = "2024-01-02" +version = "1.0.36" +when = "2024-04-10" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.rayon]] -version = "1.5.1" -when = "2021-05-18" -user-id = 539 -user-login = "cuviper" -user-name = "Josh Stone" - -[[publisher.rayon-core]] -version = "1.9.1" -when = "2021-05-18" +version = "1.10.0" +when = "2024-03-24" user-id = 539 user-login = "cuviper" user-name = "Josh Stone" @@ -433,43 +412,43 @@ user-login = "cfallin" user-name = "Chris Fallin" [[publisher.regex]] -version = "1.5.6" -when = "2022-05-20" +version = "1.10.4" +when = "2024-03-23" user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" -[[publisher.regex-syntax]] -version = "0.6.26" -when = "2022-05-20" +[[publisher.regex-automata]] +version = "0.4.6" +when = "2024-03-04" user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" -[[publisher.rustix]] -version = "0.37.26" -when = "2023-10-19" -user-id = 6825 -user-login = "sunfishcode" -user-name = "Dan Gohman" +[[publisher.regex-syntax]] +version = "0.8.3" +when = "2024-03-26" +user-id = 189 +user-login = "BurntSushi" +user-name = "Andrew Gallant" [[publisher.rustix]] -version = "0.38.31" -when = "2024-02-01" +version = "0.38.32" +when = "2024-03-19" user-id = 6825 user-login = "sunfishcode" user-name = "Dan Gohman" [[publisher.rustversion]] -version = "1.0.14" -when = "2023-07-15" +version = "1.0.15" +when = "2024-04-06" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.ryu]] -version = "1.0.9" -when = "2021-12-12" +version = "1.0.17" +when = "2024-02-19" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" @@ -481,13 +460,6 @@ user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" -[[publisher.scopeguard]] -version = "1.1.0" -when = "2020-02-16" -user-id = 2915 -user-login = "Amanieu" -user-name = "Amanieu d'Antras" - [[publisher.scratch]] version = "1.0.7" when = "2023-07-15" @@ -524,8 +496,8 @@ user-login = "dtolnay" user-name = "David Tolnay" [[publisher.smallvec]] -version = "1.11.2" -when = "2023-11-09" +version = "1.13.2" +when = "2024-03-20" user-id = 2017 user-login = "mbrubeck" user-name = "Matt Brubeck" @@ -538,8 +510,8 @@ user-login = "dtolnay" user-name = "David Tolnay" [[publisher.syn]] -version = "2.0.46" -when = "2024-01-02" +version = "2.0.58" +when = "2024-04-03" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" @@ -552,8 +524,8 @@ user-login = "sunfishcode" user-name = "Dan Gohman" [[publisher.target-lexicon]] -version = "0.12.13" -when = "2024-01-02" +version = "0.12.14" +when = "2024-02-22" user-id = 6825 user-login = "sunfishcode" user-name = "Dan Gohman" @@ -566,15 +538,15 @@ user-login = "BurntSushi" user-name = "Andrew Gallant" [[publisher.thiserror]] -version = "1.0.56" -when = "2024-01-02" +version = "1.0.58" +when = "2024-03-12" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" [[publisher.thiserror-impl]] -version = "1.0.56" -when = "2024-01-02" +version = "1.0.58" +when = "2024-03-12" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" @@ -594,22 +566,29 @@ user-login = "carllerche" user-name = "Carl Lerche" [[publisher.unicode-ident]] -version = "1.0.6" -when = "2022-12-17" +version = "1.0.12" +when = "2023-09-13" user-id = 3618 user-login = "dtolnay" user-name = "David Tolnay" +[[publisher.unicode-normalization]] +version = "0.1.23" +when = "2024-02-20" +user-id = 1139 +user-login = "Manishearth" +user-name = "Manish Goregaokar" + [[publisher.unicode-segmentation]] -version = "1.9.0" -when = "2022-02-07" +version = "1.11.0" +when = "2024-02-07" user-id = 1139 user-login = "Manishearth" user-name = "Manish Goregaokar" [[publisher.unicode-width]] -version = "0.1.9" -when = "2021-09-16" +version = "0.1.11" +when = "2023-09-19" user-id = 1139 user-login = "Manishearth" user-name = "Manish Goregaokar" @@ -640,37 +619,30 @@ when = "2023-12-20" user-id = 73222 user-login = "wasmtime-publish" -[[publisher.wasm-bindgen]] -version = "0.2.81" -when = "2022-06-14" -user-id = 1 -user-login = "alexcrichton" -user-name = "Alex Crichton" - [[publisher.wasm-bindgen-backend]] -version = "0.2.81" -when = "2022-06-14" +version = "0.2.92" +when = "2024-03-04" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" [[publisher.wasm-bindgen-macro]] -version = "0.2.81" -when = "2022-06-14" +version = "0.2.92" +when = "2024-03-04" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" [[publisher.wasm-bindgen-macro-support]] -version = "0.2.81" -when = "2022-06-14" +version = "0.2.92" +when = "2024-03-04" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" [[publisher.wasm-bindgen-shared]] -version = "0.2.81" -when = "2022-06-14" +version = "0.2.92" +when = "2024-03-04" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" @@ -711,8 +683,8 @@ user-login = "alexcrichton" user-name = "Alex Crichton" [[publisher.wasmparser]] -version = "0.118.1" -when = "2023-11-29" +version = "0.118.2" +when = "2024-02-12" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" @@ -731,8 +703,8 @@ user-id = 73222 user-login = "wasmtime-publish" [[publisher.wasmprinter]] -version = "0.2.78" -when = "2024-01-29" +version = "0.2.80" +when = "2024-02-12" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" @@ -857,16 +829,9 @@ when = "2023-12-20" user-id = 73222 user-login = "wasmtime-publish" -[[publisher.wast]] -version = "69.0.1" -when = "2023-11-29" -user-id = 1 -user-login = "alexcrichton" -user-name = "Alex Crichton" - -[[publisher.wat]] -version = "1.0.82" -when = "2023-11-29" +[[publisher.web-sys]] +version = "0.3.69" +when = "2024-03-04" user-id = 1 user-login = "alexcrichton" user-name = "Alex Crichton" @@ -890,8 +855,8 @@ user-id = 73222 user-login = "wasmtime-publish" [[publisher.winapi-util]] -version = "0.1.5" -when = "2020-04-20" +version = "0.1.6" +when = "2023-09-20" user-id = 189 user-login = "BurntSushi" user-name = "Andrew Gallant" @@ -909,13 +874,6 @@ user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" -[[publisher.windows-sys]] -version = "0.42.0" -when = "2022-09-27" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - [[publisher.windows-sys]] version = "0.48.0" when = "2023-03-31" @@ -931,162 +889,113 @@ user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows-targets]] -version = "0.48.0" -when = "2023-03-31" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows-targets]] -version = "0.52.0" -when = "2023-11-15" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_aarch64_gnullvm]] -version = "0.42.1" -when = "2023-01-12" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - -[[publisher.windows_aarch64_gnullvm]] -version = "0.48.0" -when = "2023-03-31" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_aarch64_gnullvm]] -version = "0.52.0" -when = "2023-11-15" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - -[[publisher.windows_aarch64_msvc]] -version = "0.42.1" -when = "2023-01-12" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_aarch64_msvc]] -version = "0.48.0" -when = "2023-03-31" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_aarch64_msvc]] -version = "0.52.0" -when = "2023-11-15" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - -[[publisher.windows_i686_gnu]] -version = "0.42.1" -when = "2023-01-12" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_i686_gnu]] -version = "0.48.0" -when = "2023-03-31" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_i686_gnu]] -version = "0.52.0" -when = "2023-11-15" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_i686_msvc]] -version = "0.42.1" -when = "2023-01-12" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_i686_msvc]] -version = "0.48.0" -when = "2023-03-31" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - -[[publisher.windows_i686_msvc]] -version = "0.52.0" -when = "2023-11-15" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_x86_64_gnu]] -version = "0.42.1" -when = "2023-01-12" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_x86_64_gnu]] -version = "0.48.0" -when = "2023-03-31" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - -[[publisher.windows_x86_64_gnu]] -version = "0.52.0" -when = "2023-11-15" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_x86_64_gnullvm]] -version = "0.42.1" -when = "2023-01-12" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_x86_64_gnullvm]] -version = "0.48.0" -when = "2023-03-31" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - -[[publisher.windows_x86_64_gnullvm]] -version = "0.52.0" -when = "2023-11-15" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_x86_64_msvc]] -version = "0.42.1" -when = "2023-01-12" +version = "0.48.5" +when = "2023-08-18" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" [[publisher.windows_x86_64_msvc]] -version = "0.48.0" -when = "2023-03-31" -user-id = 64539 -user-login = "kennykerr" -user-name = "Kenny Kerr" - -[[publisher.windows_x86_64_msvc]] -version = "0.52.0" -when = "2023-11-15" +version = "0.52.4" +when = "2024-02-28" user-id = 64539 user-login = "kennykerr" user-name = "Kenny Kerr" @@ -1413,32 +1322,6 @@ start = "2022-11-27" end = "2024-06-26" notes = "The Bytecode Alliance is the author of this crate." -[[audits.bytecode-alliance.wildcard-audits.wast]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -user-id = 1 # Alex Crichton (alexcrichton) -start = "2019-10-16" -end = "2024-04-14" -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. -I am employed by a member of the Bytecode Alliance and plan to continue doing -so and will actively maintain this crate over time. -""" - -[[audits.bytecode-alliance.wildcard-audits.wat]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -user-id = 1 # Alex Crichton (alexcrichton) -start = "2019-10-18" -end = "2024-04-14" -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. -I am employed by a member of the Bytecode Alliance and plan to continue doing -so and will actively maintain this crate over time. -""" - [[audits.bytecode-alliance.wildcard-audits.wiggle]] who = "Bobby Holley " criteria = "safe-to-deploy" @@ -1514,15 +1397,6 @@ criteria = "safe-to-deploy" version = "0.1.6" notes = "Contains no unsafe code, no IO, no build.rs." -[[audits.bytecode-alliance.audits.arrayvec]] -who = "Nick Fitzgerald " -criteria = "safe-to-deploy" -version = "0.7.2" -notes = """ -Well documented invariants, good assertions for those invariants in unsafe code, -and tested with MIRI to boot. LGTM. -""" - [[audits.bytecode-alliance.audits.atty]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -1533,36 +1407,17 @@ the environment's terminal information when asked. Does its stated purpose and no more. """ -[[audits.bytecode-alliance.audits.base64]] +[[audits.bytecode-alliance.audits.cargo_metadata]] who = "Pat Hickey " criteria = "safe-to-deploy" -version = "0.21.0" -notes = "This crate has no dependencies, no build.rs, and contains no unsafe code." - -[[audits.bytecode-alliance.audits.bitflags]] -who = "Jamey Sharp " -criteria = "safe-to-deploy" -delta = "2.1.0 -> 2.2.1" -notes = """ -This version adds unsafe impls of traits from the bytemuck crate when built -with that library enabled, but I believe the impls satisfy the documented -safety requirements for bytemuck. The other changes are minor. -""" +version = "0.15.3" +notes = "no build, no unsafe, inputs to cargo command are reasonably sanitized" -[[audits.bytecode-alliance.audits.bitflags]] +[[audits.bytecode-alliance.audits.cargo_metadata]] who = "Alex Crichton " criteria = "safe-to-deploy" -delta = "2.3.2 -> 2.3.3" -notes = """ -Nothing outside the realm of what one would expect from a bitflags generator, -all as expected. -""" - -[[audits.bytecode-alliance.audits.bumpalo]] -who = "Nick Fitzgerald " -criteria = "safe-to-deploy" -version = "3.11.1" -notes = "I am the author of this crate." +delta = "0.17.0 -> 0.18.1" +notes = "No major changes, no unsafe code here." [[audits.bytecode-alliance.audits.cfg-if]] who = "Alex Crichton " @@ -1576,6 +1431,15 @@ criteria = "safe-to-deploy" version = "0.11.1" notes = "This library uses `forbid(unsafe_code)` and has no filesystem or network I/O." +[[audits.bytecode-alliance.audits.core-foundation-sys]] +who = "Dan Gohman " +criteria = "safe-to-deploy" +delta = "0.8.4 -> 0.8.6" +notes = """ +The changes here are all typical bindings updates: new functions, types, and +constants. I have not audited all the bindings for ABI conformance. +""" + [[audits.bytecode-alliance.audits.criterion]] who = "Pat Hickey " criteria = "safe-to-deploy" @@ -1628,36 +1492,6 @@ serialization support. All logic is trivial: either unit conversion, or hash-consing to support de-duplication required by the format. """ -[[audits.bytecode-alliance.audits.gimli]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -delta = "0.26.1 -> 0.27.0" -notes = """ -This is a standard update to gimli for more DWARF support for more platforms, -more features, etc. Some minor `unsafe` code was added that does not appear -incorrect. Otherwise looks like someone probably ran clippy and/or rustfmt. -""" - -[[audits.bytecode-alliance.audits.gimli]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -delta = "0.27.0 -> 0.27.3" -notes = "More support for more DWARF, nothing major in this update. Some small refactorings and updates to publication of the package but otherwise everything's in order." - -[[audits.bytecode-alliance.audits.gimli]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -delta = "0.27.3 -> 0.28.0" -notes = """ -Still looks like a good DWARF-parsing crate, nothing major was added or deleted -and no `unsafe` code to review here. -""" - -[[audits.bytecode-alliance.audits.glob]] -who = "Jamey Sharp " -criteria = "safe-to-deploy" -delta = "0.3.1 -> 0.3.0" - [[audits.bytecode-alliance.audits.hashbrown]] who = "Chris Fallin " criteria = "safe-to-deploy" @@ -1687,15 +1521,6 @@ 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]] -who = "Dan Gohman " -criteria = "safe-to-deploy" -version = "0.1.59" -notes = """ -I also manually ran windows-bindgen and confirmed that the output matches -the bindings checked into the repo. -""" - [[audits.bytecode-alliance.audits.iana-time-zone-haiku]] who = "Dan Gohman " criteria = "safe-to-deploy" @@ -1718,13 +1543,13 @@ crate is broadly used throughout the ecosystem and does not contain anything suspicious. """ -[[audits.bytecode-alliance.audits.is-terminal]] -who = "Dan Gohman " +[[audits.bytecode-alliance.audits.itertools]] +who = "Nick Fitzgerald " criteria = "safe-to-deploy" -version = "0.4.7" +delta = "0.10.5 -> 0.12.1" notes = """ -The is-terminal implementation code is now sync'd up with the prototype -implementation in the Rust standard library. +Minimal `unsafe` usage. Few blocks that existed looked reasonable. Does what it +says on the tin: lots of iterators. """ [[audits.bytecode-alliance.audits.ittapi]] @@ -1768,31 +1593,11 @@ criteria = "safe-to-deploy" delta = "0.6.2 -> 0.6.3" notes = "Just a dependency version bump and documentation update" -[[audits.bytecode-alliance.audits.memoffset]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -delta = "0.7.1 -> 0.8.0" -notes = "This was a small update to the crate which has to do with Rust language features and compiler versions, no substantial changes." - -[[audits.bytecode-alliance.audits.memoffset]] +[[audits.bytecode-alliance.audits.memfd]] who = "Alex Crichton " criteria = "safe-to-deploy" -delta = "0.8.0 -> 0.9.0" -notes = "No major changes in the crate, mostly updates to use new nightly Rust features." - -[[audits.bytecode-alliance.audits.miniz_oxide]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -version = "0.7.1" -notes = """ -This crate is a Rust implementation of zlib compression/decompression and has -been used by default by the Rust standard library for quite some time. It's also -a default dependency of the popular `backtrace` crate for decompressing debug -information. This crate forbids unsafe code and does not otherwise access system -resources. It's originally a port of the `miniz.c` library as well, and given -its own longevity should be relatively hardened against some of the more common -compression-related issues. -""" +delta = "0.6.3 -> 0.6.4" +notes = "This commit only updated the dependency `rustix`, so same as before." [[audits.bytecode-alliance.audits.native-tls]] who = "Pat Hickey " @@ -1826,23 +1631,15 @@ who = "Pat Hickey " criteria = "safe-to-deploy" version = "0.1.0" -[[audits.bytecode-alliance.audits.pkg-config]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.3.25" -notes = "This crate shells out to the pkg-config executable, but it appears to sanitize inputs reasonably." - -[[audits.bytecode-alliance.audits.rustc-demangle]] +[[audits.bytecode-alliance.audits.slice-group-by]] who = "Alex Crichton " criteria = "safe-to-deploy" -version = "0.1.21" -notes = "I am the author of this crate." - -[[audits.bytecode-alliance.audits.semver]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "1.0.17" -notes = "plenty of unsafe pointer and vec tricks, but in well-structured and commented code that appears to be correct" +delta = "0.3.0 -> 0.3.1" +notes = """ +This update runs `rustfmt` for the first time in awhile and additionally fixes a +few minor issues related to Stacked Borrows and running in MIRI. No fundamental +change to any preexisting unsafe code is happening here. +""" [[audits.bytecode-alliance.audits.sptr]] who = "Alex Crichton " @@ -1870,38 +1667,12 @@ without `unsafe`. Skimming the crate everything looks reasonable and what one would expect from idiomatic safe collections in Rust. """ -[[audits.bytecode-alliance.audits.tinyvec_macros]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -version = "0.1.0" -notes = """ -This is a trivial crate which only contains a singular macro definition which is -intended to multiplex across the internal representation of a tinyvec, -presumably. This trivially doesn't contain anything bad. -""" - [[audits.bytecode-alliance.audits.tokio-native-tls]] who = "Pat Hickey " 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." -[[audits.bytecode-alliance.audits.tracing]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -delta = "0.1.34 -> 0.1.37" -notes = """ -A routine set of updates for the tracing crate this includes minor refactorings, -addition of benchmarks, some test updates, but overall nothing out of the -ordinary. -""" - -[[audits.bytecode-alliance.audits.try-lock]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.2.4" -notes = "Implements a concurrency primitive with atomics, and is not obviously incorrect" - [[audits.bytecode-alliance.audits.unicode-bidi]] who = "Alex Crichton " criteria = "safe-to-deploy" @@ -1911,35 +1682,36 @@ 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.unicode-normalization]] -who = "Alex Crichton " -criteria = "safe-to-deploy" -version = "0.1.19" -notes = """ -This crate contains one usage of `unsafe` which I have manually checked to see -it as correct. This crate's size comes in large part due to the generated -unicode tables that it contains. This crate is additionally widely used -throughout the ecosystem and skimming the crate shows no usage of `std::*` APIs -and nothing suspicious. -""" - [[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.want]] -who = "Pat Hickey " -criteria = "safe-to-deploy" -version = "0.3.0" - [[audits.bytecode-alliance.audits.wast]] who = "Alex Crichton " criteria = "safe-to-deploy" version = "35.0.2" notes = "The Bytecode Alliance is the author of this crate." +[[audits.embark-studios.audits.cargo_metadata]] +who = "Johan Andersson " +criteria = "safe-to-deploy" +delta = "0.15.3 -> 0.15.4" +notes = "No notable changes" + +[[audits.embark-studios.audits.cargo_metadata]] +who = "Johan Andersson " +criteria = "safe-to-deploy" +delta = "0.15.4 -> 0.17.0" +notes = "No notable changes" + +[[audits.embark-studios.audits.ident_case]] +who = "Johan Andersson " +criteria = "safe-to-deploy" +version = "1.0.1" +notes = "No unsafe usage or ambient capabilities" + [[audits.embark-studios.audits.idna]] who = "Johan Andersson " criteria = "safe-to-deploy" @@ -1970,29 +1742,127 @@ criteria = "safe-to-deploy" version = "0.8.2" notes = "No unsafe usage or ambient capabilities" -[[audits.google.audits.dirs-next]] -who = "George Burgess IV " +[[audits.fermyon.audits.oorandom]] +who = "Radu Matei " +criteria = "safe-to-run" +version = "11.1.3" + +[[audits.google.audits.arrayvec]] +who = "Nicholas Bishop " +criteria = "safe-to-run" +version = "0.7.4" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + +[[audits.google.audits.autocfg]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +version = "1.1.0" +notes = """ +Grepped for `-i cipher`, `-i crypto`, `'\bfs\b'``, `'\bnet\b'``, `'\bunsafe\b'`` +and there were no hits except for reasonable, client-controlled usage of +`std::fs` in `AutoCfg::with_dir`. + +This crate has been added to Chromium in +https://source.chromium.org/chromium/chromium/src/+/591a0f30c5eac93b6a3d981c2714ffa4db28dbcb +The CL description contains a link to a Google-internal document with audit details. +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.autocfg]] +who = "Lukasz Anforowicz " criteria = "safe-to-deploy" -version = "2.0.0" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" +delta = "1.1.0 -> 1.2.0" +notes = ''' +Grepped for `-i cipher`, `-i crypto`, `'\bfs\b'``, `'\bnet\b'``, `'\bunsafe\b'`` +and nothing changed from the baseline audit of 1.1.0. Skimmed through the +1.1.0 => 1.2.0 delta and everything seemed okay. +''' +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" -[[audits.google.audits.env_logger]] -who = "George Burgess IV " +[[audits.google.audits.bitflags]] +who = "Lukasz Anforowicz " +criteria = "safe-to-deploy" +version = "2.4.2" +notes = """ +Audit notes: + +* I've checked for any discussion in Google-internal cl/546819168 (where audit + of version 2.3.3 happened) +* `src/lib.rs` contains `#![cfg_attr(not(test), forbid(unsafe_code))]` +* There are 2 cases of `unsafe` in `src/external.rs` but they seem to be + correct in a straightforward way - they just propagate the marker trait's + impl (e.g. `impl bytemuck::Pod`) from the inner to the outer type +* Additional discussion and/or notes may be found in https://crrev.com/c/5238056 +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.bitflags]] +who = "Adrian Taylor " +criteria = "safe-to-deploy" +delta = "2.4.2 -> 2.5.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.clap]] +who = "danakj@chromium.org" criteria = "safe-to-run" -version = "0.9.3" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" +version = "4.4.8" +notes = """ +Reviewed in https://crrev.com/c/5171063 -[[audits.google.audits.env_logger]] -who = "George Burgess IV " +Previously reviewed during security review and the audit is grandparented in. +""" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.clap]] +who = "Lukasz Anforowicz " +criteria = "safe-to-run" +delta = "4.4.8 -> 4.4.14" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.clap]] +who = "Lukasz Anforowicz " criteria = "safe-to-run" -delta = "0.9.3 -> 0.8.4" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" +delta = "4.4.14 -> 4.5.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.clap]] +who = "Lukasz Anforowicz " +criteria = "safe-to-run" +delta = "4.5.0 -> 4.5.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.clap]] +who = "danakj " +criteria = "safe-to-run" +delta = "4.5.1 -> 4.5.2" +notes = "Reviewed in https://crrev.com/c/5362201" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.clap]] +who = "Adrian Taylor " +criteria = "safe-to-run" +delta = "4.5.2 -> 4.5.3" +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.clap]] +who = "Lukasz Anforowicz " +criteria = "safe-to-run" +delta = "4.5.3 -> 4.5.4" +notes = "Minimal diff - only module naming/nesting-related changes." +aggregated-from = "https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT" + +[[audits.google.audits.getrandom]] +who = "David Koloski " +criteria = "safe-to-deploy" +delta = "0.2.2 -> 0.2.12" +notes = "Audited at https://fxrev.dev/932979" +aggregated-from = "https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT" [[audits.google.audits.glob]] who = "George Burgess IV " criteria = "safe-to-deploy" version = "0.3.1" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" [[audits.google.audits.link-cplusplus]] who = "George Burgess IV " @@ -2002,49 +1872,70 @@ notes = """ This crate exists simply to link with libcxx or libstdcxx. No assertions are made about the safety of either of those libraries. :) """ -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + +[[audits.google.audits.nom]] +who = "danakj@chromium.org" +criteria = "safe-to-deploy" +version = "7.1.3" +notes = """ +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 " criteria = "safe-to-deploy" delta = "0.1.0 -> 0.1.1" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" - -[[audits.google.audits.pin-project-lite]] -who = "David Koloski " -criteria = "safe-to-deploy" -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" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" [[audits.google.audits.proc-macro-error-attr]] who = "George Burgess IV " criteria = "safe-to-deploy" version = "1.0.4" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" + +[[audits.google.audits.tinytemplate]] +who = "Ying Hsu " +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.version_check]] who = "George Burgess IV " criteria = "safe-to-deploy" version = "0.9.4" -aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/main/cargo-vet/audits.toml?format=TEXT" +aggregated-from = "https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT" [[audits.isrg.audits.criterion]] who = "Brandon Pitman " criteria = "safe-to-run" delta = "0.4.0 -> 0.5.1" -[[audits.isrg.audits.either]] +[[audits.isrg.audits.crunchy]] +who = "David Cook " +criteria = "safe-to-deploy" +version = "0.2.2" + +[[audits.isrg.audits.digest]] +who = "David Cook " +criteria = "safe-to-deploy" +delta = "0.10.6 -> 0.10.7" + +[[audits.isrg.audits.getrandom]] who = "David Cook " criteria = "safe-to-deploy" -version = "1.6.1" +delta = "0.2.12 -> 0.2.14" + +[[audits.isrg.audits.num-bigint]] +who = "David Cook " +criteria = "safe-to-deploy" +delta = "0.4.3 -> 0.4.4" + +[[audits.isrg.audits.num-integer]] +who = "David Cook " +criteria = "safe-to-deploy" +delta = "0.1.45 -> 0.1.46" [[audits.isrg.audits.once_cell]] who = "Brandon Pitman " @@ -2071,10 +1962,10 @@ who = "David Cook " criteria = "safe-to-deploy" version = "0.6.3" -[[audits.isrg.audits.sha2]] -who = "David Cook " +[[audits.isrg.audits.rayon-core]] +who = "Ameer Ghani " criteria = "safe-to-deploy" -version = "0.10.2" +version = "1.12.1" [[audits.mozilla.wildcard-audits.cexpr]] who = "Emilio Cobos Álvarez " @@ -2114,6 +2005,15 @@ end = "2024-08-28" notes = "I, Henri Sivonen, wrote encoding_rs for Gecko and have reviewed contributions by others. There are two caveats to the certification: 1) The crate does things that are documented to be UB but that do not appear to actually be UB due to integer types differing from the general rule; https://github.com/hsivonen/encoding_rs/issues/79 . 2) It would be prudent to re-review the code that reinterprets buffers of integers as SIMD vectors; see https://github.com/hsivonen/encoding_rs/issues/87 ." aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.wildcard-audits.unicode-normalization]] +who = "Manish Goregaokar " +criteria = "safe-to-deploy" +user-id = 1139 # Manish Goregaokar (Manishearth) +start = "2019-11-06" +end = "2024-05-03" +notes = "All code written or reviewed by Manish" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.wildcard-audits.unicode-segmentation]] who = "Manish Goregaokar " criteria = "safe-to-deploy" @@ -2160,13 +2060,6 @@ criteria = "safe-to-deploy" delta = "0.1.4 -> 0.1.5" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.autocfg]] -who = "Josh Stone " -criteria = "safe-to-deploy" -version = "1.1.0" -notes = "All code written or reviewed by Josh Stone." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - [[audits.mozilla.audits.bindgen]] who = "Emilio Cobos Álvarez " criteria = "safe-to-deploy" @@ -2216,36 +2109,29 @@ 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.bitflags]] -who = "Alex Franchuk " -criteria = "safe-to-deploy" -delta = "1.3.2 -> 2.0.2" -notes = "Removal of some unsafe code/methods. No changes to externals, just some refactoring (mostly internal)." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - -[[audits.mozilla.audits.bitflags]] -who = "Nicolas Silva " +[[audits.mozilla.audits.core-foundation]] +who = "Teodor Tanasoaia " criteria = "safe-to-deploy" -delta = "2.0.2 -> 2.1.0" +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.bitflags]] -who = "Teodor Tanasoaia " +[[audits.mozilla.audits.crossbeam-utils]] +who = "Mike Hommey " criteria = "safe-to-deploy" -delta = "2.2.1 -> 2.3.2" +delta = "0.8.8 -> 0.8.11" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.bitflags]] +[[audits.mozilla.audits.crossbeam-utils]] who = "Mike Hommey " criteria = "safe-to-deploy" -delta = "2.3.3 -> 2.4.0" +delta = "0.8.11 -> 0.8.14" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.bitflags]] +[[audits.mozilla.audits.crossbeam-utils]] who = "Jan-Erik Rediger " criteria = "safe-to-deploy" -delta = "2.4.0 -> 2.4.1" -notes = "Only allowing new clippy lints" +delta = "0.8.14 -> 0.8.19" aggregated-from = "https://raw.githubusercontent.com/mozilla/glean/main/supply-chain/audits.toml" [[audits.mozilla.audits.crypto-common]] @@ -2274,6 +2160,12 @@ criteria = "safe-to-deploy" version = "1.2.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.form_urlencoded]] +who = "Valentin Gosu " +criteria = "safe-to-deploy" +delta = "1.2.0 -> 1.2.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.fxhash]] who = "Bobby Holley " criteria = "safe-to-deploy" @@ -2281,17 +2173,6 @@ version = "0.2.1" notes = "Straightforward crate with no unsafe code, does what it says on the tin." aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.half]] -who = "John M. Schanck " -criteria = "safe-to-deploy" -version = "1.8.2" -notes = """ -This crate contains unsafe code for bitwise casts to/from binary16 floating-point -format. I've reviewed these and found no issues. There are no uses of ambient -capabilities. -""" -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" - [[audits.mozilla.audits.hashbrown]] who = "Mike Hommey " criteria = "safe-to-deploy" @@ -2305,31 +2186,24 @@ criteria = "safe-to-deploy" delta = "0.4.0 -> 0.4.1" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.lazy_static]] -who = "Nika Layzell " -criteria = "safe-to-deploy" -version = "1.4.0" -notes = "I have read over the macros, and audited the unsafe code." -aggregated-from = "https://raw.githubusercontent.com/mozilla/cargo-vet/main/supply-chain/audits.toml" - -[[audits.mozilla.audits.log]] -who = "Mike Hommey " +[[audits.mozilla.audits.idna]] +who = "Valentin Gosu " criteria = "safe-to-deploy" -version = "0.4.17" +delta = "0.4.0 -> 0.5.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.memoffset]] -who = "Gabriele Svelto " +[[audits.mozilla.audits.itertools]] +who = "Mike Hommey " criteria = "safe-to-deploy" -delta = "0.6.5 -> 0.7.1" +delta = "0.10.3 -> 0.10.5" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.new_debug_unreachable]] -who = "Bobby Holley " +[[audits.mozilla.audits.lazy_static]] +who = "Nika Layzell " criteria = "safe-to-deploy" -version = "1.0.4" -notes = "This is a trivial crate." -aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +version = "1.4.0" +notes = "I have read over the macros, and audited the unsafe code." +aggregated-from = "https://raw.githubusercontent.com/mozilla/cargo-vet/main/supply-chain/audits.toml" [[audits.mozilla.audits.num-bigint]] who = "Josh Stone " @@ -2357,6 +2231,12 @@ criteria = "safe-to-deploy" delta = "2.2.0 -> 2.3.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" +[[audits.mozilla.audits.percent-encoding]] +who = "Valentin Gosu " +criteria = "safe-to-deploy" +delta = "2.3.0 -> 2.3.1" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + [[audits.mozilla.audits.phf]] who = "Mike Hommey " criteria = "safe-to-deploy" @@ -2381,10 +2261,16 @@ criteria = "safe-to-deploy" delta = "0.10.0 -> 0.11.2" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.pkg-config]] +[[audits.mozilla.audits.ppv-lite86]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "0.2.16 -> 0.2.17" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.rand_core]] who = "Mike Hommey " criteria = "safe-to-deploy" -delta = "0.3.25 -> 0.3.26" +delta = "0.6.3 -> 0.6.4" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" [[audits.mozilla.audits.rustc-hash]] @@ -2394,10 +2280,22 @@ version = "1.1.0" notes = "Straightforward crate with no unsafe code, does what it says on the tin." aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.sha2]] +[[audits.mozilla.audits.toml]] +who = "Bobby Holley " +criteria = "safe-to-deploy" +delta = "0.5.7 -> 0.5.9" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.toml]] who = "Mike Hommey " criteria = "safe-to-deploy" -delta = "0.10.2 -> 0.10.6" +delta = "0.5.9 -> 0.5.10" +aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" + +[[audits.mozilla.audits.toml]] +who = "Mike Hommey " +criteria = "safe-to-deploy" +delta = "0.5.10 -> 0.5.11" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" [[audits.mozilla.audits.unicode-bidi]] @@ -2406,33 +2304,33 @@ criteria = "safe-to-deploy" delta = "0.3.8 -> 0.3.13" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.unicode-normalization]] -who = "Mike Hommey " +[[audits.mozilla.audits.unicode-bidi]] +who = "Jonathan Kew " criteria = "safe-to-deploy" -delta = "0.1.19 -> 0.1.20" -notes = "I am the author of most of these changes upstream, and prepared the release myself, at which point I looked at the other changes since 0.1.19." +delta = "0.3.13 -> 0.3.14" +notes = "I am the author of the bulk of the upstream changes in this version, and also checked the remaining post-0.3.13 changes." aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" -[[audits.mozilla.audits.unicode-normalization]] -who = "Mike Hommey " +[[audits.mozilla.audits.unicode-bidi]] +who = "Jonathan Kew " criteria = "safe-to-deploy" -delta = "0.1.20 -> 0.1.21" +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.unicode-normalization]] -who = "Mike Hommey " +[[audits.mozilla.audits.url]] +who = "Valentin Gosu " criteria = "safe-to-deploy" -delta = "0.1.21 -> 0.1.22" +version = "2.4.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" [[audits.mozilla.audits.url]] who = "Valentin Gosu " criteria = "safe-to-deploy" -version = "2.4.0" +delta = "2.4.0 -> 2.4.1" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml" [[audits.mozilla.audits.url]] who = "Valentin Gosu " criteria = "safe-to-deploy" -delta = "2.4.0 -> 2.4.1" +delta = "2.4.1 -> 2.5.0" aggregated-from = "https://hg.mozilla.org/mozilla-central/raw-file/tip/supply-chain/audits.toml"