Fix wasm:install_jars on JRuby 10.1.2.0 - #3184
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
jrubyworkflow 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:Cause
JRuby 10.1.2.0 bundles jar-dependencies 0.6.1 (10.1.1.0 had 0.5.7).
Jars::Installerwrites a temporarydeps.lstintoMavenExec#basedir, which isspec.gem_dirwhen given aGem::Specification. ForGem::Specification.load("rbs.gemspec")in a checkout, that is a nonexistent<checkout>/../gems/rbs-*-javadirectory.outputFile, and Maven silently created the directory (leaving a stray../gems/rbs-*-java/lib/rbs_jars.rbbehind).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 patchingspec.platformafterwards,RBS_PLATFORM=javais set while the gemspec is evaluated, so the gemspec stamps the java platform itself (Jars::Installerskips non-java gems). The env var is restored afterwards.With this change,
jruby -S rake wasm:install_jarssucceeds 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