@@ -54,15 +54,6 @@ def _get_stdlib_home():
54
54
return os .path .join (SUITE .dir , "graalpython" , "lib-python" , "3" )
55
55
56
56
57
- def _get_svm_binary ():
58
- return os .path .join (SUITE .dir , "graalpython-svm" )
59
-
60
-
61
- def __get_svm_binary_from_graalvm ():
62
- vmdir = os .path .join (mx .suite ("truffle" ).dir , ".." , "vm" )
63
- return os .path .join (vmdir , "mxbuild" , "-" .join ([mx .get_os (), mx .get_arch ()]), "graalpython.image" , "graalpython" )
64
-
65
-
66
57
def _extract_graalpython_internal_options (args ):
67
58
non_internal = []
68
59
additional_dists = []
@@ -224,19 +215,15 @@ def find_eclipse():
224
215
return
225
216
226
217
227
- def python_build_svm (args ):
228
- mx .run_mx (
229
- ["--dynamicimports" , "/substratevm,/vm" , "build" ,
230
- "--force-deprecation-as-warning" , "--dependencies" ,
231
- "GRAAL_MANAGEMENT,graalpython.image" ],
232
- nonZeroIsFatal = True
233
- )
234
- shutil .copy (__get_svm_binary_from_graalvm (), _get_svm_binary ())
218
+ _SVM_ARGS = ["--dynamicimports" , "/vm,/tools,/substratevm" ,
219
+ "--disable-polyglot" , "--disable-libpolyglot" ]
235
220
236
221
237
222
def python_svm (args ):
238
- python_build_svm (args )
239
- svm_image = __get_svm_binary_from_graalvm ()
223
+ mx .run_mx (_SVM_ARGS + ["build" ])
224
+ out = mx .OutputCapture ()
225
+ mx .run_mx (_SVM_ARGS + ["graalvm-home" ], out = mx .TeeOutputCapture (out ))
226
+ svm_image = os .path .join (out .data .strip (), "bin" , "graalpython" )
240
227
mx .run ([svm_image ] + args )
241
228
return svm_image
242
229
@@ -328,14 +315,8 @@ def graalpython_gate_runner(args, tasks):
328
315
329
316
with Task ('GraalPython Python tests on SVM' , tasks , tags = [GraalPythonTags .svmunit ]) as task :
330
317
if task :
331
- svm_image_name = "./graalpython-svm"
332
- if not os .path .exists (svm_image_name ):
333
- svm_image_name = python_svm (["-h" ])
334
- llvm_home = mx_subst .path_substitutions .substitute ('--native.Dllvm.home=<path:SULONG_LIBS>' )
335
- args = ["--python.CoreHome=%s" % os .path .join (SUITE .dir , "graalpython" , "lib-graalpython" ),
336
- "--python.StdLibHome=%s" % os .path .join (SUITE .dir , "graalpython" , "lib-python/3" ),
337
- llvm_home ]
338
- run_python_unittests (svm_image_name , args )
318
+ svm_image_name = python_svm (["-h" ])
319
+ run_python_unittests (svm_image_name )
339
320
340
321
with Task ('GraalPython license header update' , tasks , tags = [GraalPythonTags .license ]) as task :
341
322
if task :
@@ -360,11 +341,6 @@ def graalpython_gate_runner(args, tasks):
360
341
])
361
342
if success not in out .data :
362
343
mx .abort ('Output from generated SVM image "' + svm_image + '" did not match success pattern:\n ' + success )
363
- llvm_home = mx_subst .path_substitutions .substitute ('--native.Dllvm.home=<path:SULONG_LIBS>' )
364
- args = ["--python.CoreHome=%s" % os .path .join (SUITE .dir , "graalpython" , "lib-graalpython" ),
365
- "--python.StdLibHome=%s" % os .path .join (SUITE .dir , "graalpython" , "lib-python/3" ),
366
- llvm_home ]
367
- run_python_unittests (svm_image , args )
368
344
369
345
370
346
mx_gate .add_gate_runner (SUITE , graalpython_gate_runner )
@@ -881,7 +857,6 @@ def mx_post_parse_cmd_line(namespace):
881
857
'python-update-import' : [update_import_cmd , 'import name' ],
882
858
'delete-graalpython-if-testdownstream' : [delete_self_if_testdownstream , '' ],
883
859
'python-checkcopyrights' : [python_checkcopyrights , 'Make sure code files have copyright notices' ],
884
- 'python-build-svm' : [python_build_svm , 'build svm image if it is outdated' ],
885
860
'python-svm' : [python_svm , 'run python svm image (building it if it is outdated' ],
886
861
'punittest' : [punittest , '' ],
887
862
'python3-unittests' : [python3_unittests , 'run the cPython stdlib unittests' ],
0 commit comments