Skip to content

Commit a8913a8

Browse files
committed
Document the JRuby container, and correct what pins the jar versions
`Dockerfile.jruby` was not mentioned in the wasm README. Chicory and ASM are pinned once, in `rbs.gemspec`, not in the Dockerfile as docs/release.md claimed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PhJnDiMKwunqnLpuXzRY7v
1 parent 1da55ae commit a8913a8

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

docs/release.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,8 +232,11 @@ that is why the 4.0.3 changelog credits its three entries to the same pull reque
232232
- Prereleases (`X.Y.Z.pre.N`) are only installed with `gem install rbs --pre`;
233233
a plain `gem install rbs` is unaffected. On JRuby, `gem install rbs [--pre]`
234234
resolves to the `-java` gem automatically.
235-
- `Dockerfile.jruby` pins the WASI SDK / Chicory / ASM versions to match the
236-
`wasm`, `jruby`, and `release-gems` workflows. Keep them in sync when bumping.
235+
- The WASI SDK version is pinned in `wasm.yml`, `jruby.yml`, `release-gems.yml`, and
236+
`Dockerfile.jruby`, each carrying its own copy. Keep them in sync when bumping. The
237+
Chicory/ASM versions are not duplicated: they are the `jar` requirements in
238+
`rbs.gemspec`, which is where the workflow, `Dockerfile.jruby` and `gem install` all
239+
read them from.
237240
- `rake 'gem:check_release[X.Y.Z]'` and `rake gem:tag` are what the workflow runs to
238241
check the release and to create the tag. Both work locally, which is the fallback
239242
if the tag ever has to be created by hand.

wasm/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,39 @@ $ rake wasm:install_jars # download the Chicory/ASM jars into ~/.m2 (run on JRub
2727

2828
The compiled `rbs_parser.wasm` is a build artifact and is not checked in.
2929

30+
The WASI SDK is needed for the *build*, not for running the result — the host clang already
31+
knows the `wasm32` target, but there is no wasm32 libc on a normal machine, so it picks up the
32+
host headers and fails on the first `#include`. That is what the SDK supplies, along with the
33+
builtins the link step needs.
34+
35+
## Running the suite on JRuby
36+
37+
[`Dockerfile.jruby`](../Dockerfile.jruby) builds an image that has everything this needs, so no
38+
JRuby, JDK or WASI SDK has to be installed to work on the JRuby side:
39+
40+
```console
41+
$ docker build -f Dockerfile.jruby -t rbs-jruby .
42+
$ docker run --rm rbs-jruby # run the test suite
43+
$ docker run --rm -e RBS_PLATFORM=java rbs-jruby \
44+
gem build rbs.gemspec # build the -java gem
45+
```
46+
47+
Two things in it are not obvious:
48+
49+
- `build-essential` is for prism, which builds `libprism.so` and loads it through FFI on JRuby
50+
rather than as an MRI C extension. It needs `cc` and `make`.
51+
- Bundler is skipped. The development `Gemfile` pulls in CRuby-only C extensions (bigdecimal,
52+
stackprof, …) that cannot build on JRuby, so the few gems the suite needs are installed
53+
directly, in the same set as [`jruby.yml`](../.github/workflows/jruby.yml).
54+
55+
The image compiles `rbs_parser.wasm` itself, which is why it carries the WASI SDK. That is not
56+
the only arrangement: the build needs the SDK but not JRuby, and running the suite needs JRuby
57+
but not the SDK, so `jruby.yml` splits them instead — it compiles the module on CRuby and then
58+
switches engines to test against the result.
59+
60+
`rake wasm:install_jars` is the step that has to be on JRuby either way: it resolves the `jar`
61+
requirements from `rbs.gemspec` through the JVM.
62+
3063
## Exported functions
3164

3265
The module is built as a "reactor": it has no `main`, and the host calls

0 commit comments

Comments
 (0)