From b1613af5c9b137c6d6cc25b32fbe9b8b316e319c Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 6 May 2024 18:53:12 +0000 Subject: [PATCH 01/16] Reapply "Use wasi-virt for componentized binaries" This reverts commit 75b9ce9c4766ec72610d58f992ecfc486c674d5a. --- lib/ruby_wasm/packager.rb | 23 ++++++++++++++++++++++- lib/ruby_wasm/packager/core.rb | 1 + 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/ruby_wasm/packager.rb b/lib/ruby_wasm/packager.rb index 9b354118fd..4e712e296e 100644 --- a/lib/ruby_wasm/packager.rb +++ b/lib/ruby_wasm/packager.rb @@ -44,7 +44,7 @@ def package(executor, dest_dir, options) fs.remove_stdlib(executor) end - if full_build_options[:target] == "wasm32-unknown-wasip1" && !features.support_dynamic_linking? + if full_build_options[:target] == "wasm32-unknown-wasip1" && !features.support_component_model? # wasi-vfs supports only WASI target wasi_vfs = RubyWasmExt::WasiVfs.new wasi_vfs.map_dir("/bundle", fs.bundle_dir) @@ -54,6 +54,27 @@ def package(executor, dest_dir, options) end wasm_bytes = ruby_core.link_gem_exts(executor, fs.ruby_root, fs.bundle_dir, wasm_bytes) + if features.support_component_model? + tmp_file = "tmp/ruby.component.wasm" + tmp_virt_file = "tmp/ruby.component.virt.wasm" + File.write(tmp_file, wasm_bytes) + args = [ + "wasi-virt", "--stderr=allow", + "--allow-random", "--allow-clocks", "--allow-exit", + "--stdout=allow", "--stdin=allow", + "--allow-all", + "--debug" + ] + [["/bundle", fs.bundle_dir], ["/usr", File.dirname(fs.ruby_root)]].each do |guest, host| + args += ["--mount", "#{guest}=#{host}"] + end + args += ["--out", tmp_virt_file] + args += [tmp_file] + + executor.system(*args) + wasm_bytes = File.binread(tmp_virt_file) + end + wasm_bytes = RubyWasmExt.preinitialize(wasm_bytes) if options[:optimize] wasm_bytes end diff --git a/lib/ruby_wasm/packager/core.rb b/lib/ruby_wasm/packager/core.rb index 7f19cf0d50..07985db391 100644 --- a/lib/ruby_wasm/packager/core.rb +++ b/lib/ruby_wasm/packager/core.rb @@ -306,6 +306,7 @@ def derive_build return @build if @build __skip__ = build ||= RubyWasm::Build.new( name, **@packager.full_build_options, target: target, + wasi_vfs: nil ) build.crossruby.user_exts = user_exts(build) # Emscripten uses --global-base=1024 by default, but it conflicts with From e15195dfb0251b6a6e5c224bd2eb1087cb712015 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 6 May 2024 18:53:20 +0000 Subject: [PATCH 02/16] Revert "Reapply "Remove `RUBY_BUILD_ROOT`"" This reverts commit cff90957f4eb691a92bbdce925204437490c0b8b. --- packages/npm-packages/ruby-wasm-wasi/test/init.js | 5 ++++- packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/npm-packages/ruby-wasm-wasi/test/init.js b/packages/npm-packages/ruby-wasm-wasi/test/init.js index 13620380df..547a8fd5ca 100644 --- a/packages/npm-packages/ruby-wasm-wasi/test/init.js +++ b/packages/npm-packages/ruby-wasm-wasi/test/init.js @@ -74,7 +74,10 @@ async function initComponentRubyVM({ suppressStderr } = { suppressStderr: false } const vm = await RubyVM._instantiate(async (jsRuntime) => { const { cli, clocks, filesystem, io, random, sockets } = preview2Shim; - filesystem._setPreopens({}) + filesystem._setPreopens({ + "/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"), + "/bundle": path.join(process.env.RUBY_BUILD_ROOT, "bundle"), + }) cli._setArgs(["ruby.wasm"].concat(process.argv.slice(2))); cli._setCwd("/") const root = await instantiate(getCoreModule, { diff --git a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs index 1acb269e3b..e8db7dc6d6 100755 --- a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs +++ b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs @@ -39,6 +39,8 @@ const instantiateComponent = async (rootTestFile) => { const dirname = path.dirname(new URL(import.meta.url).pathname); filesystem._setPreopens({ "/__root__": path.join(dirname, ".."), + "/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"), + "/bundle": path.join(process.env.RUBY_BUILD_ROOT, "bundle"), }) cli._setArgs(["ruby.wasm"].concat(process.argv.slice(2))); cli._setCwd("/") From 8e87ab7f73fe88cc83cd043a8f5b74658ea005e2 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Mon, 6 May 2024 18:53:42 +0000 Subject: [PATCH 03/16] Reapply "Enable dynamic linking for RubyWasm components" This reverts commit a42e977b147b93b9e3c469d747fd9e3ff69d5405. --- rakelib/packaging.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rakelib/packaging.rake b/rakelib/packaging.rake index 35a5d1192b..a43b87fc38 100644 --- a/rakelib/packaging.rake +++ b/rakelib/packaging.rake @@ -80,7 +80,7 @@ namespace :npm do component_path = File.join(pkg_dir, "tmp", "ruby.component.wasm") FileUtils.mkdir_p(File.dirname(component_path)) - sh env.merge("RUBY_WASM_EXPERIMENTAL_COMPONENT_MODEL" => "1"), + sh env.merge("RUBY_WASM_EXPERIMENTAL_DYNAMIC_LINKING" => "1"), *build_command, "-o", component_path sh "npx", "jco", "transpile", "--no-wasi-shim", "--instantiation", "--valid-lifting-optimization", From 641fcaf406c4b48e329ccf2567e6bd1f7acdc3cf Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 4 Jun 2024 01:22:36 +0000 Subject: [PATCH 04/16] Partially revert 739a4195931c59df3e27cf0e7894057521d08f70 --- lib/ruby_wasm/packager/core.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/ruby_wasm/packager/core.rb b/lib/ruby_wasm/packager/core.rb index 07985db391..7f19cf0d50 100644 --- a/lib/ruby_wasm/packager/core.rb +++ b/lib/ruby_wasm/packager/core.rb @@ -306,7 +306,6 @@ def derive_build return @build if @build __skip__ = build ||= RubyWasm::Build.new( name, **@packager.full_build_options, target: target, - wasi_vfs: nil ) build.crossruby.user_exts = user_exts(build) # Emscripten uses --global-base=1024 by default, but it conflicts with From b842a82c40d6531ac0f69f79dc68c0e28334c796 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 4 Jun 2024 08:43:03 +0000 Subject: [PATCH 05/16] Configure extconf with baseruby To use latest --target-rbconfig option, we need to use head ruby to run extconf.rb --- lib/ruby_wasm/build/product/crossruby.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ruby_wasm/build/product/crossruby.rb b/lib/ruby_wasm/build/product/crossruby.rb index 0af0b9adbb..946df3703d 100644 --- a/lib/ruby_wasm/build/product/crossruby.rb +++ b/lib/ruby_wasm/build/product/crossruby.rb @@ -80,7 +80,7 @@ def do_extconf(executor, crossruby) "--target-rbconfig=#{rbconfig_rb}", ] extconf_args << "--enable-component-model" if @features.support_component_model? - executor.system Gem.ruby, *extconf_args + executor.system crossruby.baseruby_path, *extconf_args end def do_legacy_extconf(executor, crossruby) From 54ee0d52bdf4adec9a0c7a79385549e91c89b325 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Wed, 5 Jun 2024 04:45:54 +0000 Subject: [PATCH 06/16] Make RUBY_BUILD_ROOT optional with component model setup --- packages/npm-packages/ruby-wasm-wasi/test/init.js | 10 ++++++---- .../ruby-wasm-wasi/tools/run-test-unit.mjs | 11 ++++++----- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/npm-packages/ruby-wasm-wasi/test/init.js b/packages/npm-packages/ruby-wasm-wasi/test/init.js index 547a8fd5ca..e14f1391e4 100644 --- a/packages/npm-packages/ruby-wasm-wasi/test/init.js +++ b/packages/npm-packages/ruby-wasm-wasi/test/init.js @@ -74,10 +74,12 @@ async function initComponentRubyVM({ suppressStderr } = { suppressStderr: false } const vm = await RubyVM._instantiate(async (jsRuntime) => { const { cli, clocks, filesystem, io, random, sockets } = preview2Shim; - filesystem._setPreopens({ - "/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"), - "/bundle": path.join(process.env.RUBY_BUILD_ROOT, "bundle"), - }) + if (process.env.RUBY_BUILD_ROOT) { + filesystem._setPreopens({ + "/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"), + "/bundle": path.join(process.env.RUBY_BUILD_ROOT, "bundle"), + }) + } cli._setArgs(["ruby.wasm"].concat(process.argv.slice(2))); cli._setCwd("/") const root = await instantiate(getCoreModule, { diff --git a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs index e8db7dc6d6..ca64f28913 100755 --- a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs +++ b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs @@ -37,11 +37,12 @@ const instantiateComponent = async (rootTestFile) => { const vm = await RubyVM._instantiate(async (jsRuntime) => { const { cli, clocks, filesystem, io, random, sockets } = preview2Shim; const dirname = path.dirname(new URL(import.meta.url).pathname); - filesystem._setPreopens({ - "/__root__": path.join(dirname, ".."), - "/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"), - "/bundle": path.join(process.env.RUBY_BUILD_ROOT, "bundle"), - }) + const preopens = { "/__root__": path.join(dirname, "..") }; + if (process.env.RUBY_ROOT) { + preopens["/usr"] = path.join(process.env.RUBY_ROOT, "usr"); + preopens["/bundle"] = path.join(process.env.RUBY_ROOT, "bundle"); + } + filesystem._setPreopens(preopens); cli._setArgs(["ruby.wasm"].concat(process.argv.slice(2))); cli._setCwd("/") const root = await instantiate(getCoreModule, { From ed5f8981f38a8c5aec52dafbd642ae6a8e01d3f1 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Wed, 5 Jun 2024 04:46:25 +0000 Subject: [PATCH 07/16] wasi-virt --allow-fs --- lib/ruby_wasm/packager.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/ruby_wasm/packager.rb b/lib/ruby_wasm/packager.rb index 4e712e296e..b1cbcfc6ff 100644 --- a/lib/ruby_wasm/packager.rb +++ b/lib/ruby_wasm/packager.rb @@ -59,9 +59,10 @@ def package(executor, dest_dir, options) tmp_virt_file = "tmp/ruby.component.virt.wasm" File.write(tmp_file, wasm_bytes) args = [ - "wasi-virt", "--stderr=allow", + "wasi-virt", + "--allow-fs", "--allow-random", "--allow-clocks", "--allow-exit", - "--stdout=allow", "--stdin=allow", + "--stdin=allow", "--stdout=allow", "--stderr=allow", "--allow-all", "--debug" ] From a0e7d0cc74d9f00bce5ef90314edd1530f57d317 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Wed, 5 Jun 2024 15:07:51 +0000 Subject: [PATCH 08/16] Add wasi-virt as Cargo dependency --- Cargo.lock | 641 +++++++++++++++++++++++++++++++++++++-- ext/ruby_wasm/Cargo.toml | 1 + 2 files changed, 622 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b26d351956..e2fefca94a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,7 +8,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ - "gimli", + "gimli 0.28.1", ] [[package]] @@ -62,6 +62,55 @@ dependencies = [ "winapi", ] +[[package]] +name = "anstream" +version = "0.6.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" + +[[package]] +name = "anstyle-parse" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.79" @@ -164,6 +213,15 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +[[package]] +name = "bitmaps" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "031043d04099746d8db04daf1fa424b2bc8bd69d92b25962dcde24da39ab64a2" +dependencies = [ + "typenum", +] + [[package]] name = "block-buffer" version = "0.10.4" @@ -313,12 +371,68 @@ dependencies = [ "ansi_term", "atty", "bitflags 1.3.2", - "strsim", + "strsim 0.8.0", "textwrap", "unicode-width", "vec_map", ] +[[package]] +name = "clap" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +dependencies = [ + "clap_builder", + "clap_derive", +] + +[[package]] +name = "clap_builder" +version = "4.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +dependencies = [ + "anstream", + "anstyle", + "clap_lex", + "strsim 0.11.1", +] + +[[package]] +name = "clap_derive" +version = "4.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +dependencies = [ + "heck 0.5.0", + "proc-macro2", + "quote", + "syn 2.0.48", +] + +[[package]] +name = "clap_lex" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" + +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + +[[package]] +name = "colorchoice" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" + [[package]] name = "core-foundation-sys" version = "0.8.6" @@ -365,7 +479,7 @@ dependencies = [ "cranelift-control", "cranelift-entity", "cranelift-isle", - "gimli", + "gimli 0.28.1", "hashbrown 0.14.3", "log", "regalloc2", @@ -502,6 +616,50 @@ dependencies = [ "typenum", ] +[[package]] +name = "cxx" +version = "1.0.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb497fad022245b29c2a0351df572e2d67c1046bcef2260ebc022aec81efea82" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9327c7f9fbd6329a200a5d4aa6f674c60ab256525ff0084b52a889d4e4c60cee" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn 2.0.48", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "688c799a4a846f1c0acb9f36bb9c6272d9b3d9457f3633c7753c6057270df13c" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.122" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928bc249a7e3cd554fd2e8e08a426e9670c50bbfc9a621653cfa9accc9641783" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.48", +] + [[package]] name = "debugid" version = "0.8.0" @@ -593,12 +751,24 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "fallible-iterator" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" + [[package]] name = "fallible-iterator" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" +[[package]] +name = "fastrand" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" + [[package]] name = "fd-lock" version = "4.0.2" @@ -610,6 +780,12 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "fixedbitset" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -734,13 +910,24 @@ dependencies = [ "wasi", ] +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +dependencies = [ + "fallible-iterator 0.2.0", + "indexmap 1.9.3", + "stable_deref_trait", +] + [[package]] name = "gimli" version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ - "fallible-iterator", + "fallible-iterator 0.3.0", "indexmap 2.1.0", "stable_deref_trait", ] @@ -790,6 +977,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -844,6 +1037,20 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "im-rc" +version = "15.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1955a75fa080c677d3972822ec4bad316169ab1cfc6c257a942c2265dbe5fe" +dependencies = [ + "bitmaps", + "rand_core", + "rand_xoshiro", + "sized-chunks", + "typenum", + "version_check", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -887,6 +1094,12 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.10.5" @@ -985,6 +1198,15 @@ dependencies = [ "redox_syscall", ] +[[package]] +name = "link-cplusplus" +version = "1.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" +dependencies = [ + "cc", +] + [[package]] name = "linux-raw-sys" version = "0.4.12" @@ -1142,6 +1364,16 @@ version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" +[[package]] +name = "petgraph" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" +dependencies = [ + "fixedbitset", + "indexmap 2.1.0", +] + [[package]] name = "pin-project-lite" version = "0.2.13" @@ -1247,6 +1479,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rand_xoshiro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa" +dependencies = [ + "rand_core", +] + [[package]] name = "rayon" version = "1.8.0" @@ -1367,7 +1608,8 @@ dependencies = [ "magnus", "structopt", "wasi-vfs-cli", - "wit-component", + "wasi-virt", + "wit-component 0.203.0", "wizer", ] @@ -1398,12 +1640,24 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustversion" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" + [[package]] name = "ryu" version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +[[package]] +name = "scratch" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" + [[package]] name = "semver" version = "1.0.21" @@ -1447,6 +1701,28 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_yaml" +version = "0.9.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" +dependencies = [ + "indexmap 2.1.0", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sha2" version = "0.10.8" @@ -1479,6 +1755,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +[[package]] +name = "sized-chunks" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "16d69225bde7a69b235da73377861095455d298f2b970996eec25ddbb42b3d1e" +dependencies = [ + "bitmaps", + "typenum", +] + [[package]] name = "slice-group-by" version = "0.3.1" @@ -1528,13 +1814,19 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + [[package]] name = "structopt" version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" dependencies = [ - "clap", + "clap 2.34.0", "lazy_static", "structopt-derive", ] @@ -1552,6 +1844,25 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "strum" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" + +[[package]] +name = "strum_macros" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +dependencies = [ + "heck 0.4.1", + "proc-macro2", + "quote", + "rustversion", + "syn 1.0.109", +] + [[package]] name = "syn" version = "1.0.109" @@ -1596,6 +1907,28 @@ version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +[[package]] +name = "tempfile" +version = "3.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +dependencies = [ + "cfg-if", + "fastrand", + "redox_syscall", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "termcolor" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" +dependencies = [ + "winapi-util", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -1665,6 +1998,40 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.8.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.22.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tracing" version = "0.1.40" @@ -1742,6 +2109,12 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "unsafe-libyaml" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" + [[package]] name = "url" version = "2.5.0" @@ -1753,6 +2126,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "uuid" version = "1.6.1" @@ -1771,6 +2150,34 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "walrus" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c03529cd0c4400a2449f640d2f27cd1b48c3065226d15e26d98e4429ab0adb7" +dependencies = [ + "anyhow", + "gimli 0.26.2", + "id-arena", + "leb128", + "log", + "walrus-macro", + "wasm-encoder 0.29.0", + "wasmparser 0.80.2", +] + +[[package]] +name = "walrus-macro" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e5bd22c71e77d60140b0bd5be56155a37e5bd14e24f5f87298040d0cc40d7" +dependencies = [ + "heck 0.3.3", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1832,6 +2239,22 @@ dependencies = [ "wizer", ] +[[package]] +name = "wasi-virt" +version = "0.1.0" +source = "git+https://github.com/bytecodealliance/wasi-virt?rev=b2581ff6e993c7c3cb6f5d899977bbce3d4c6c60#b2581ff6e993c7c3cb6f5d899977bbce3d4c6c60" +dependencies = [ + "anyhow", + "clap 4.5.4", + "serde", + "toml 0.8.14", + "walrus", + "wasm-compose", + "wasm-metadata 0.10.20", + "wasm-opt", + "wit-component 0.21.0", +] + [[package]] name = "wasm-bindgen" version = "0.2.89" @@ -1886,6 +2309,36 @@ version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +[[package]] +name = "wasm-compose" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd324927af875ebedb1b820c00e3c585992d33c2c787c5021fe6d8982527359b" +dependencies = [ + "anyhow", + "heck 0.4.1", + "im-rc", + "indexmap 2.1.0", + "log", + "petgraph", + "serde", + "serde_derive", + "serde_yaml", + "smallvec", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", + "wat", +] + +[[package]] +name = "wasm-encoder" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18c41dbd92eaebf3612a39be316540b8377c871cb9bde6b064af962984912881" +dependencies = [ + "leb128", +] + [[package]] name = "wasm-encoder" version = "0.30.0" @@ -1904,6 +2357,16 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-encoder" +version = "0.41.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "972f97a5d8318f908dded23594188a90bcd09365986b1163e66d70170e5287ae" +dependencies = [ + "leb128", + "wasmparser 0.121.2", +] + [[package]] name = "wasm-encoder" version = "0.203.0" @@ -1913,6 +2376,31 @@ dependencies = [ "leb128", ] +[[package]] +name = "wasm-encoder" +version = "0.209.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b4a05336882dae732ce6bd48b7e11fe597293cb72c13da4f35d7d5f8d53b2a7" +dependencies = [ + "leb128", +] + +[[package]] +name = "wasm-metadata" +version = "0.10.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" +dependencies = [ + "anyhow", + "indexmap 2.1.0", + "serde", + "serde_derive", + "serde_json", + "spdx", + "wasm-encoder 0.41.2", + "wasmparser 0.121.2", +] + [[package]] name = "wasm-metadata" version = "0.203.0" @@ -1929,6 +2417,52 @@ dependencies = [ "wasmparser 0.203.0", ] +[[package]] +name = "wasm-opt" +version = "0.116.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" +dependencies = [ + "anyhow", + "libc", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "wasm-opt-cxx-sys", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-cxx-sys" +version = "0.116.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" +dependencies = [ + "anyhow", + "cxx", + "cxx-build", + "wasm-opt-sys", +] + +[[package]] +name = "wasm-opt-sys" +version = "0.116.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" +dependencies = [ + "anyhow", + "cc", + "cxx", + "cxx-build", +] + +[[package]] +name = "wasmparser" +version = "0.80.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "449167e2832691a1bff24cde28d2804e90e09586a448c8e76984792c44334a6b" + [[package]] name = "wasmparser" version = "0.106.0" @@ -1949,6 +2483,17 @@ dependencies = [ "semver", ] +[[package]] +name = "wasmparser" +version = "0.121.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" +dependencies = [ + "bitflags 2.4.1", + "indexmap 2.1.0", + "semver", +] + [[package]] name = "wasmparser" version = "0.203.0" @@ -2033,7 +2578,7 @@ dependencies = [ "serde", "serde_derive", "sha2", - "toml", + "toml 0.5.11", "windows-sys 0.48.0", "zstd", ] @@ -2073,7 +2618,7 @@ dependencies = [ "cranelift-frontend", "cranelift-native", "cranelift-wasm", - "gimli", + "gimli 0.28.1", "log", "object", "target-lexicon", @@ -2094,7 +2639,7 @@ dependencies = [ "cranelift-codegen", "cranelift-control", "cranelift-native", - "gimli", + "gimli 0.28.1", "object", "target-lexicon", "wasmtime-environ", @@ -2108,7 +2653,7 @@ checksum = "61eb64fb3e0da883e2df4a13a81d6282e072336e6cb6295021d0f7ab2e352754" dependencies = [ "anyhow", "cranelift-entity", - "gimli", + "gimli 0.28.1", "indexmap 2.1.0", "log", "object", @@ -2149,7 +2694,7 @@ dependencies = [ "bincode", "cfg-if", "cpp_demangle", - "gimli", + "gimli 0.28.1", "ittapi", "log", "object", @@ -2285,7 +2830,7 @@ checksum = "2c6f945ff9bad96e0a69973d74f193c19f627c8adbf250e7cb73ae7564b6cc8a" dependencies = [ "anyhow", "cranelift-codegen", - "gimli", + "gimli 0.28.1", "object", "target-lexicon", "wasmparser 0.118.1", @@ -2323,23 +2868,24 @@ dependencies = [ [[package]] name = "wast" -version = "69.0.1" +version = "209.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ee37317321afde358e4d7593745942c48d6d17e0e6e943704de9bbee121e7a" +checksum = "8fffef2ff6147e4d12e972765fd75332c6a11c722571d4ab7a780d81ffc8f0a4" dependencies = [ + "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.38.1", + "wasm-encoder 0.209.1", ] [[package]] name = "wat" -version = "1.0.82" +version = "1.209.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeb338ee8dee4d4cd05e6426683f21c5087dc7cfc8903e839ccf48d43332da3c" +checksum = "42203ec0271d113f8eb1f77ebc624886530cecb35915a7f63a497131f16e4d24" dependencies = [ - "wast 69.0.1", + "wast 209.0.1", ] [[package]] @@ -2400,6 +2946,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +[[package]] +name = "winapi-util" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +dependencies = [ + "windows-sys 0.52.0", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2414,7 +2969,7 @@ checksum = "58e58c236a6abdd9ab454552b4f29e16cfa837a86897c1503313b2e62e7609ec" dependencies = [ "anyhow", "cranelift-codegen", - "gimli", + "gimli 0.28.1", "regalloc2", "smallvec", "target-lexicon", @@ -2563,6 +3118,15 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +[[package]] +name = "winnow" +version = "0.6.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56c52728401e1dc672a56e81e593e912aa54c78f40246869f78359a2bf24d29d" +dependencies = [ + "memchr", +] + [[package]] name = "winx" version = "0.36.3" @@ -2573,6 +3137,25 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "wit-component" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be60cd1b2ff7919305301d0c27528d4867bd793afe890ba3837743da9655d91b" +dependencies = [ + "anyhow", + "bitflags 2.4.1", + "indexmap 2.1.0", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder 0.41.2", + "wasm-metadata 0.10.20", + "wasmparser 0.121.2", + "wit-parser 0.14.0", +] + [[package]] name = "wit-component" version = "0.203.0" @@ -2587,7 +3170,7 @@ dependencies = [ "serde_derive", "serde_json", "wasm-encoder 0.203.0", - "wasm-metadata", + "wasm-metadata 0.203.0", "wasmparser 0.203.0", "wit-parser 0.203.0", ] @@ -2609,6 +3192,24 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "wit-parser" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee4ad7310367bf272507c0c8e0c74a80b4ed586b833f7c7ca0b7588f686f11a" +dependencies = [ + "anyhow", + "id-arena", + "indexmap 2.1.0", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser 0.121.2", +] + [[package]] name = "wit-parser" version = "0.203.0" diff --git a/ext/ruby_wasm/Cargo.toml b/ext/ruby_wasm/Cargo.toml index 7d759919a4..80efd76dc5 100644 --- a/ext/ruby_wasm/Cargo.toml +++ b/ext/ruby_wasm/Cargo.toml @@ -16,3 +16,4 @@ wizer = "4.0.0" wasi-vfs-cli = { git = "https://github.com/kateinoigakukun/wasi-vfs/", tag = "0.5.2" } structopt = "0.3.26" wit-component = "0.203.0" +wasi-virt = { git = "https://github.com/bytecodealliance/wasi-virt", rev = "b2581ff6e993c7c3cb6f5d899977bbce3d4c6c60" } From 76c6af65f10ff743a23e35c8b2d55938cf64bac3 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 18 Jun 2024 18:20:33 +0000 Subject: [PATCH 09/16] Integrate wasi-virt at crate level instead of CLI --- Cargo.lock | 25 +++++++++- ext/ruby_wasm/Cargo.toml | 1 + ext/ruby_wasm/src/lib.rs | 100 +++++++++++++++++++++++++++++++++++++- lib/ruby_wasm/packager.rb | 22 ++------- 4 files changed, 129 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e2fefca94a..6357b59ac5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1609,6 +1609,7 @@ dependencies = [ "structopt", "wasi-vfs-cli", "wasi-virt", + "wasm-compose 0.203.0", "wit-component 0.203.0", "wizer", ] @@ -2249,7 +2250,7 @@ dependencies = [ "serde", "toml 0.8.14", "walrus", - "wasm-compose", + "wasm-compose 0.5.5", "wasm-metadata 0.10.20", "wasm-opt", "wit-component 0.21.0", @@ -2330,6 +2331,27 @@ dependencies = [ "wat", ] +[[package]] +name = "wasm-compose" +version = "0.203.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63d50fd3a3dd038d0910842ca01c2fe99edd15caff33caa990477cce4421c72e" +dependencies = [ + "anyhow", + "heck 0.4.1", + "im-rc", + "indexmap 2.1.0", + "log", + "petgraph", + "serde", + "serde_derive", + "serde_yaml", + "smallvec", + "wasm-encoder 0.203.0", + "wasmparser 0.203.0", + "wat", +] + [[package]] name = "wasm-encoder" version = "0.29.0" @@ -2374,6 +2396,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "87e3b46a0d9d9143d57aa926c42e2af284b5cb8f0c7b71079afc7a6fca42db50" dependencies = [ "leb128", + "wasmparser 0.203.0", ] [[package]] diff --git a/ext/ruby_wasm/Cargo.toml b/ext/ruby_wasm/Cargo.toml index 80efd76dc5..ce3586d9e5 100644 --- a/ext/ruby_wasm/Cargo.toml +++ b/ext/ruby_wasm/Cargo.toml @@ -16,4 +16,5 @@ wizer = "4.0.0" wasi-vfs-cli = { git = "https://github.com/kateinoigakukun/wasi-vfs/", tag = "0.5.2" } structopt = "0.3.26" wit-component = "0.203.0" +wasm-compose = "0.203.0" wasi-virt = { git = "https://github.com/bytecodealliance/wasi-virt", rev = "b2581ff6e993c7c3cb6f5d899977bbce3d4c6c60" } diff --git a/ext/ruby_wasm/src/lib.rs b/ext/ruby_wasm/src/lib.rs index 1d33c6dc5c..ca3fcff2a2 100644 --- a/ext/ruby_wasm/src/lib.rs +++ b/ext/ruby_wasm/src/lib.rs @@ -1,4 +1,4 @@ -use std::{collections::HashMap, path::PathBuf}; +use std::{collections::HashMap, env, path::PathBuf, time::SystemTime}; use magnus::{ eval, exception, function, method, @@ -8,6 +8,7 @@ use magnus::{ }; use structopt::StructOpt; use wizer::Wizer; +use wasi_virt; static RUBY_WASM: value::Lazy = value::Lazy::new(|ruby| ruby.define_module("RubyWasmExt").unwrap()); @@ -222,6 +223,96 @@ impl ComponentEncode { } } +#[wrap(class = "RubyWasmExt::WasiVirt")] +struct WasiVirt(std::cell::RefCell>); + +impl WasiVirt { + fn new() -> Self { + Self(std::cell::RefCell::new(Some(wasi_virt::WasiVirt::new()))) + } + + fn virt( + &self, + body: impl FnOnce(&mut wasi_virt::WasiVirt) -> Result, + ) -> Result { + let mut virt = self.0.take().ok_or_else(|| { + Error::new( + exception::standard_error(), + "wasi virt is already consumed".to_string(), + ) + })?; + let result = body(&mut virt)?; + self.0.replace(Some(virt)); + Ok(result) + } + + fn allow_all(&self) -> Result<(), Error> { + self.virt(|virt| { + virt.allow_all(); + Ok(()) + }) + } + + fn map_dir(&self, guest_dir: String, host_dir: String) -> Result<(), Error> { + self.virt(|virt| { + virt.fs().virtual_preopen(guest_dir, host_dir); + Ok(()) + }) + } + + fn finish(&self) -> Result { + self.virt(|virt| { + let result = virt.finish().map_err(|e| { + Error::new( + exception::standard_error(), + format!("failed to generate virtualization adapter: {}", e), + ) + })?; + Ok(result.adapter.into()) + }) + } + + fn compose(&self, component_bytes: bytes::Bytes) -> Result { + let virt_adapter = self.finish()?; + let tmpdir = env::temp_dir(); + let tmp_virt = tmpdir.join(format!("virt{}.wasm", timestamp())); + std::fs::write(&tmp_virt, &virt_adapter).map_err(|e| { + Error::new( + exception::standard_error(), + format!("failed to write virt adapter: {}", e), + ) + })?; + let tmp_component = tmpdir.join(format!("component{}.wasm", timestamp())); + std::fs::write(&tmp_component, &component_bytes).map_err(|e| { + Error::new( + exception::standard_error(), + format!("failed to write component: {}", e), + ) + })?; + + use wasm_compose::{composer, config}; + let config = config::Config { + definitions: vec![tmp_virt], + ..Default::default() + }; + let composer = composer::ComponentComposer::new(&tmp_component, &config); + let composed = composer.compose().map_err(|e| { + Error::new( + exception::standard_error(), + format!("failed to compose component: {}", e), + ) + })?; + return Ok(composed.into()); + + fn timestamp() -> u64 { + match SystemTime::now().duration_since(SystemTime::UNIX_EPOCH) { + Ok(n) => n.as_secs(), + Err(_) => panic!(), + } + } + } +} + #[magnus::init] fn init(ruby: &Ruby) -> Result<(), Error> { let module = RUBY_WASM.get_inner_with(ruby); @@ -266,5 +357,12 @@ fn init(ruby: &Ruby) -> Result<(), Error> { )?; component_encode.define_method("encode", method!(ComponentEncode::encode, 0))?; + let wasi_virt = module.define_class("WasiVirt", ruby.class_object())?; + wasi_virt.define_singleton_method("new", function!(WasiVirt::new, 0))?; + wasi_virt.define_method("allow_all", method!(WasiVirt::allow_all, 0))?; + wasi_virt.define_method("map_dir", method!(WasiVirt::map_dir, 2))?; + wasi_virt.define_method("finish", method!(WasiVirt::finish, 0))?; + wasi_virt.define_method("compose", method!(WasiVirt::compose, 1))?; + Ok(()) } diff --git a/lib/ruby_wasm/packager.rb b/lib/ruby_wasm/packager.rb index b1cbcfc6ff..63e4a35e38 100644 --- a/lib/ruby_wasm/packager.rb +++ b/lib/ruby_wasm/packager.rb @@ -55,25 +55,13 @@ def package(executor, dest_dir, options) wasm_bytes = ruby_core.link_gem_exts(executor, fs.ruby_root, fs.bundle_dir, wasm_bytes) if features.support_component_model? - tmp_file = "tmp/ruby.component.wasm" - tmp_virt_file = "tmp/ruby.component.virt.wasm" - File.write(tmp_file, wasm_bytes) - args = [ - "wasi-virt", - "--allow-fs", - "--allow-random", "--allow-clocks", "--allow-exit", - "--stdin=allow", "--stdout=allow", "--stderr=allow", - "--allow-all", - "--debug" - ] + wasi_virt = RubyWasmExt::WasiVirt.new + wasi_virt.allow_all [["/bundle", fs.bundle_dir], ["/usr", File.dirname(fs.ruby_root)]].each do |guest, host| - args += ["--mount", "#{guest}=#{host}"] + RubyWasm.logger.debug "Adding files into VFS: #{host} => #{guest}" + wasi_virt.map_dir(guest, host) end - args += ["--out", tmp_virt_file] - args += [tmp_file] - - executor.system(*args) - wasm_bytes = File.binread(tmp_virt_file) + wasm_bytes = wasi_virt.compose(wasm_bytes) end wasm_bytes = RubyWasmExt.preinitialize(wasm_bytes) if options[:optimize] From 9f60301a6bd847e63b274fc4384ea65fdcf7c0fc Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 18 Jun 2024 18:30:02 +0000 Subject: [PATCH 10/16] Fix `rake check:type` --- lib/ruby_wasm/packager.rb | 6 +++++- sig/ruby_wasm/ext.rbs | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/lib/ruby_wasm/packager.rb b/lib/ruby_wasm/packager.rb index 63e4a35e38..b54e70ba19 100644 --- a/lib/ruby_wasm/packager.rb +++ b/lib/ruby_wasm/packager.rb @@ -57,7 +57,11 @@ def package(executor, dest_dir, options) if features.support_component_model? wasi_virt = RubyWasmExt::WasiVirt.new wasi_virt.allow_all - [["/bundle", fs.bundle_dir], ["/usr", File.dirname(fs.ruby_root)]].each do |guest, host| + [ + { guest: "/bundle", host: fs.bundle_dir }, + { guest: "/usr", host: File.dirname(fs.ruby_root) } + ].each do |map| + map => { guest:, host: } RubyWasm.logger.debug "Adding files into VFS: #{host} => #{guest}" wasi_virt.map_dir(guest, host) end diff --git a/sig/ruby_wasm/ext.rbs b/sig/ruby_wasm/ext.rbs index 2a4278b560..3db20d0a76 100644 --- a/sig/ruby_wasm/ext.rbs +++ b/sig/ruby_wasm/ext.rbs @@ -33,4 +33,12 @@ module RubyWasmExt def import_name_map: (Hash[String, String] map) -> void def encode: () -> bytes end + + class WasiVirt + def initialize: () -> void + def allow_all: () -> void + def map_dir: (String guest_path, String host_path) -> void + def finish: () -> bytes + def compose: (bytes component_bytes) -> bytes + end end From 62b3be09f7267a87c33742ec61efa2b699cf3d33 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Tue, 18 Jun 2024 18:32:06 +0000 Subject: [PATCH 11/16] Update MSRV to 1.76.0 --- builders/wasm32-unknown-emscripten/Dockerfile | 2 +- builders/wasm32-unknown-wasi/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builders/wasm32-unknown-emscripten/Dockerfile b/builders/wasm32-unknown-emscripten/Dockerfile index 3b58798133..c78ee6586e 100644 --- a/builders/wasm32-unknown-emscripten/Dockerfile +++ b/builders/wasm32-unknown-emscripten/Dockerfile @@ -23,7 +23,7 @@ ENV PATH=/usr/bin:$PATH ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.75 + RUST_VERSION=1.76.0 RUN set -eux pipefail; \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ diff --git a/builders/wasm32-unknown-wasi/Dockerfile b/builders/wasm32-unknown-wasi/Dockerfile index be2175bf4a..ffb5121953 100644 --- a/builders/wasm32-unknown-wasi/Dockerfile +++ b/builders/wasm32-unknown-wasi/Dockerfile @@ -27,7 +27,7 @@ RUN set -eux pipefail; \ ENV RUSTUP_HOME=/usr/local/rustup \ CARGO_HOME=/usr/local/cargo \ PATH=/usr/local/cargo/bin:$PATH \ - RUST_VERSION=1.75 + RUST_VERSION=1.76.0 RUN set -eux pipefail; \ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | \ From e7f6b7c0c58deb0b8739a573f7b507c057d7e18e Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Wed, 19 Jun 2024 09:54:33 +0000 Subject: [PATCH 12/16] Get rid of wasm-opt crate dependency --- Cargo.lock | 174 +-------------------------------------- ext/ruby_wasm/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 174 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6357b59ac5..1d4bf9538d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -417,16 +417,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "colorchoice" version = "1.0.1" @@ -616,50 +606,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "cxx" -version = "1.0.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb497fad022245b29c2a0351df572e2d67c1046bcef2260ebc022aec81efea82" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9327c7f9fbd6329a200a5d4aa6f674c60ab256525ff0084b52a889d4e4c60cee" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn 2.0.48", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c799a4a846f1c0acb9f36bb9c6272d9b3d9457f3633c7753c6057270df13c" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.122" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "928bc249a7e3cd554fd2e8e08a426e9670c50bbfc9a621653cfa9accc9641783" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.48", -] - [[package]] name = "debugid" version = "0.8.0" @@ -763,12 +709,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" -[[package]] -name = "fastrand" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" - [[package]] name = "fd-lock" version = "4.0.2" @@ -1198,15 +1138,6 @@ dependencies = [ "redox_syscall", ] -[[package]] -name = "link-cplusplus" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d240c6f7e1ba3a28b0249f774e6a9dd0175054b52dfbb61b16eb8505c3785c9" -dependencies = [ - "cc", -] - [[package]] name = "linux-raw-sys" version = "0.4.12" @@ -1641,24 +1572,12 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustversion" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" - [[package]] name = "ryu" version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" -[[package]] -name = "scratch" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3cf7c11c38cb994f3d40e8a8cde3bbd1f72a435e4c49e85d6553d8312306152" - [[package]] name = "semver" version = "1.0.21" @@ -1845,25 +1764,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - [[package]] name = "syn" version = "1.0.109" @@ -1908,28 +1808,6 @@ version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" -[[package]] -name = "tempfile" -version = "3.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" -dependencies = [ - "cfg-if", - "fastrand", - "redox_syscall", - "rustix", - "windows-sys 0.52.0", -] - -[[package]] -name = "termcolor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" -dependencies = [ - "winapi-util", -] - [[package]] name = "textwrap" version = "0.11.0" @@ -2243,7 +2121,7 @@ dependencies = [ [[package]] name = "wasi-virt" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/wasi-virt?rev=b2581ff6e993c7c3cb6f5d899977bbce3d4c6c60#b2581ff6e993c7c3cb6f5d899977bbce3d4c6c60" +source = "git+https://github.com/bytecodealliance/wasi-virt?rev=refs/pull/63/head#8772e0f6e257d8fd89e108da4cc8b6d2722cffcd" dependencies = [ "anyhow", "clap 4.5.4", @@ -2252,7 +2130,6 @@ dependencies = [ "walrus", "wasm-compose 0.5.5", "wasm-metadata 0.10.20", - "wasm-opt", "wit-component 0.21.0", ] @@ -2440,46 +2317,6 @@ dependencies = [ "wasmparser 0.203.0", ] -[[package]] -name = "wasm-opt" -version = "0.116.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd87a4c135535ffed86123b6fb0f0a5a0bc89e50416c942c5f0662c645f679c" -dependencies = [ - "anyhow", - "libc", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "wasm-opt-cxx-sys", - "wasm-opt-sys", -] - -[[package]] -name = "wasm-opt-cxx-sys" -version = "0.116.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c57b28207aa724318fcec6575fe74803c23f6f266fce10cbc9f3f116762f12e" -dependencies = [ - "anyhow", - "cxx", - "cxx-build", - "wasm-opt-sys", -] - -[[package]] -name = "wasm-opt-sys" -version = "0.116.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a1cce564dc768dacbdb718fc29df2dba80bd21cb47d8f77ae7e3d95ceb98cbe" -dependencies = [ - "anyhow", - "cc", - "cxx", - "cxx-build", -] - [[package]] name = "wasmparser" version = "0.80.2" @@ -2969,15 +2806,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" -[[package]] -name = "winapi-util" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" -dependencies = [ - "windows-sys 0.52.0", -] - [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" diff --git a/ext/ruby_wasm/Cargo.toml b/ext/ruby_wasm/Cargo.toml index ce3586d9e5..afbcc1c224 100644 --- a/ext/ruby_wasm/Cargo.toml +++ b/ext/ruby_wasm/Cargo.toml @@ -17,4 +17,4 @@ wasi-vfs-cli = { git = "https://github.com/kateinoigakukun/wasi-vfs/", tag = "0. structopt = "0.3.26" wit-component = "0.203.0" wasm-compose = "0.203.0" -wasi-virt = { git = "https://github.com/bytecodealliance/wasi-virt", rev = "b2581ff6e993c7c3cb6f5d899977bbce3d4c6c60" } +wasi-virt = { git = "https://github.com/bytecodealliance/wasi-virt", rev = "refs/pull/63/head", default-features = false } From 6d91d090ff7b8fcde2f8fe401f3e2e1302a0cc39 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 21 Jun 2024 04:21:15 +0000 Subject: [PATCH 13/16] Update wit-component --- Cargo.lock | 699 +++++++++++++++++++++------------------ ext/ruby_wasm/Cargo.toml | 7 +- 2 files changed, 372 insertions(+), 334 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1d4bf9538d..c28bbf89de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,15 @@ dependencies = [ "gimli 0.28.1", ] +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "gimli 0.29.0", +] + [[package]] name = "adler" version = "1.0.2" @@ -19,9 +28,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.7" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" dependencies = [ "cfg-if", "once_cell", @@ -31,9 +40,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -113,9 +122,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arbitrary" @@ -125,13 +134,13 @@ checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -147,30 +156,30 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ - "addr2line", + "addr2line 0.22.0", "cc", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.0", "rustc-demangle", ] [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "bincode" @@ -183,22 +192,22 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.69.1" +version = "0.69.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "cexpr", "clang-sys", + "itertools 0.12.1", "lazy_static", "lazycell", - "peeking_take_while", "proc-macro2", "quote", "regex", "rustc-hash", "shlex", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -209,9 +218,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 = "bitmaps" @@ -233,9 +242,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -245,9 +254,9 @@ 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 = "cap-fs-ext" @@ -328,12 +337,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -353,9 +363,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -379,9 +389,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.4" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -389,9 +399,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -401,21 +411,21 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "colorchoice" @@ -470,7 +480,7 @@ dependencies = [ "cranelift-entity", "cranelift-isle", "gimli 0.28.1", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "log", "regalloc2", "smallvec", @@ -549,52 +559,46 @@ 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.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.17" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -668,15 +672,15 @@ dependencies = [ [[package]] name = "either" -version = "1.9.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[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", ] @@ -689,9 +693,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -822,7 +826,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", @@ -841,9 +845,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -868,10 +872,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" dependencies = [ "fallible-iterator 0.3.0", - "indexmap 2.1.0", + "indexmap 2.2.6", "stable_deref_trait", ] +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" + [[package]] name = "glob" version = "0.3.1" @@ -895,9 +905,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", ] @@ -934,15 +944,15 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[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", @@ -1003,20 +1013,20 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.14.5", "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", "windows-sys 0.52.0", @@ -1049,11 +1059,20 @@ 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.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "ittapi" @@ -1077,18 +1096,18 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -1113,42 +1132,41 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.152" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.5", ] [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "libc", - "redox_syscall", ] [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "mach" @@ -1161,9 +1179,9 @@ dependencies = [ [[package]] name = "magnus" -version = "0.6.2" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4778544796676e8428e9c622460ebf284bea52d8b10db3aeb449d8b5e61b3a13" +checksum = "b1597ef40aa8c36be098249e82c9a20cf7199278ac1c1a1a995eeead6a184479" dependencies = [ "bytes", "magnus-macros", @@ -1180,7 +1198,7 @@ checksum = "5968c820e2960565f647819f5928a42d6e874551cab9d88d75e3e0660d7f71e3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1191,9 +1209,9 @@ checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memfd" @@ -1206,9 +1224,9 @@ dependencies = [ [[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", ] @@ -1221,18 +1239,18 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", @@ -1255,7 +1273,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.9", "libc", ] @@ -1266,8 +1284,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "crc32fast", - "hashbrown 0.14.3", - "indexmap 2.1.0", + "hashbrown 0.14.5", + "indexmap 2.2.6", + "memchr", +] + +[[package]] +name = "object" +version = "0.36.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +dependencies = [ "memchr", ] @@ -1279,15 +1306,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -1302,14 +1323,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4c5cc86750666a3ed20bdaf5ca2a0344f9c67674cae0515bec2da16fbaa47db" dependencies = [ "fixedbitset", - "indexmap 2.1.0", + "indexmap 2.2.6", ] [[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" @@ -1319,9 +1340,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "ppv-lite86" @@ -1355,9 +1376,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -1373,9 +1394,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", ] @@ -1421,9 +1442,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -1431,9 +1452,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -1460,7 +1481,7 @@ dependencies = [ "quote", "regex", "shell-words", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1469,20 +1490,11 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a35802679f07360454b418a5d1735c89716bde01d35b1560fc953c1415a0b3bb" -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -1504,9 +1516,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -1516,9 +1528,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -1527,9 +1539,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "ruby_wasm" @@ -1541,15 +1553,15 @@ dependencies = [ "wasi-vfs-cli", "wasi-virt", "wasm-compose 0.203.0", - "wit-component 0.203.0", + "wit-component 0.211.1", "wizer", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1559,11 +1571,11 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.5.0", "errno", "itoa", "libc", @@ -1574,15 +1586,15 @@ dependencies = [ [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "seq-macro" @@ -1592,29 +1604,29 @@ checksum = "a3f0bf26fd526d2a95683cd0f87bf103b8539e2ca1ef48ce002d67aad59aa0b4" [[package]] name = "serde" -version = "1.0.195" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -1632,11 +1644,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.30" +version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" +checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "itoa", "ryu", "serde", @@ -1671,9 +1683,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "sized-chunks" @@ -1693,25 +1705,25 @@ 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 = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "spdx" -version = "0.10.4" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29ef1a0fa1e39ac22972c8db23ff89aea700ab96aa87114e1fb55937a631a0c9" +checksum = "47317bbaf63785b53861e1ae2d11b80d6b624211d42cb20efcd210ee6f8a14bc" dependencies = [ "smallvec", ] @@ -1777,9 +1789,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", @@ -1792,7 +1804,7 @@ 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", @@ -1804,9 +1816,9 @@ dependencies = [ [[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 = "textwrap" @@ -1819,22 +1831,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1854,9 +1866,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -1904,7 +1916,7 @@ version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", @@ -1931,7 +1943,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -1951,9 +1963,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -1963,24 +1975,24 @@ 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.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" +checksum = "d4c87d22b6e3f4a18d4d40ef354e97c90fcb14dd91d7dc0aa9d8a1172ebf7202" [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "unicode-xid" @@ -1996,9 +2008,9 @@ checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -2007,15 +2019,15 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.6.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e395fcf16a7a3d8127ec99782007af141946b4795001f876d54fb0d55978560" +checksum = "a183cf7feeba97b4dd1c0d46788634f6221d87fa961b305bed08c851829efcc0" [[package]] name = "vec_map" @@ -2093,7 +2105,7 @@ 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", @@ -2121,10 +2133,10 @@ dependencies = [ [[package]] name = "wasi-virt" version = "0.1.0" -source = "git+https://github.com/bytecodealliance/wasi-virt?rev=refs/pull/63/head#8772e0f6e257d8fd89e108da4cc8b6d2722cffcd" +source = "git+https://github.com/bytecodealliance/wasi-virt?rev=02de7b495eba3f1bf786bf17cf2236b7277be7b0#02de7b495eba3f1bf786bf17cf2236b7277be7b0" dependencies = [ "anyhow", - "clap 4.5.4", + "clap 4.5.7", "serde", "toml 0.8.14", "walrus", @@ -2135,9 +2147,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2145,24 +2157,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2170,22 +2182,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-compose" @@ -2196,7 +2208,7 @@ dependencies = [ "anyhow", "heck 0.4.1", "im-rc", - "indexmap 2.1.0", + "indexmap 2.2.6", "log", "petgraph", "serde", @@ -2217,7 +2229,7 @@ dependencies = [ "anyhow", "heck 0.4.1", "im-rc", - "indexmap 2.1.0", + "indexmap 2.2.6", "log", "petgraph", "serde", @@ -2278,13 +2290,22 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.209.1" +version = "0.211.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4a05336882dae732ce6bd48b7e11fe597293cb72c13da4f35d7d5f8d53b2a7" +checksum = "5e7d931a1120ef357f32b74547646b6fa68ea25e377772b72874b131a9ed70d4" dependencies = [ "leb128", ] +[[package]] +name = "wasm-encoder" +version = "0.211.1" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" +dependencies = [ + "leb128", + "wasmparser 0.211.1", +] + [[package]] name = "wasm-metadata" version = "0.10.20" @@ -2292,7 +2313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18ebaa7bd0f9e7a5e5dd29b9a998acf21c4abed74265524dd7e85934597bfb10" dependencies = [ "anyhow", - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", @@ -2303,18 +2324,17 @@ dependencies = [ [[package]] name = "wasm-metadata" -version = "0.203.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fbd9b7017bdb3ceb63503a18d1aa7b0d026e18ce659d40b93bd9a15391424f" +version = "0.211.1" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" dependencies = [ "anyhow", - "indexmap 2.1.0", + "indexmap 2.2.6", "serde", "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.203.0", - "wasmparser 0.203.0", + "wasm-encoder 0.211.1 (git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57)", + "wasmparser 0.211.1", ] [[package]] @@ -2335,11 +2355,11 @@ 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.1.0", + "indexmap 2.2.6", "semver", ] @@ -2349,8 +2369,8 @@ version = "0.121.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dbe55c8f9d0dbd25d9447a5a889ff90c0cc3feaa7395310d3d826b2c703eaab" dependencies = [ - "bitflags 2.4.1", - "indexmap 2.1.0", + "bitflags 2.5.0", + "indexmap 2.2.6", "semver", ] @@ -2360,19 +2380,31 @@ version = "0.203.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b473b35fff082e8c8377f4e2c8d48075e562aa051e48a02229bdcafbf349d37" dependencies = [ - "bitflags 2.4.1", - "indexmap 2.1.0", + "bitflags 2.5.0", + "indexmap 2.2.6", + "semver", +] + +[[package]] +name = "wasmparser" +version = "0.211.1" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" +dependencies = [ + "ahash", + "bitflags 2.5.0", + "hashbrown 0.14.5", + "indexmap 2.2.6", "semver", ] [[package]] name = "wasmprinter" -version = "0.2.75" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d027eb8294904fc715ac0870cebe6b0271e96b90605ee21511e7565c4ce568c" +checksum = "60e73986a6b7fdfedb7c5bf9e7eb71135486507c8fbc4c0c42cffcb6532988b7" dependencies = [ "anyhow", - "wasmparser 0.118.1", + "wasmparser 0.121.2", ] [[package]] @@ -2388,10 +2420,10 @@ dependencies = [ "cfg-if", "encoding_rs", "fxprof-processed-profile", - "indexmap 2.1.0", + "indexmap 2.2.6", "libc", "log", - "object", + "object 0.32.2", "once_cell", "paste", "rayon", @@ -2400,7 +2432,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", @@ -2452,10 +2484,10 @@ dependencies = [ "anyhow", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wasmtime-component-util", "wasmtime-wit-bindgen", - "wit-parser 0.13.0", + "wit-parser 0.13.2", ] [[package]] @@ -2480,10 +2512,10 @@ dependencies = [ "cranelift-wasm", "gimli 0.28.1", "log", - "object", + "object 0.32.2", "target-lexicon", "thiserror", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-cranelift-shared", "wasmtime-environ", "wasmtime-versioned-export-macros", @@ -2500,7 +2532,7 @@ dependencies = [ "cranelift-control", "cranelift-native", "gimli 0.28.1", - "object", + "object 0.32.2", "target-lexicon", "wasmtime-environ", ] @@ -2514,15 +2546,15 @@ dependencies = [ "anyhow", "cranelift-entity", "gimli 0.28.1", - "indexmap 2.1.0", + "indexmap 2.2.6", "log", - "object", + "object 0.32.2", "serde", "serde_derive", "target-lexicon", "thiserror", "wasm-encoder 0.38.1", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmprinter", "wasmtime-component-util", "wasmtime-types", @@ -2549,7 +2581,7 @@ version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f485336add49267d8859e8f8084d2d4b9a4b1564496b6f30ba5b168d50c10ceb" dependencies = [ - "addr2line", + "addr2line 0.21.0", "anyhow", "bincode", "cfg-if", @@ -2557,7 +2589,7 @@ dependencies = [ "gimli 0.28.1", "ittapi", "log", - "object", + "object 0.32.2", "rustc-demangle", "rustix", "serde", @@ -2576,7 +2608,7 @@ version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65e119affec40edb2fab9044f188759a00c2df9c3017278d047012a2de1efb4f" dependencies = [ - "object", + "object 0.32.2", "once_cell", "rustix", "wasmtime-versioned-export-macros", @@ -2603,7 +2635,7 @@ dependencies = [ "cc", "cfg-if", "encoding_rs", - "indexmap 2.1.0", + "indexmap 2.2.6", "libc", "log", "mach", @@ -2633,7 +2665,7 @@ dependencies = [ "serde", "serde_derive", "thiserror", - "wasmparser 0.118.1", + "wasmparser 0.118.2", ] [[package]] @@ -2644,7 +2676,7 @@ checksum = "f55c5565959287c21dd0f4277ae3518dd2ae62679f655ee2dbc4396e19d210db" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -2655,7 +2687,7 @@ checksum = "ccd8370078149d49a3a47e93741553fd79b700421464b6a27ca32718192ab130" dependencies = [ "anyhow", "async-trait", - "bitflags 2.4.1", + "bitflags 2.5.0", "bytes", "cap-fs-ext", "cap-net-ext", @@ -2691,9 +2723,9 @@ dependencies = [ "anyhow", "cranelift-codegen", "gimli 0.28.1", - "object", + "object 0.32.2", "target-lexicon", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-cranelift-shared", "wasmtime-environ", "winch-codegen", @@ -2707,8 +2739,8 @@ checksum = "f328b2d4a690270324756e886ed5be3a4da4c00be0eea48253f4595ad068062b" dependencies = [ "anyhow", "heck 0.4.1", - "indexmap 2.1.0", - "wit-parser 0.13.0", + "indexmap 2.2.6", + "wit-parser 0.13.2", ] [[package]] @@ -2728,24 +2760,24 @@ dependencies = [ [[package]] name = "wast" -version = "209.0.1" +version = "211.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fffef2ff6147e4d12e972765fd75332c6a11c722571d4ab7a780d81ffc8f0a4" +checksum = "b25506dd82d00da6b14a87436b3d52b1d264083fa79cdb72a0d1b04a8595ccaa" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.209.1", + "wasm-encoder 0.211.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "wat" -version = "1.209.1" +version = "1.211.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42203ec0271d113f8eb1f77ebc624886530cecb35915a7f63a497131f16e4d24" +checksum = "eb716ca6c86eecac2d82541ffc39860118fc0af9309c4f2670637bea2e1bdd7d" dependencies = [ - "wast 209.0.1", + "wast 211.0.1", ] [[package]] @@ -2756,7 +2788,7 @@ checksum = "0afb26cd3269289bb314a361ff0a6685e5ce793b62181a9fe3f81ace15051697" dependencies = [ "anyhow", "async-trait", - "bitflags 2.4.1", + "bitflags 2.5.0", "thiserror", "tracing", "wasmtime", @@ -2774,7 +2806,7 @@ dependencies = [ "proc-macro2", "quote", "shellexpand", - "syn 2.0.48", + "syn 2.0.66", "witx", ] @@ -2786,7 +2818,7 @@ checksum = "31ae1ec11a17ea481539ee9a5719a278c9790d974060fbf71db4b2c05378780b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", "wiggle-generate", ] @@ -2824,7 +2856,7 @@ dependencies = [ "regalloc2", "smallvec", "target-lexicon", - "wasmparser 0.118.1", + "wasmparser 0.118.2", "wasmtime-environ", ] @@ -2834,7 +2866,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.5", ] [[package]] @@ -2852,7 +2884,7 @@ 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.5", ] [[package]] @@ -2872,17 +2904,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" 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.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -2893,9 +2926,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -2905,9 +2938,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -2917,9 +2950,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -2929,9 +2968,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -2941,9 +2980,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -2953,9 +2992,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -2965,15 +3004,15 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.11" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c52728401e1dc672a56e81e593e912aa54c78f40246869f78359a2bf24d29d" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] @@ -2984,7 +3023,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", ] @@ -2995,8 +3034,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be60cd1b2ff7919305301d0c27528d4867bd793afe890ba3837743da9655d91b" dependencies = [ "anyhow", - "bitflags 2.4.1", - "indexmap 2.1.0", + "bitflags 2.5.0", + "indexmap 2.2.6", "log", "serde", "serde_derive", @@ -3009,32 +3048,31 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.203.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "379c4e193d37b3e2c808e99515c2a91dc19e7b3b160adfbb374463875375d6ff" +version = "0.211.1" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" dependencies = [ "anyhow", - "bitflags 2.4.1", - "indexmap 2.1.0", + "bitflags 2.5.0", + "indexmap 2.2.6", "log", "serde", "serde_derive", "serde_json", - "wasm-encoder 0.203.0", - "wasm-metadata 0.203.0", - "wasmparser 0.203.0", - "wit-parser 0.203.0", + "wasm-encoder 0.211.1 (git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57)", + "wasm-metadata 0.211.1", + "wasmparser 0.211.1", + "wit-parser 0.211.1", ] [[package]] name = "wit-parser" -version = "0.13.0" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15df6b7b28ce94b8be39d8df5cb21a08a4f3b9f33b631aedb4aa5776f785ead3" +checksum = "316b36a9f0005f5aa4b03c39bc3728d045df136f8c13a73b7db4510dec725e08" dependencies = [ "anyhow", "id-arena", - "indexmap 2.1.0", + "indexmap 2.2.6", "log", "semver", "serde", @@ -3051,7 +3089,7 @@ checksum = "1ee4ad7310367bf272507c0c8e0c74a80b4ed586b833f7c7ca0b7588f686f11a" dependencies = [ "anyhow", "id-arena", - "indexmap 2.1.0", + "indexmap 2.2.6", "log", "semver", "serde", @@ -3063,20 +3101,19 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.203.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f547f9154c0fbd020c81c348d703b549bafd16ea68b15927acb5c890467e734" +version = "0.211.1" +source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" dependencies = [ "anyhow", "id-arena", - "indexmap 2.1.0", + "indexmap 2.2.6", "log", "semver", "serde", "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.203.0", + "wasmparser 0.211.1", ] [[package]] @@ -3110,22 +3147,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.66", ] [[package]] @@ -3149,9 +3186,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.11+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" dependencies = [ "cc", "pkg-config", diff --git a/ext/ruby_wasm/Cargo.toml b/ext/ruby_wasm/Cargo.toml index afbcc1c224..51c7f5c43c 100644 --- a/ext/ruby_wasm/Cargo.toml +++ b/ext/ruby_wasm/Cargo.toml @@ -15,6 +15,7 @@ bytes = "1" wizer = "4.0.0" wasi-vfs-cli = { git = "https://github.com/kateinoigakukun/wasi-vfs/", tag = "0.5.2" } structopt = "0.3.26" -wit-component = "0.203.0" -wasm-compose = "0.203.0" -wasi-virt = { git = "https://github.com/bytecodealliance/wasi-virt", rev = "refs/pull/63/head", default-features = false } +# https://github.com/bytecodealliance/wasm-tools/pull/1625 +wit-component = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "771bc57" } +wasm-compose = "0.203" +wasi-virt = { git = "https://github.com/bytecodealliance/wasi-virt", rev = "02de7b495eba3f1bf786bf17cf2236b7277be7b0", default-features = false } From 2a5fd9fe39127110b3c35b210573b7bbd8bbe9c2 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 21 Jun 2024 05:09:59 +0000 Subject: [PATCH 14/16] Build exts under unbundled environment for dynamic linking too --- lib/ruby_wasm/packager/core.rb | 54 ++++++++++++++++------------------ sig/ruby_wasm/packager.rbs | 1 + 2 files changed, 26 insertions(+), 29 deletions(-) diff --git a/lib/ruby_wasm/packager/core.rb b/lib/ruby_wasm/packager/core.rb index 7f19cf0d50..6171f9b4f2 100644 --- a/lib/ruby_wasm/packager/core.rb +++ b/lib/ruby_wasm/packager/core.rb @@ -67,6 +67,14 @@ def wasi_exec_model use_js_gem ? "reactor" : "command" end + def with_unbundled_env(&block) + __skip__ = if defined?(Bundler) + Bundler.with_unbundled_env(&block) + else + block.call + end + end + def cache_key(digest) raise NotImplementedError end @@ -87,27 +95,22 @@ def build(executor, options) end build.crossruby.clean(executor) if options[:clean] - do_build = - proc do - build.crossruby.build( - executor, - remake: options[:remake], - reconfigure: options[:reconfigure] - ) - end + self.with_unbundled_env do + build.crossruby.build( + executor, + remake: options[:remake], + reconfigure: options[:reconfigure] + ) + end - __skip__ = - if defined?(Bundler) - Bundler.with_unbundled_env(&do_build) - else - do_build.call - end build.crossruby.artifact end def build_gem_exts(executor, gem_home) build = derive_build - self._build_gem_exts(executor, build, gem_home) + self.with_unbundled_env do + self._build_gem_exts(executor, build, gem_home) + end end def link_gem_exts(executor, ruby_root, gem_home, module_bytes) @@ -269,21 +272,14 @@ def build(executor, options) end build.crossruby.clean(executor) if options[:clean] - do_build = - proc do - build.crossruby.build( - executor, - remake: options[:remake], - reconfigure: options[:reconfigure] - ) - end + self.with_unbundled_env do + build.crossruby.build( + executor, + remake: options[:remake], + reconfigure: options[:reconfigure] + ) + end - __skip__ = - if defined?(Bundler) - Bundler.with_unbundled_env(&do_build) - else - do_build.call - end build.crossruby.artifact end diff --git a/sig/ruby_wasm/packager.rbs b/sig/ruby_wasm/packager.rbs index 04ba027d77..a91fd7823d 100644 --- a/sig/ruby_wasm/packager.rbs +++ b/sig/ruby_wasm/packager.rbs @@ -77,6 +77,7 @@ class RubyWasm::Packager def build_gem_exts: (RubyWasm::BuildExecutor, string gem_home) -> void def link_gem_exts: (RubyWasm::BuildExecutor, string ruby_root, string gem_home, bytes module_bytes) -> bytes def wasi_exec_model: () -> String + def with_unbundled_env: () { () -> void } -> void end class DynamicLinking < RubyWasm::Packager::Core::BuildStrategy From 833cb01a30e79647acb448951b4c8afd8c8e7b2e Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 28 Jun 2024 03:01:46 +0000 Subject: [PATCH 15/16] Update wasm-tools to 0.212.0 --- Cargo.lock | 91 +++++++++++++++------------------------- ext/ruby_wasm/Cargo.toml | 5 +-- 2 files changed, 35 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c28bbf89de..426824d1e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1552,8 +1552,8 @@ dependencies = [ "structopt", "wasi-vfs-cli", "wasi-virt", - "wasm-compose 0.203.0", - "wit-component 0.211.1", + "wasm-compose 0.212.0", + "wit-component 0.212.0", "wizer", ] @@ -2222,9 +2222,9 @@ dependencies = [ [[package]] name = "wasm-compose" -version = "0.203.0" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63d50fd3a3dd038d0910842ca01c2fe99edd15caff33caa990477cce4421c72e" +checksum = "e7b008c31616453a308d2cad804d096245b274823518d8611c3167f3734245ea" dependencies = [ "anyhow", "heck 0.4.1", @@ -2236,8 +2236,8 @@ dependencies = [ "serde_derive", "serde_yaml", "smallvec", - "wasm-encoder 0.203.0", - "wasmparser 0.203.0", + "wasm-encoder 0.212.0", + "wasmparser 0.212.0", "wat", ] @@ -2280,30 +2280,12 @@ dependencies = [ [[package]] name = "wasm-encoder" -version = "0.203.0" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87e3b46a0d9d9143d57aa926c42e2af284b5cb8f0c7b71079afc7a6fca42db50" +checksum = "501940df4418b8929eb6d52f1aade1fdd15a5b86c92453cb696e3c906bd3fc33" dependencies = [ "leb128", - "wasmparser 0.203.0", -] - -[[package]] -name = "wasm-encoder" -version = "0.211.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e7d931a1120ef357f32b74547646b6fa68ea25e377772b72874b131a9ed70d4" -dependencies = [ - "leb128", -] - -[[package]] -name = "wasm-encoder" -version = "0.211.1" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" -dependencies = [ - "leb128", - "wasmparser 0.211.1", + "wasmparser 0.212.0", ] [[package]] @@ -2324,8 +2306,9 @@ dependencies = [ [[package]] name = "wasm-metadata" -version = "0.211.1" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" +version = "0.212.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a1849fac257fd76c43268555e73d74848c8dff23975c238c2cbad61cffe5045" dependencies = [ "anyhow", "indexmap 2.2.6", @@ -2333,8 +2316,8 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.211.1 (git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57)", - "wasmparser 0.211.1", + "wasm-encoder 0.212.0", + "wasmparser 0.212.0", ] [[package]] @@ -2376,19 +2359,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.203.0" +version = "0.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b473b35fff082e8c8377f4e2c8d48075e562aa051e48a02229bdcafbf349d37" -dependencies = [ - "bitflags 2.5.0", - "indexmap 2.2.6", - "semver", -] - -[[package]] -name = "wasmparser" -version = "0.211.1" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" +checksum = "8d28bc49ba1e5c5b61ffa7a2eace10820443c4b7d1c0b144109261d14570fdf8" dependencies = [ "ahash", "bitflags 2.5.0", @@ -2760,24 +2733,24 @@ dependencies = [ [[package]] name = "wast" -version = "211.0.1" +version = "212.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b25506dd82d00da6b14a87436b3d52b1d264083fa79cdb72a0d1b04a8595ccaa" +checksum = "4606a05fb0aae5d11dd7d8280a640d88a63ee019360ba9be552da3d294b8d1f5" dependencies = [ "bumpalo", "leb128", "memchr", "unicode-width", - "wasm-encoder 0.211.1 (registry+https://github.com/rust-lang/crates.io-index)", + "wasm-encoder 0.212.0", ] [[package]] name = "wat" -version = "1.211.1" +version = "1.212.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb716ca6c86eecac2d82541ffc39860118fc0af9309c4f2670637bea2e1bdd7d" +checksum = "c74ca7f93f11a5d6eed8499f2a8daaad6e225cab0151bc25a091fff3b987532f" dependencies = [ - "wast 211.0.1", + "wast 212.0.0", ] [[package]] @@ -3048,8 +3021,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.211.1" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" +version = "0.212.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ed5b0f9fc3d6424787d2a49e1142bf954ae4f26ee891992c144f0cfd68c4b7f" dependencies = [ "anyhow", "bitflags 2.5.0", @@ -3058,10 +3032,10 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.211.1 (git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57)", - "wasm-metadata 0.211.1", - "wasmparser 0.211.1", - "wit-parser 0.211.1", + "wasm-encoder 0.212.0", + "wasm-metadata 0.212.0", + "wasmparser 0.212.0", + "wit-parser 0.212.0", ] [[package]] @@ -3101,8 +3075,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.211.1" -source = "git+https://github.com/bytecodealliance/wasm-tools?rev=771bc57#771bc579b50f5686d675f604e7b26f21b3228275" +version = "0.212.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceeb0424aa8679f3fcf2d6e3cfa381f3d6fa6179976a2c05a6249dd2bb426716" dependencies = [ "anyhow", "id-arena", @@ -3113,7 +3088,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.211.1", + "wasmparser 0.212.0", ] [[package]] diff --git a/ext/ruby_wasm/Cargo.toml b/ext/ruby_wasm/Cargo.toml index 51c7f5c43c..c9d0aa46e1 100644 --- a/ext/ruby_wasm/Cargo.toml +++ b/ext/ruby_wasm/Cargo.toml @@ -15,7 +15,6 @@ bytes = "1" wizer = "4.0.0" wasi-vfs-cli = { git = "https://github.com/kateinoigakukun/wasi-vfs/", tag = "0.5.2" } structopt = "0.3.26" -# https://github.com/bytecodealliance/wasm-tools/pull/1625 -wit-component = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "771bc57" } -wasm-compose = "0.203" +wit-component = "0.212.0" +wasm-compose = "0.212.0" wasi-virt = { git = "https://github.com/bytecodealliance/wasi-virt", rev = "02de7b495eba3f1bf786bf17cf2236b7277be7b0", default-features = false } From 7fb033d759685d5c6feab998467852ec2e0db481 Mon Sep 17 00:00:00 2001 From: Yuta Saito Date: Fri, 28 Jun 2024 04:12:48 +0000 Subject: [PATCH 16/16] Fix `@bytecodealliance/preview2-shim` compatibility By disabling sockets and adding http handlers, we can run the tests --- ext/ruby_wasm/src/lib.rs | 3 +++ packages/npm-packages/ruby-wasm-wasi/test/init.js | 5 ++++- packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs | 5 ++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ext/ruby_wasm/src/lib.rs b/ext/ruby_wasm/src/lib.rs index ca3fcff2a2..c282ed321d 100644 --- a/ext/ruby_wasm/src/lib.rs +++ b/ext/ruby_wasm/src/lib.rs @@ -249,6 +249,9 @@ impl WasiVirt { fn allow_all(&self) -> Result<(), Error> { self.virt(|virt| { virt.allow_all(); + // Disable sockets for now since `sockets/ip-name-lookup` is not + // supported by @bytecodealliance/preview2-shim yet + virt.sockets(false); Ok(()) }) } diff --git a/packages/npm-packages/ruby-wasm-wasi/test/init.js b/packages/npm-packages/ruby-wasm-wasi/test/init.js index e14f1391e4..ef6e2a206a 100644 --- a/packages/npm-packages/ruby-wasm-wasi/test/init.js +++ b/packages/npm-packages/ruby-wasm-wasi/test/init.js @@ -73,7 +73,7 @@ async function initComponentRubyVM({ suppressStderr } = { suppressStderr: false return module; } const vm = await RubyVM._instantiate(async (jsRuntime) => { - const { cli, clocks, filesystem, io, random, sockets } = preview2Shim; + const { cli, clocks, filesystem, io, random, sockets, http } = preview2Shim; if (process.env.RUBY_BUILD_ROOT) { filesystem._setPreopens({ "/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"), @@ -103,6 +103,9 @@ async function initComponentRubyVM({ suppressStderr } = { suppressStderr: false "wasi:io/streams": io.streams, "wasi:random/random": random.random, "wasi:sockets/tcp": sockets.tcp, + "wasi:http/types": http.types, + "wasi:http/incoming-handler": http.incomingHandler, + "wasi:http/outgoing-handler": http.outgoingHandler, }) return root.rubyRuntime; }, {}) diff --git a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs index ca64f28913..f188fb5a8d 100755 --- a/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs +++ b/packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs @@ -35,7 +35,7 @@ const instantiateComponent = async (rootTestFile) => { return WebAssembly.compile(buffer); } const vm = await RubyVM._instantiate(async (jsRuntime) => { - const { cli, clocks, filesystem, io, random, sockets } = preview2Shim; + const { cli, clocks, filesystem, io, random, sockets, http } = preview2Shim; const dirname = path.dirname(new URL(import.meta.url).pathname); const preopens = { "/__root__": path.join(dirname, "..") }; if (process.env.RUBY_ROOT) { @@ -66,6 +66,9 @@ const instantiateComponent = async (rootTestFile) => { "wasi:io/streams": io.streams, "wasi:random/random": random.random, "wasi:sockets/tcp": sockets.tcp, + "wasi:http/types": http.types, + "wasi:http/incoming-handler": http.incomingHandler, + "wasi:http/outgoing-handler": http.outgoingHandler, }) return root.rubyRuntime; }, {