jruby-gradle/jruby-gradle-plugin

JRubyPrepare task fails on Windows Github Actions

Opened this issue · 0 comments

Since a few weeks our CI builds on Github Actions on Windows are failing with an error like this:

> Task :asciidoctorj:jrubyPrepare
Caching disabled for task ':asciidoctorj:jrubyPrepare' because:
  Build cache is disabled
Task ':asciidoctorj:jrubyPrepare' is not up-to-date because:
  No history is available.
...
Downloading https://rubygems.org/downloads/open-uri-cached-0.0.5.gem to C:\Users\runneradmin\.gradle\.tmp\gradle_download4050746919808588031bin
Installing asciidoctor-2.0.17.gem,asciimath-2.0.3.gem,coderay-1.1.3.gem,rouge-3.28.0.gem,erubis-2.7.0.gem,haml-5.2.2.gem,open-uri-cached-0.0.5.gem,slim-4.1.0.gem,thread_safe-0.3.6-java.gem,tilt-2.0.10.gem,concurrent-ruby-1.1.7.gem,temple-0.8.2.gem
Starting process 'command 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.15-10\x64\bin\java.exe''. Working directory: D:\a\asciidoctorj\asciidoctorj\asciidoctorj-core Command: C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.15-10\x64\bin\java.exe -Dfile.encoding=utf-8 -Duser.country=US -Duser.language=en -Duser.variant -cp C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\org.jruby\jruby-complete\9.2.9.0\8e44ce7a1417966d89957bd766a148601e28828b\jruby-complete-9.2.9.0.jar org.jruby.Main -S gem install C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\temple\0.8.2\214c52a2c137908943acf31074e0c45329260206\temple-0.8.2.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\concurrent-ruby\1.1.7\24609ce8309e108cc75ab2501ec93127eb7aa6f3\concurrent-ruby-1.1.7.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\tilt\2.0.10\d265c822a6b228392d899e9eb5114613d65e6967\tilt-2.0.10.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\thread_safe\0.3.6\f5920c0aeb159a016690d12d722c45c5a950d5ee\thread_safe-0.3.6-java.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\slim\4.1.0\b55ab8701d1b72b9b06c2401e763ce9df6345d3\slim-4.1.0.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\open-uri-cached\0.0.5\1f14b1a269f3d0262d3d0c660dd91c0faaccf2a4\open-uri-cached-0.0.5.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\haml\5.2.2\434fff4bae1fc2bb70ae92c0889a2f701a059601\haml-5.2.2.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\erubis\2.7.0\fb37414e8454f45a[567](https://github.com/asciidoctor/asciidoctorj/runs/6437754134?check_suite_focus=true#step:4:567)4caa2a61707df46b370e9\erubis-2.7.0.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\rouge\3.28.0\595e9d181d33f6f55ec0e109ea408c7af994ce01\rouge-3.28.0.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\coderay\1.1.3\daa6ef4f015b2e98f5d09f40988b4e842fe15e5c\coderay-1.1.3.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\asciimath\2.0.3\c2470153a39de0a3d7cec041701a6fd619d7b2d9\asciimath-2.0.3.gem C:\Users\runneradmin\.gradle\caches\modules-2\files-2.1\rubygems\asciidoctor\2.0.17\541e323fe0d447723286ac3641c7d124fcfcb[592](https://github.com/asciidoctor/asciidoctorj/runs/6437754134?check_suite_focus=true#step:4:592)\asciidoctor-2.0.17.gem --ignore-dependencies --install-dir=D:\a\asciidoctorj\asciidoctorj\asciidoctorj-core\build\.gems --no-user-install --wrappers --no-document --local
Successfully started process 'command 'C:\hostedtoolcache\windows\Java_Temurin-Hotspot_jdk\11.0.15-10\x64\bin\java.exe''
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.headius.backport9.modules.Modules (file:/C:/Users/runneradmin/.gradle/caches/modules-2/files-2.1/org.jruby/jruby-complete/9.2.9.0/8e44ce7a1417966d89957bd766a148601e28828b/jruby-complete-9.2.9.0.jar) to method sun.nio.ch.NativeThread.signal(long)
WARNING: Please consider reporting this to the maintainers of com.headius.backport9.modules.Modules
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
ERROR:  While executing gem ... (Errno::EACCES)
    Permission denied - NUL


> Task :asciidoctorj:jrubyPrepare FAILED
FAILURE: Build failed with an exception.
:asciidoctorj:jrubyPrepare (Thread[included builds,5,main]) completed. Took 11.755 secs.

According to https://stackoverflow.com/questions/71966064/java-fileoutputstreamnul-not-working-after-java-upgrade this is due to a recent change in the JDK that can be circumvented by setting the system property jdk.io.File.enableADS=true.

Now the JRubyGradle plugin does not allow setting system properties for the Java process it spawns to make JRuby install the gems.
It would be great if the JRubyPrepare task had some option to allow passing system properties (and environment variables).