Skip to content

Commit 7be4bd9

Browse files
committed
JT: jvmci_update_and_version => jvmci_version
1 parent 69dc4f1 commit 7be4bd9

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

tool/jt.rb

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,14 @@ def get_truffle_version(from: :suite)
143143
end
144144
end
145145

146-
def jvmci_update_and_version
147-
if env = ENV['JVMCI_VERSION']
148-
unless /8u(\d+(?:\+\d+)?)-(jvmci-\d+\.\d+-b\d+)/ =~ env
149-
raise 'Could not parse JDK update and JVMCI version from $JVMCI_VERSION'
150-
end
151-
else
146+
def jvmci_version
147+
@jvmci_version ||= begin
152148
ci = File.read("#{TRUFFLERUBY_DIR}/common.json")
153-
unless /{\s*"name"\s*:\s*"openjdk"\s*,\s*"version"\s*:\s*"8u(\d+(?:\+\d+)?)-(jvmci-[^"]+)"\s*,/ =~ ci
149+
unless /{\s*"name"\s*:\s*"openjdk"\s*,\s*"version"\s*:\s*"8u(?:\d+(?:\+\d+)?)-(jvmci-[^"]+)"\s*,/ =~ ci
154150
raise 'JVMCI version not found in common.json'
155151
end
152+
$1
156153
end
157-
update, jvmci = $1, $2
158-
[update, jvmci]
159154
end
160155

161156
def send_signal(signal, pid)
@@ -518,7 +513,6 @@ def find_java_home
518513
end
519514
java_home ||= ENV['JAVA_HOME']
520515

521-
_, jvmci_version = jvmci_update_and_version
522516
if java_home
523517
if java_home.include?(jvmci_version)
524518
:use_env_java_home
@@ -1939,7 +1933,6 @@ def install(name, *options)
19391933
private def install_jvmci(download_message, ee)
19401934
jdk_name = ee ? 'oraclejdk8' : 'openjdk8'
19411935

1942-
_, jvmci_version = jvmci_update_and_version
19431936
java_home = "#{CACHE_EXTRA_DIR}/#{jdk_name}-#{jvmci_version}"
19441937
unless File.directory?(java_home)
19451938
STDERR.puts "#{download_message} (#{jdk_name})"

0 commit comments

Comments
 (0)