Skip to content

Commit b836b33

Browse files
Revert "Remove RUBY_BUILD_ROOT"
This reverts commit 919e8c7.
1 parent 5d6b2b3 commit b836b33

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

packages/npm-packages/ruby-wasm-wasi/test/init.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,10 @@ async function initComponentRubyVM({ suppressStderr } = { suppressStderr: false
7474
}
7575
const vm = await RubyVM._instantiate(async (jsRuntime) => {
7676
const { cli, clocks, filesystem, io, random, sockets } = preview2Shim;
77-
filesystem._setPreopens({})
77+
filesystem._setPreopens({
78+
"/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"),
79+
"/bundle": path.join(process.env.RUBY_BUILD_ROOT, "bundle"),
80+
})
7881
cli._setArgs(["ruby.wasm"].concat(process.argv.slice(2)));
7982
cli._setCwd("/")
8083
const root = await instantiate(getCoreModule, {

packages/npm-packages/ruby-wasm-wasi/tools/run-test-unit.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ const instantiateComponent = async (rootTestFile) => {
3939
const dirname = path.dirname(new URL(import.meta.url).pathname);
4040
filesystem._setPreopens({
4141
"/__root__": path.join(dirname, ".."),
42+
"/usr": path.join(process.env.RUBY_BUILD_ROOT, "usr"),
43+
"/bundle": path.join(process.env.RUBY_BUILD_ROOT, "bundle"),
4244
})
4345
cli._setArgs(["ruby.wasm"].concat(process.argv.slice(2)));
4446
cli._setCwd("/")

0 commit comments

Comments
 (0)