@@ -515,7 +515,9 @@ def help
515
515
parser build the parser
516
516
options build the options
517
517
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
519
521
native [--no-sulong] [--no-jvmci] [--no-sforceimports] [--no-tools] [extra mx image options]
520
522
build a native image of TruffleRuby (--no-jvmci to use the system Java)
521
523
(--no-tools to exclude chromeinspector and profiler)
@@ -579,11 +581,11 @@ def help
579
581
jt metrics minheap ... what is the smallest heap you can use to run an application
580
582
jt metrics time ... how long does it take to run a command, broken down into different phases
581
583
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
587
589
jt profile profiles an application, including the TruffleRuby runtime, and generates a flamegraph
588
590
jt where repos ... find these repositories
589
591
jt next tell you what to work on next (give you a random core library spec)
@@ -629,13 +631,11 @@ def build(*options)
629
631
when "cexts" # Included in 'mx build' but useful to recompile just that part
630
632
mx 'build' , '--dependencies' , 'org.truffleruby.cext'
631
633
when 'graalvm'
632
- build_graalvm *options
634
+ build_graalvm ( *options )
633
635
when 'native'
634
- build_native_image *options
635
- when nil
636
- build_graalvm
636
+ build_native_image ( *options )
637
637
else
638
- raise ArgumentError , project
638
+ build_graalvm ( * project , * options )
639
639
end
640
640
end
641
641
@@ -1952,9 +1952,15 @@ def install_graal(*options)
1952
1952
1953
1953
def build_graalvm ( *options )
1954
1954
mx ( '-p' , TRUFFLERUBY_DIR , 'sforceimports' ) unless ci?
1955
+ graal = options . delete ( '--graal' )
1956
+ native = options . delete ( '--native' )
1955
1957
1956
1958
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 ]
1958
1964
1959
1965
mx ( *mx_args , 'build' , java_home : java_home )
1960
1966
build_dir = mx ( *mx_args , 'graalvm-home' , capture : true ) . lines . last . chomp
0 commit comments