File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -412,8 +412,16 @@ def python_so(args):
412
412
return _python_graalvm_launcher ((args or []) + ["svm" ])
413
413
414
414
415
+ def _build_graalvm_launcher (mx_args ):
416
+ mx .logv ("Building GraalVM launcher with %s" % mx_args )
417
+ with set_env (LINKY_LAYOUT = "*.jar" ):
418
+ mx .run_mx (mx_args + ["build" ])
419
+
420
+
415
421
def _python_graalvm_launcher (args , extra_dy = None ):
416
422
dy = "/vm,/tools"
423
+ if extra_dy is None :
424
+ extra_dy = "," .join (("/" + dy [0 ]) if dy [1 ] else dy [0 ] for dy in mx .get_dynamic_imports ())
417
425
if extra_dy :
418
426
dy += "," + extra_dy
419
427
if "sandboxed" in args :
@@ -423,11 +431,11 @@ def _python_graalvm_launcher(args, extra_dy=None):
423
431
args .remove ("svm" )
424
432
dy += ",/substratevm"
425
433
dy = ["--dynamicimports" , dy ]
426
- mx . run_mx (dy + [ "build" ] )
434
+ _build_graalvm_launcher (dy )
427
435
out = mx .OutputCapture ()
428
- mx .run_mx (dy + ["graalvm-home" ], out = mx . TeeOutputCapture ( out ) )
436
+ mx .run_mx (dy + ["graalvm-home" ], out = out )
429
437
launcher = os .path .join (out .data .strip (), "bin" , "graalpython" ).split ("\n " )[- 1 ].strip ()
430
- mx .log (launcher )
438
+ mx .logv (launcher )
431
439
if args :
432
440
mx .run ([launcher ] + args )
433
441
return launcher
You can’t perform that action at this time.
0 commit comments