mirror of
https://github.com/ruby/setup-ruby.git
synced 2026-09-14 15:04:20 +02:00
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.
This commit is contained in:
committed by
Benoit Daloze
parent
e17c5ea7eb
commit
6c79f721fa
@@ -405,11 +405,11 @@ export function setupPath(newPathEntries) {
|
||||
return msys2Type
|
||||
}
|
||||
|
||||
export async function setupJavaHome() {
|
||||
export async function setupJavaHome(rubyPrefix) {
|
||||
await measure("Modifying JAVA_HOME for JRuby", async () => {
|
||||
console.log("attempting to run with existing JAVA_HOME")
|
||||
|
||||
let ret = await exec.exec('ruby', ['--version'], {ignoreReturnCode: true})
|
||||
let ret = await exec.exec('java', ['-jar', path.join(rubyPrefix, 'lib/jruby.jar'), '--version'], {ignoreReturnCode: true})
|
||||
|
||||
if (ret === 0) {
|
||||
console.log("JRuby successfully starts, using existing JAVA_HOME")
|
||||
|
||||
+3
-3
@@ -725,11 +725,11 @@ function setupPath(newPathEntries) {
|
||||
return msys2Type
|
||||
}
|
||||
|
||||
async function setupJavaHome() {
|
||||
async function setupJavaHome(rubyPrefix) {
|
||||
await measure("Modifying JAVA_HOME for JRuby", async () => {
|
||||
console.log("attempting to run with existing JAVA_HOME")
|
||||
|
||||
let ret = await exec.exec('ruby', ['--version'], {ignoreReturnCode: true})
|
||||
let ret = await exec.exec('java', ['-jar', path.join(rubyPrefix, 'lib/jruby.jar'), '--version'], {ignoreReturnCode: true})
|
||||
|
||||
if (ret === 0) {
|
||||
console.log("JRuby successfully starts, using existing JAVA_HOME")
|
||||
@@ -74091,7 +74091,7 @@ async function install(platform, engine, version) {
|
||||
|
||||
// Ensure JRuby has minimum Java version to run
|
||||
if (engine === "jruby") {
|
||||
await common.setupJavaHome()
|
||||
await common.setupJavaHome(rubyPrefix)
|
||||
}
|
||||
|
||||
return rubyPrefix
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@ export async function install(platform, engine, version) {
|
||||
|
||||
// Ensure JRuby has minimum Java version to run
|
||||
if (engine === "jruby") {
|
||||
await common.setupJavaHome()
|
||||
await common.setupJavaHome(rubyPrefix)
|
||||
}
|
||||
|
||||
return rubyPrefix
|
||||
|
||||
Reference in New Issue
Block a user