Skip to content

Commit 98df288

Browse files
committed
re-add simple building of standalone svm image
1 parent cd93309 commit 98df288

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ def _get_stdlib_home():
5454
return os.path.join(SUITE.dir, "graalpython", "lib-python", "3")
5555

5656

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+
5766
def _extract_graalpython_internal_options(args):
5867
non_internal = []
5968
additional_dists = []
@@ -215,6 +224,16 @@ def find_eclipse():
215224
return
216225

217226

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())
235+
236+
218237
_SVM_ARGS = ["--dynamicimports", "/vm,/tools,/substratevm",
219238
"--disable-polyglot", "--disable-libpolyglot"]
220239

@@ -857,6 +876,7 @@ def mx_post_parse_cmd_line(namespace):
857876
'python-update-import': [update_import_cmd, 'import name'],
858877
'delete-graalpython-if-testdownstream': [delete_self_if_testdownstream, ''],
859878
'python-checkcopyrights': [python_checkcopyrights, 'Make sure code files have copyright notices'],
879+
'python-build-svm': [python_build_svm, 'build svm image if it is outdated'],
860880
'python-svm': [python_svm, 'run python svm image (building it if it is outdated'],
861881
'punittest': [punittest, ''],
862882
'python3-unittests': [python3_unittests, 'run the cPython stdlib unittests'],

0 commit comments

Comments
 (0)