Skip to content

Commit 75b9ce9

Browse files
Revert "Use wasi-virt for componentized binaries"
This reverts commit c8015aa.
1 parent dbf868d commit 75b9ce9

File tree

2 files changed

+1
-23
lines changed

2 files changed

+1
-23
lines changed

lib/ruby_wasm/packager.rb

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def package(executor, dest_dir, options)
4444
fs.remove_stdlib(executor)
4545
end
4646

47-
if full_build_options[:target] == "wasm32-unknown-wasip1" && !features.support_component_model?
47+
if full_build_options[:target] == "wasm32-unknown-wasip1" && !features.support_dynamic_linking?
4848
# wasi-vfs supports only WASI target
4949
wasi_vfs = RubyWasmExt::WasiVfs.new
5050
wasi_vfs.map_dir("/bundle", fs.bundle_dir)
@@ -54,27 +54,6 @@ def package(executor, dest_dir, options)
5454
end
5555
wasm_bytes = ruby_core.link_gem_exts(executor, fs.ruby_root, fs.bundle_dir, wasm_bytes)
5656

57-
if features.support_component_model?
58-
tmp_file = "tmp/ruby.component.wasm"
59-
tmp_virt_file = "tmp/ruby.component.virt.wasm"
60-
File.write(tmp_file, wasm_bytes)
61-
args = [
62-
"wasi-virt", "--stderr=allow",
63-
"--allow-random", "--allow-clocks", "--allow-exit",
64-
"--stdout=allow", "--stdin=allow",
65-
"--allow-all",
66-
"--debug"
67-
]
68-
[["/bundle", fs.bundle_dir], ["/usr", File.dirname(fs.ruby_root)]].each do |guest, host|
69-
args += ["--mount", "#{guest}=#{host}"]
70-
end
71-
args += ["--out", tmp_virt_file]
72-
args += [tmp_file]
73-
74-
executor.system(*args)
75-
wasm_bytes = File.binread(tmp_virt_file)
76-
end
77-
7857
wasm_bytes = RubyWasmExt.preinitialize(wasm_bytes) if options[:optimize]
7958
wasm_bytes
8059
end

lib/ruby_wasm/packager/core.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,6 @@ def derive_build
306306
return @build if @build
307307
__skip__ = build ||= RubyWasm::Build.new(
308308
name, **@packager.full_build_options, target: target,
309-
wasi_vfs: nil
310309
)
311310
build.crossruby.user_exts = user_exts(build)
312311
# Emscripten uses --global-base=1024 by default, but it conflicts with

0 commit comments

Comments
 (0)