Skip to content

Commit 7c4043f

Browse files
committed
Download JVMCI and Eclipse to a single location within ~/.mx/cache
1 parent 35b6cd9 commit 7c4043f

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tool/jt.rb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
GRAAL_DIR = File.expand_path('../graal', TRUFFLERUBY_DIR)
3030
PROFILES_DIR = "#{TRUFFLERUBY_DIR}/profiles"
3131

32+
CACHE_EXTRA_DIR = File.expand_path('~/.mx/cache/extra')
33+
FileUtils.mkdir_p(CACHE_EXTRA_DIR) unless Dir.exist?(CACHE_EXTRA_DIR)
34+
3235
TRUFFLERUBY_GEM_TEST_PACK_VERSION = 'fe5cfa6d14ce50b154fafbc8551cb656d4a39d3d'
3336

3437
JDEBUG = '--vm.agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=y'
@@ -1841,15 +1844,13 @@ def install(name, *options)
18411844
raise 'Installing JVMCI is only available on Linux and macOS currently' unless linux? || darwin?
18421845

18431846
update, jvmci_version = jvmci_update_and_version
1844-
dir = File.expand_path('~/.mx/cache/extra')
1845-
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
18461847
java_home = begin
1847-
dir_pattern = "#{dir}/openjdk1.8.0*#{jvmci_version}"
1848+
dir_pattern = "#{CACHE_EXTRA_DIR}/openjdk1.8.0*#{jvmci_version}"
18481849
if Dir[dir_pattern].empty?
18491850
STDERR.puts download_message
18501851
jvmci_releases = 'https://github.com/graalvm/graal-jvmci-8/releases/download'
18511852
filename = "openjdk-8u#{update}-#{jvmci_version}-#{mx_os}-amd64.tar.gz"
1852-
chdir(dir) do
1853+
chdir(CACHE_EXTRA_DIR) do
18531854
raw_sh 'curl', '-L', "#{jvmci_releases}/#{jvmci_version}/#{filename}", '-o', filename
18541855
raw_sh 'tar', 'xf', filename
18551856
end
@@ -1885,11 +1886,10 @@ def install(name, *options)
18851886

18861887
eclipse_tar = eclipse_url.split('/').last
18871888
eclipse_name = File.basename(eclipse_tar, '.tar.gz')
1888-
eclipse_path = File.expand_path("../#{eclipse_name}/#{eclipse_exe}", TRUFFLERUBY_DIR)
1889+
eclipse_path = "#{CACHE_EXTRA_DIR}/#{eclipse_name}/#{eclipse_exe}"
18891890
return eclipse_path if File.exist?(eclipse_path)
18901891

1891-
dir = File.expand_path('..', TRUFFLERUBY_DIR)
1892-
chdir(dir) do
1892+
chdir(CACHE_EXTRA_DIR) do
18931893
unless File.exist?(eclipse_tar)
18941894
raw_sh 'curl', '-L', eclipse_url, '-o', eclipse_tar
18951895
end

0 commit comments

Comments
 (0)