Skip to content

Commit 6c79f72

Browse files
headiuseregon
authored andcommitted
Test successful JRuby start without using launcher
Native launcher appears to hang on GHA when the JDK version is too old for JRuby 10. This bypasses it and should be a bit lighter. It will also avoid any variability in the launcher used, since Unixes and Windows already use different executables.
1 parent e17c5ea commit 6c79f72

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

common.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,11 @@ export function setupPath(newPathEntries) {
405405
return msys2Type
406406
}
407407

408-
export async function setupJavaHome() {
408+
export async function setupJavaHome(rubyPrefix) {
409409
await measure("Modifying JAVA_HOME for JRuby", async () => {
410410
console.log("attempting to run with existing JAVA_HOME")
411411

412-
let ret = await exec.exec('ruby', ['--version'], {ignoreReturnCode: true})
412+
let ret = await exec.exec('java', ['-jar', path.join(rubyPrefix, 'lib/jruby.jar'), '--version'], {ignoreReturnCode: true})
413413

414414
if (ret === 0) {
415415
console.log("JRuby successfully starts, using existing JAVA_HOME")

dist/index.js

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ruby-builder.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export async function install(platform, engine, version) {
5656

5757
// Ensure JRuby has minimum Java version to run
5858
if (engine === "jruby") {
59-
await common.setupJavaHome()
59+
await common.setupJavaHome(rubyPrefix)
6060
}
6161

6262
return rubyPrefix

0 commit comments

Comments
 (0)