Skip to content

Commit 269a7a9

Browse files
committed
Split build target 'python-svm'.
1 parent 371040f commit 269a7a9

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ def _get_stdlib_home():
5757
def _get_svm_binary():
5858
return os.path.join(_suite.dir, "graalpython-svm")
5959

60+
def __get_svm_binary_from_graalvm():
61+
vmdir = os.path.join(mx.suite("truffle").dir, "..", "vm")
62+
return os.path.join(vmdir, "mxbuild", "-".join([mx.get_os(), mx.get_arch()]), "graalpython.image", "graalpython")
6063

6164
def _extract_graalpython_internal_options(args):
6265
internal = []
@@ -333,16 +336,19 @@ def find_eclipse():
333336
return
334337

335338

336-
def python_svm(args):
339+
def python_build_svm(args):
337340
mx.run_mx(
338341
["--dynamicimports", "/substratevm,/vm", "build",
339342
"--force-deprecation-as-warning", "--dependencies",
340343
"GRAAL_MANAGEMENT,graalpython.image"],
341344
nonZeroIsFatal=True
342345
)
343-
vmdir = os.path.join(mx.suite("truffle").dir, "..", "vm")
344-
svm_image = os.path.join(vmdir, "mxbuild", "-".join([mx.get_os(), mx.get_arch()]), "graalpython.image", "graalpython")
345-
shutil.copy(svm_image, os.path.join(_suite.dir, "graalpython-svm"))
346+
shutil.copy(__get_svm_binary_from_graalvm(), _get_svm_binary())
347+
348+
349+
def python_svm(args):
350+
python_build_svm(args)
351+
svm_image = __get_svm_binary_from_graalvm()
346352
mx.run([svm_image] + args)
347353
return svm_image
348354

@@ -942,6 +948,7 @@ def import_python_sources(args):
942948
'python-update-import': [update_import_cmd, 'import name'],
943949
'delete-graalpython-if-testdownstream': [delete_self_if_testdownstream, ''],
944950
'python-checkcopyrights': [python_checkcopyrights, 'Make sure code files have copyright notices'],
951+
'python-build-svm': [python_build_svm, 'build svm image if it is outdated'],
945952
'python-svm': [python_svm, 'run python svm image (building it if it is outdated'],
946953
'punittest': [punittest, ''],
947954
'python3-unittests': [python3_unittests, 'run the cPython stdlib unittests'],

0 commit comments

Comments
 (0)