Skip to content

Commit d135881

Browse files
committed
[GR-50666] Use exclusively standalones and no longer legacy GraalVM layout
1 parent f6ffeb3 commit d135881

21 files changed

+34
-87
lines changed

.github/workflows/ci.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ jobs:
7171

7272
- name: Create archive
7373
run: |
74-
cd $(dirname $(jt graalvm-home))
75-
mv $(basename $(jt graalvm-home)) truffleruby-jvm
74+
cd $(dirname $(jt ruby-home))
75+
mv $(basename $(jt ruby-home)) truffleruby-jvm
7676
tar cf ${{ github.workspace }}/truffleruby-jvm.tar truffleruby-jvm
7777
- uses: actions/upload-artifact@v2
7878
with:
@@ -114,7 +114,7 @@ jobs:
114114
- name: Create archive
115115
run: |
116116
df -h
117-
mv "$(jt -u native graalvm-home)" "${{ github.workspace }}/truffleruby-native"
117+
mv "$(jt -u native ruby-home)" "${{ github.workspace }}/truffleruby-native"
118118
rm -r mxbuild ../graal/sdk/mxbuild
119119
df -h
120120
cd ${{ github.workspace }}

ci.jsonnet

-1
Original file line numberDiff line numberDiff line change
@@ -541,7 +541,6 @@ local composition_environment = utils.add_inclusion_tracking(part_definitions, "
541541
"ruby-test-gems-darwin-amd64": $.platform.darwin_amd64 + $.jdk.stable + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
542542
"ruby-test-gems-darwin-aarch64": $.platform.darwin_aarch64 + $.jdk.stable + $.env.jvm + gate + $.use.gem_test_pack + $.run.test_gems,
543543
"ruby-test-ecosystem-linux-amd64": $.platform.linux + $.jdk.stable + $.env.jvm + gate + $.use.node + $.use.sqlite331 + $.use.gem_test_pack + $.run.test_ecosystem,
544-
"ruby-test-standalone-linux-amd64": $.platform.linux + $.jdk.stable+ gate_no_build + $.run.test_make_standalone_distribution,
545544

546545
"ruby-test-compiler-ce-stable": $.platform.linux + $.jdk.stable + $.env.jvm_ce + gate + $.use.truffleruby + $.run.test_compiler,
547546
"ruby-test-compiler-ce-latest": $.platform.linux + $.jdk.latest + $.env.jvm_ce + gate + $.use.truffleruby + $.run.test_compiler,

doc/contributor/launchers.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ This file explains the requirements and architecture of the second category of t
1010

1111
## Requirements
1212

13-
1. When TruffleRuby tar (GraalVM) is downloaded and unpacked, all files in `bin` and
14-
`languages/ruby/bin` has to always run the TruffleRuby provided by the tar.
13+
1. When TruffleRuby tar (GraalVM) is downloaded and unpacked, all files in `bin`
14+
have to always run the TruffleRuby provided by the tar.
1515
- Therefore `PATH` is not involved (`/usr/bin/env` cannot be used in shebang).
1616
- Therefore there are no absolute paths in `bin` executables.
1717
- Therefore all scripts in `bin` are always resolved to `truffleruby` in the same dir.

mx.truffleruby/jvm

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ DYNAMIC_IMPORTS=/tools
33
COMPONENTS=TruffleRuby,suite:tools
44
# To also create the standalone
55
INSTALLABLES=TruffleRuby
6-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
6+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/jvm-ce

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ DYNAMIC_IMPORTS=/tools,/compiler
33
COMPONENTS=TruffleRuby,suite:tools,GraalVM compiler
44
# To also create the standalone
55
INSTALLABLES=TruffleRuby
6-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
6+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/jvm-ce-libgraal

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ COMPONENTS=TruffleRuby,suite:tools,GraalVM compiler,SubstrateVM,LibGraal
44
NATIVE_IMAGES=lib:jvmcicompiler
55
# To also create the standalone
66
INSTALLABLES=TruffleRuby
7-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
7+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/jvm-ee

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ COMPONENTS=TruffleRuby,suite:tools,GraalVM enterprise compiler,Truffle enterpris
44
NATIVE_IMAGES=false
55
# To also create the standalone
66
INSTALLABLES=TruffleRuby
7-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
7+
BUILD_TARGETS=GRAALVM_STANDALONES
88
# NOTE: SVM EE is added as a workaround to tell the JVM standalone to be EE

mx.truffleruby/jvm-ee-libgraal

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ COMPONENTS=TruffleRuby,suite:tools,GraalVM enterprise compiler,Truffle enterpris
44
NATIVE_IMAGES=lib:jvmcicompiler
55
# To also create the standalone
66
INSTALLABLES=TruffleRuby
7-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
7+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/mx_truffleruby.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import mx_gate
1919
import mx_sdk
2020
import mx_sdk_vm
21+
import mx_sdk_vm_impl
2122
import mx_subst
2223
import mx_spotbugs
2324

@@ -190,9 +191,9 @@ def ruby_check_heap_dump(input_args, out=None):
190191
raise Exception("heap dump check failed")
191192

192193
def ruby_run_ruby(args):
193-
"""run TruffleRuby in $(mx graalvm-home), use bin/jt for more control and shortcuts"""
194-
graalvm_home = mx_sdk_vm.graalvm_home(fatalIfMissing=True)
195-
ruby = join(graalvm_home, 'languages/ruby/bin/ruby')
194+
"""run TruffleRuby in $(mx standalone-home --type=jvm ruby), needs an env including a ruby standalone. Use bin/jt for more control and shortcuts"""
195+
standalone_home = mx_sdk_vm_impl.standalone_home('ruby', is_jvm=True)
196+
ruby = join(standalone_home, 'bin/ruby')
196197
os.execlp(ruby, ruby, *args)
197198

198199
def ruby_run_specs(ruby, args):

mx.truffleruby/native

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:B
66
GENERATE_DEBUGINFO=false
77
# To also create the standalone
88
INSTALLABLES=TruffleRuby
9-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
9+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/native-ee

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:B
66
GENERATE_DEBUGINFO=false
77
# To also create the standalone
88
INSTALLABLES=TruffleRuby
9-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
9+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/native-ee-aux

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ GENERATE_DEBUGINFO=false
77
NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE=true
88
# To also create the standalone
99
INSTALLABLES=TruffleRuby
10-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
10+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/native-ee-host-inlining

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:B
66
GENERATE_DEBUGINFO=false
77
# To also create the standalone
88
INSTALLABLES=TruffleRuby
9-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
9+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/native-ee-polybench

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:B
66
GENERATE_DEBUGINFO=false
77
# To also create the standalone
88
INSTALLABLES=TruffleRuby
9-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
9+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/native-host-inlining

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:B
66
GENERATE_DEBUGINFO=false
77
# To also create the standalone
88
INSTALLABLES=TruffleRuby
9-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
9+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/native-profiling

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ EXTRA_IMAGE_BUILDER_ARGUMENTS=rubyvm:-H:+UnlockExperimentalVMOptions rubyvm:-H:B
66
GENERATE_DEBUGINFO=false
77
# To also create the standalone
88
INSTALLABLES=TruffleRuby
9-
BUILD_TARGETS=GRAALVM,GRAALVM_STANDALONES
9+
BUILD_TARGETS=GRAALVM_STANDALONES

mx.truffleruby/toolchain

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
GRAALVM_SKIP_ARCHIVE=true
22
DYNAMIC_IMPORTS=/tools
33
COMPONENTS=TruffleRuby,suite:tools,LLVM.org toolchain
4-
BUILD_TARGETS=GRAALVM
4+
# To also create the standalone
5+
INSTALLABLES=TruffleRuby
6+
BUILD_TARGETS=GRAALVM_STANDALONES

src/test-internal/java/org/truffleruby/test/internal/RubyDebugTest.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ public void testInlineModifiesFrame() throws Throwable {
286286
}
287287

288288
// To debug how the breakpoint is set in this test, it is useful to run:
289-
// $ mx -d unittest -Dorg.graalvm.language.ruby.home=$PWD/mxbuild/truffleruby-jvm/languages/ruby -Dtruffle.instrumentation.trace=true RubyDebugTest#testProperties
289+
// $ mx -d unittest -Dorg.graalvm.language.ruby.home=$PWD/mxbuild/truffleruby-jvm -Dtruffle.instrumentation.trace=true RubyDebugTest#testProperties
290290
// and put a breakpoint on com.oracle.truffle.api.debug.SuspendableLocationFinder.findNearestBound.
291291
@Test
292292
public void testProperties() throws Throwable {

tool/jt.rb

+8-28
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def ruby_launcher
256256
File.directory?(@ruby_name) ? "#{@ruby_name}/bin/ruby" : @ruby_name
257257
else
258258
graalvm = "#{TRUFFLERUBY_DIR}/mxbuild/truffleruby-#{@ruby_name}"
259-
"#{graalvm}/languages/ruby/bin/ruby"
259+
"#{graalvm}/bin/ruby"
260260
end
261261

262262
raise "The Ruby executable #{ruby_launcher} does not exist" unless File.exist?(ruby_launcher)
@@ -268,7 +268,6 @@ def ruby_launcher
268268
unless @silent
269269
shortened_path = @ruby_launcher.sub(%r[^#{Regexp.escape TRUFFLERUBY_DIR}/], '')
270270
shortened_path = shortened_path.sub(%r[/bin/(ruby|truffleruby)$], '')
271-
shortened_path = shortened_path.sub(%r[/languages/ruby$], '') if graalvm_home
272271
tags = [*('Interpreted' if truffleruby? && !truffleruby_compiler?),
273272
truffleruby? ? 'TruffleRuby' : 'a Ruby',
274273
*('with Native' if truffleruby_native_built?),
@@ -287,18 +286,7 @@ def ruby_home
287286
require_ruby_launcher!
288287
File.expand_path('../..', @ruby_launcher_realpath)
289288
end
290-
291-
def graalvm_home
292-
up = if ruby_home.end_with?('jre/languages/ruby')
293-
3
294-
elsif ruby_home.end_with?('languages/ruby')
295-
2
296-
else
297-
nil # standalone
298-
end
299-
return nil unless up
300-
File.expand_path((['..'] * up).join('/'), ruby_home)
301-
end
289+
alias_method :'ruby-home', :ruby_home
302290

303291
def truffleruby!
304292
raise 'This command requires TruffleRuby.' unless truffleruby?
@@ -350,8 +338,8 @@ def truffleruby_compiler?
350338
return @truffleruby_compiler = false unless truffleruby?
351339
return @truffleruby_compiler = true if truffleruby_native_built?
352340

353-
# Detect if the compiler is present by reading the $graalvm_home/release file
354-
@truffleruby_compiler = File.readlines("#{graalvm_home || ruby_home}/release").grep(/^COMMIT_INFO=/).any? do |line|
341+
# Detect if the compiler is present by reading the $ruby_home/release file
342+
@truffleruby_compiler = File.readlines("#{ruby_home}/release").grep(/^COMMIT_INFO=/).any? do |line|
355343
line.include?('"compiler":') || line.include?("'compiler':")
356344
end
357345
end
@@ -898,7 +886,7 @@ def help
898886
jt sync continuously synchronize changes from the Ruby source files to the GraalVM build
899887
jt idea generates IntelliJ projects
900888
jt format run eclipse code formatter
901-
jt graalvm-home prints the GraalVM home of the RUBY_SELECTOR
889+
jt ruby-home prints the Ruby home of the RUBY_SELECTOR
902890
903891
you can also put --build or --rebuild in front of any command to build or rebuild first
904892
@@ -929,10 +917,6 @@ def launcher
929917
puts ruby_launcher
930918
end
931919

932-
define_method(:'graalvm-home') do
933-
puts graalvm_home
934-
end
935-
936920
def build(*options)
937921
in_truffleruby_repo_root!
938922
project = options.shift
@@ -2540,11 +2524,11 @@ def sforceimports
25402524
mx_options, mx_build_options = args_split(options)
25412525
mx_args = mx_base_args + mx_options
25422526

2527+
standalone_type = env.include?('native') ? 'native' : 'jvm'
25432528
mx(*mx_args, 'build', *mx_build_options, primary_suite: TRUFFLERUBY_DIR)
2544-
build_dir = mx(*mx_args, 'graalvm-home', primary_suite: TRUFFLERUBY_DIR, capture: :out).lines.last.chomp
2529+
build_dir = mx(*mx_args, 'standalone-home', "--type=#{standalone_type}", 'ruby', primary_suite: TRUFFLERUBY_DIR, capture: :out).lines.last.chomp
25452530

25462531
dest = "#{TRUFFLERUBY_DIR}/mxbuild/#{name}"
2547-
dest_ruby = "#{dest}/languages/ruby"
25482532
FileUtils.rm_rf dest
25492533
if @ruby_name != @mx_env
25502534
# if `--name NAME` is passed, we want to copy so we don't end up with two symlinks
@@ -2573,7 +2557,7 @@ def sforceimports
25732557

25742558
link_path = "#{rubies_dir}/#{name}"
25752559
File.delete link_path if File.symlink? link_path or File.exist? link_path
2576-
File.symlink dest_ruby, link_path
2560+
File.symlink dest, link_path
25772561
end
25782562
end
25792563

@@ -3171,10 +3155,6 @@ def docker(*args)
31713155
require_relative 'docker'
31723156
JT::Docker.new.docker(*args)
31733157
end
3174-
3175-
def visualvm
3176-
sh "#{graalvm_home}/bin/jvisualvm"
3177-
end
31783158
end
31793159

31803160
class JT

tool/local-backtrace.rb

+1-2
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
contents = STDIN.read
44
contents = contents.gsub("/b/b/e/main", ".")
55
contents = contents.gsub(%r{/Users/graal\d+/slave/e/main/}, "./")
6-
contents = contents.gsub("/mxbuild/truffleruby-jvm/jre/languages/ruby/", "/")
7-
contents = contents.gsub(%r{\S+/languages/ruby/}, "./")
6+
contents = contents.gsub("/mxbuild/truffleruby-jvm/", "/")
87
STDOUT.puts contents

tool/make-standalone-distribution.sh

-34
This file was deleted.

0 commit comments

Comments
 (0)