From 35d47d9803d73ae70d47428c124a1cc47e10c1f5 Mon Sep 17 00:00:00 2001 From: Yasuo Honda Date: Wed, 9 Sep 2026 17:04:09 +0900 Subject: [PATCH] Do not install rdoc on JRuby The JRuby CI rows fail during bundle install since 2026-09-01 (run 33509684792): rdoc 8 depends on rbs (>= 4.0.0), whose java-platform gem declares a jar dependency (org.snakeyaml:snakeyaml-engine), as does the psych 5.5.0 java gem pulled in by activesupport. Installing each triggers jar-dependencies' post-install hook, which lazily installs `ruby-maven (~> 3.9)` through a nested Gem::DependencyInstaller inside one of Bundler's parallel install workers. With two such gems installing at once, the nested install's RubyGems rdoc documentation hook runs a Dir.chdir block that collides with the other worker's chdir; MRI only warns about this, but JRuby raises (jruby/jruby#5649): RuntimeError: there was an error installing 'ruby-maven (~> 3.9)' . please install it manually: # rdoc is only used for the local documentation task, so move it to `platforms :ruby` as rsim/oracle-enhanced#2826 did: JRuby then resolves neither rdoc nor rbs, leaving psych as the only jar-vendoring gem, and the rbs pin added to avoid its C-extension build becomes unnecessary. Guard the Rakefile's rdoc task for rubies without the rdoc gem. Co-Authored-By: Claude Fable 5.1 --- Gemfile | 5 ++--- Rakefile | 19 ++++++++++++------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index c437f69..29af0ac 100644 --- a/Gemfile +++ b/Gemfile @@ -2,10 +2,9 @@ source "https://rubygems.org" group :development do gem "rspec_junit_formatter" - gem "rdoc" - platforms :jruby do - gem "rbs", ">= 4.1.0.pre.2" # Use the java-platform gem so JRuby does not build the C extension + platforms :ruby do + gem "rdoc" end end diff --git a/Rakefile b/Rakefile index eb9984a..21f2ba3 100644 --- a/Rakefile +++ b/Rakefile @@ -21,12 +21,17 @@ end task default: :spec -require "rdoc/task" -Rake::RDocTask.new do |rdoc| - version = File.exist?("VERSION") ? File.read("VERSION") : "" +begin + require "rdoc/task" +rescue LoadError + # The Gemfile bundles rdoc only on platforms :ruby; skip the RDoc task without it +else + Rake::RDocTask.new do |rdoc| + version = File.exist?("VERSION") ? File.read("VERSION") : "" - rdoc.rdoc_dir = "doc" - rdoc.title = "ruby-plsql #{version}" - rdoc.rdoc_files.include("README*") - rdoc.rdoc_files.include("lib/**/*.rb") + rdoc.rdoc_dir = "doc" + rdoc.title = "ruby-plsql #{version}" + rdoc.rdoc_files.include("README*") + rdoc.rdoc_files.include("lib/**/*.rb") + end end