Skip to content

Fix wasm:install_jars on JRuby 10.1.2.0 - #3184

Merged
ksss merged 1 commit into
ruby:masterfrom
ksss:fix-jruby-install-jars
Sep 29, 2026
Merged

ksss merged 1 commit into
ruby:masterfrom
ksss:fix-jruby-install-jars

Conversation

@ksss

@ksss ksss commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

The jruby workflow has been failing on master since ruby/setup-ruby was bumped to v1.327.0 (#3182), which moved the job from JRuby 10.1.1.0 to 10.1.2.0:

rake aborted!
Errno::ENOENT: No such file or directory - /home/runner/work/rbs/gems/rbs-4.3.0.dev-java/deps.lst
/home/runner/work/rbs/rbs/Rakefile:1001:in 'block in <main>'

Cause

JRuby 10.1.2.0 bundles jar-dependencies 0.6.1 (10.1.1.0 had 0.5.7). Jars::Installer writes a temporary deps.lst into MavenExec#basedir, which is spec.gem_dir when given a Gem::Specification. For Gem::Specification.load("rbs.gemspec") in a checkout, that is a nonexistent <checkout>/../gems/rbs-*-java directory.

  • 0.5.7 passed the path to Maven as outputFile, and Maven silently created the directory (leaving a stray ../gems/rbs-*-java/lib/rbs_jars.rb behind).
  • 0.6.1 resolves with Mima and writes the file with a plain File.open, so it fails with ENOENT.

I reproduced this locally with both JRuby distributions: 10.1.2.0 fails with the same error, and it even passes if a 10.1.1.0 run has already created the stray directory.

Fix

Pass the gemspec path to Jars::Installer, so the basedir is the checkout. Instead of patching spec.platform afterwards, RBS_PLATFORM=java is set while the gemspec is evaluated, so the gemspec stamps the java platform itself (Jars::Installer skips non-java gems). The env var is restored afterwards.

With this change, jruby -S rake wasm:install_jars succeeds locally on both JRuby 10.1.1.0 and 10.1.2.0 (Temurin 21), and nothing is written outside the checkout.

🤖 Generated with Claude Code

jar-dependencies 0.6 (bundled with JRuby 10.1.2.0) writes its temporary
deps.lst with File.open into the installer's basedir. For a loaded
Gem::Specification the basedir is spec.gem_dir, which for a checkout is a
nonexistent ../gems/rbs-*-java directory, so the task fails with ENOENT.
jar-dependencies 0.5.x only worked because Maven created that directory.

Pass the gemspec path instead so the basedir is the checkout, and let the
gemspec stamp the java platform via RBS_PLATFORM=java.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ksss
ksss added this pull request to the merge queue Sep 29, 2026
Merged via the queue into ruby:master with commit baee700 Sep 29, 2026
25 checks passed
@ksss
ksss deleted the fix-jruby-install-jars branch September 29, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant