Skip to content

Commit 60f4c9c

Browse files
Omit ruby.debug.wasm in npm package to reduce size
Since jsdelivr.com rejects packages larger than 100MB for distribution, so we need to care about the total package size even though individual file size is under the limit. Therefore, omit ruby.debug.wasm since ruby.debug+stdlib.wasm can play a super-set role of it.
1 parent a726700 commit 60f4c9c

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

packages/npm-packages/ruby-head-wasm-wasi/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const main = async () => {
2828
const binary = await fs.readFile(
2929
// Tips: Replace the binary with debug info if you want symbolicated stack trace.
3030
// (only nightly release for now)
31-
// "./node_modules/ruby-head-wasm-wasi/dist/ruby.debug.wasm"
31+
// "./node_modules/ruby-head-wasm-wasi/dist/ruby.debug+stdlib.wasm"
3232
"./node_modules/ruby-head-wasm-wasi/dist/ruby.wasm"
3333
);
3434
const module = await WebAssembly.compile(binary);
@@ -64,7 +64,7 @@ See [the example project](https://github.com/ruby/ruby.wasm/tree/main/packages/n
6464
const response = await fetch(
6565
// Tips: Replace the binary with debug info if you want symbolicated stack trace.
6666
// (only nightly release for now)
67-
// "https://cdn.jsdelivr.net/npm/ruby-head-wasm-wasi@latest/dist/ruby.debug.wasm"
67+
// "https://cdn.jsdelivr.net/npm/ruby-head-wasm-wasi@next/dist/ruby.debug+stdlib.wasm"
6868
"https://cdn.jsdelivr.net/npm/ruby-head-wasm-wasi@latest/dist/ruby.wasm"
6969
);
7070
const buffer = await response.arrayBuffer();

packages/npm-packages/ruby-wasm-wasi/build-package.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ wit-bindgen js \
2929
)
3030

3131
wasm-opt --strip-debug "$ruby_root/usr/local/bin/ruby" -o "$dist_dir/ruby.wasm"
32-
cp "$ruby_root/usr/local/bin/ruby" "$dist_dir/ruby.debug.wasm"
3332

3433
# Build +stdlib versions (removing files that are not used in normal use cases)
3534
workdir="$(mktemp -d)"
@@ -38,7 +37,7 @@ rm -rf $workdir/ruby-root/usr/local/include
3837
rm -f $workdir/ruby-root/usr/local/lib/libruby-static.a
3938
rm -f $workdir/ruby-root/usr/local/bin/ruby
4039
wasi-vfs pack "$dist_dir/ruby.wasm" --mapdir /usr::$workdir/ruby-root/usr -o "$dist_dir/ruby+stdlib.wasm"
41-
wasi-vfs pack "$dist_dir/ruby.debug.wasm" --mapdir /usr::$workdir/ruby-root/usr -o "$dist_dir/ruby.debug+stdlib.wasm"
40+
wasi-vfs pack "$ruby_root/usr/local/bin/ruby" --mapdir /usr::$workdir/ruby-root/usr -o "$dist_dir/ruby.debug+stdlib.wasm"
4241

4342

4443
mkdir "$dist_dir/bindgen"

0 commit comments

Comments
 (0)