@@ -254,6 +254,19 @@ def ruby_run_ruby(args):
254
254
ruby = join (standalone_home , 'bin/ruby' )
255
255
os .execlp (ruby , ruby , * args )
256
256
257
+ def ruby_run_ruby_from_classpath (args ):
258
+ """run TruffleRuby from the classpath"""
259
+ dists = ['RUBY_COMMUNITY' , 'TRUFFLERUBY-LAUNCHER' ]
260
+ if '--skip-build' in args :
261
+ args .remove ('--skip-build' )
262
+ else :
263
+ mx .command_function ('build' )(['--dependencies' , ',' .join (dists )])
264
+ classpath = mx .classpath (dists )
265
+ jvm_args = ['-cp' , classpath ]
266
+ mx_truffle .enable_truffle_native_access (jvm_args )
267
+ mx_truffle .enable_sun_misc_unsafe (jvm_args )
268
+ mx .run_java ([* jvm_args , 'org.truffleruby.launcher.RubyLauncher' , * args ], jdk = jdk , nonZeroIsFatal = True )
269
+
257
270
def ruby_run_specs (ruby , args ):
258
271
with VerboseMx ():
259
272
jt ('--use' , ruby , 'test' , 'specs' , * args )
@@ -378,6 +391,7 @@ def ruby_maven_deploy_public_repo_dir(args):
378
391
379
392
mx .update_commands (_suite , {
380
393
'ruby' : [ruby_run_ruby , '' ],
394
+ 'ruby_from_classpath' : [ruby_run_ruby_from_classpath , '' ],
381
395
'build_truffleruby' : [build_truffleruby , '' ],
382
396
'ruby_check_heap_dump' : [ruby_check_heap_dump , '' ],
383
397
'ruby_testdownstream_aot' : [ruby_testdownstream_aot , 'aot_bin' ],
0 commit comments