Skip to content

Commit 2c23c00

Browse files
committed
Add build options for jt build
1 parent 699a9eb commit 2c23c00

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

tool/jt.rb

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,9 @@ def help
515515
parser build the parser
516516
options build the options
517517
cexts build only the C extensions (part of "jt build")
518-
graalvm build a minimal JVM-only GraalVM containing only TruffleRuby
518+
graalvm [--graal] [--native] build a minimal JVM-only GraalVM containing only TruffleRuby
519+
--graal include graal compiler in the build
520+
--native build native ruby image as well
519521
native [--no-sulong] [--no-jvmci] [--no-sforceimports] [--no-tools] [extra mx image options]
520522
build a native image of TruffleRuby (--no-jvmci to use the system Java)
521523
(--no-tools to exclude chromeinspector and profiler)
@@ -579,11 +581,11 @@ def help
579581
jt metrics minheap ... what is the smallest heap you can use to run an application
580582
jt metrics time ... how long does it take to run a command, broken down into different phases
581583
jt benchmark [options] args... run benchmark-interface (implies --graal)
582-
--no-graal don't imply --graal
583-
JT_BENCHMARK_RUBY=ruby benchmark some other Ruby, like MRI
584-
note that to run most MRI benchmarks, you should translate them first with normal Ruby and cache the result, such as
585-
benchmark bench/mri/bm_vm1_not.rb --cache
586-
jt benchmark bench/mri/bm_vm1_not.rb --use-cache
584+
--no-graal don't imply --graal
585+
JT_BENCHMARK_RUBY=ruby benchmark some other Ruby, like MRI
586+
note that to run most MRI benchmarks, you should translate them first with normal
587+
Ruby and cache the result, such as benchmark bench/mri/bm_vm1_not.rb --cache
588+
jt benchmark bench/mri/bm_vm1_not.rb --use-cache
587589
jt profile profiles an application, including the TruffleRuby runtime, and generates a flamegraph
588590
jt where repos ... find these repositories
589591
jt next tell you what to work on next (give you a random core library spec)
@@ -629,13 +631,11 @@ def build(*options)
629631
when "cexts" # Included in 'mx build' but useful to recompile just that part
630632
mx 'build', '--dependencies', 'org.truffleruby.cext'
631633
when 'graalvm'
632-
build_graalvm *options
634+
build_graalvm(*options)
633635
when 'native'
634-
build_native_image *options
635-
when nil
636-
build_graalvm
636+
build_native_image(*options)
637637
else
638-
raise ArgumentError, project
638+
build_graalvm(*project, *options)
639639
end
640640
end
641641

@@ -1952,9 +1952,15 @@ def install_graal(*options)
19521952

19531953
def build_graalvm(*options)
19541954
mx('-p', TRUFFLERUBY_DIR, 'sforceimports') unless ci?
1955+
graal = options.delete('--graal')
1956+
native = options.delete('--native')
19551957

19561958
java_home = ci? ? nil : ENV["JVMCI_HOME"] || install_jvmci
1957-
mx_args = ['-p', TRUFFLERUBY_DIR, '--dynamicimports', '/vm']
1959+
mx_args = ['-p', TRUFFLERUBY_DIR,
1960+
'--dynamicimports', '/vm',
1961+
*(%w[--dynamicimports /compiler] if graal),
1962+
*(%w[--dynamicimports /substratevm --disable-libpolyglot --disable-polyglot --force-bash-launchers=lli,native-image] if native),
1963+
*options]
19581964

19591965
mx(*mx_args, 'build', java_home: java_home)
19601966
build_dir = mx(*mx_args, 'graalvm-home', capture: true).lines.last.chomp

0 commit comments

Comments
 (0)