@@ -1101,23 +1101,30 @@ def graalpytest(args):
1101
1101
PYTHONHASHSEED = '0' ,
1102
1102
)
1103
1103
1104
- cmd_args = []
1104
+ python_args = []
1105
+ runner_args = []
1106
+ for arg in unknown_args :
1107
+ if arg .startswith (('--python.' , '--engine.' , '--llvm.' , '--vm.' )):
1108
+ python_args .append (arg )
1109
+ else :
1110
+ runner_args .append (arg )
1105
1111
# if we got a binary path it's most likely CPython, so don't add graalpython args
1106
1112
is_graalpy = False
1107
1113
if not args .python :
1108
1114
is_graalpy = True
1109
- cmd_args += ["--experimental-options=true" , "--python.EnableDebuggingBuiltins" ]
1115
+ python_args += ["--experimental-options=true" , "--python.EnableDebuggingBuiltins" ]
1110
1116
elif 'graalpy' in os .path .basename (args .python ) or 'mxbuild' in args .python :
1111
1117
is_graalpy = True
1112
1118
gp_args = ["--vm.ea" , "--vm.esa" , "--experimental-options=true" , "--python.EnableDebuggingBuiltins" ]
1113
1119
mx .log (f"Executable seems to be GraalPy, prepending arguments: { gp_args } " )
1114
- cmd_args += gp_args
1115
- cmd_args += [_python_test_runner (), * unknown_args ]
1120
+ python_args += gp_args
1121
+ runner_args += ['--subprocess-args' , shlex .join (python_args )]
1122
+ cmd_args = [* python_args , _python_test_runner (), * runner_args ]
1116
1123
delete_bad_env_keys (env )
1117
1124
if is_graalpy :
1118
1125
pythonpath = [os .path .join (_dev_pythonhome (), 'lib-python' , '3' )]
1119
1126
pythonpath += [p for p in env .get ('PYTHONPATH' , '' ).split (os .pathsep ) if p ]
1120
- env ['PYTONPATH ' ] = os .pathsep .join (pythonpath )
1127
+ env ['PYTHONPATH ' ] = os .pathsep .join (pythonpath )
1121
1128
if args .python :
1122
1129
return mx .run ([args .python ] + cmd_args , nonZeroIsFatal = True , env = env )
1123
1130
else :
@@ -1163,7 +1170,6 @@ def run_python_unittests(python_binary, args=None, paths=None, aot_compatible=Fa
1163
1170
1164
1171
args = args or []
1165
1172
args = [
1166
- "-s" ,
1167
1173
"--vm.ea" ,
1168
1174
"--experimental-options=true" ,
1169
1175
"--python.EnableDebuggingBuiltins" ,
@@ -1482,7 +1488,7 @@ def graalpython_gate_runner(args, tasks):
1482
1488
with Task ('GraalPython Python unittests with CPython' , tasks , tags = [GraalPythonTags .unittest_cpython ]) as task :
1483
1489
if task :
1484
1490
env = extend_os_env (PYTHONHASHSEED = '0' )
1485
- test_args = [get_cpython (), "-s" , _python_test_runner (), "-n" , "1" , "graalpython/com.oracle.graal.python.test/src/tests" ]
1491
+ test_args = [get_cpython (), _python_test_runner (), "-n" , "1" , "graalpython/com.oracle.graal.python.test/src/tests" ]
1486
1492
mx .run (test_args , nonZeroIsFatal = True , env = env )
1487
1493
1488
1494
with Task ('GraalPython sandboxed tests' , tasks , tags = [GraalPythonTags .unittest_sandboxed ]) as task :
0 commit comments