Skip to content

Commit 91407f7

Browse files
committed
[GR-58521] Use Native Image G1 GC on Linux
1 parent 3c0970c commit 91407f7

File tree

3 files changed

+12
-8
lines changed

3 files changed

+12
-8
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060
import mx_native
6161
import mx_unittest
6262
import mx_sdk
63+
import mx_sdk_vm_ng
6364
import mx_subst
6465
import mx_truffle
6566
import mx_graalpython_bisect
@@ -250,6 +251,14 @@ def graalpy_standalone_deps():
250251
return deps
251252

252253

254+
def libpythonvm_build_args():
255+
build_args = []
256+
build_args += bytecode_dsl_build_args()
257+
if mx_sdk_vm_ng.is_nativeimage_ee() and mx.get_os() == 'linux' and 'NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE' not in os.environ:
258+
build_args += ['--gc=G1', '-H:-ProtectionKeys']
259+
return build_args
260+
261+
253262
def full_python(args, env=None):
254263
"""Run python from standalone build (unless kwargs are given). Does not build GraalPython sources automatically."""
255264

@@ -2011,11 +2020,6 @@ def _python_checkpatchfiles():
20112020
def bytecode_dsl_build_args():
20122021
return ['-Dpython.EnableBytecodeDSLInterpreter=true'] if BYTECODE_DSL_INTERPRETER else []
20132022

2014-
mx_subst.results_substitutions.register_no_arg(
2015-
'bytecode_dsl_build_args',
2016-
lambda: f'-Dpython.EnableBytecodeDSLInterpreter={repr(BYTECODE_DSL_INTERPRETER).lower()}'
2017-
)
2018-
20192023
mx_sdk.register_graalvm_component(mx_sdk.GraalVmLanguage(
20202024
suite=SUITE,
20212025
name='GraalVM Python',

mx.graalpython/native-ee

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
DYNAMIC_IMPORTS=/tools,/graal-enterprise,/truffle-enterprise,/vm-enterprise,/substratevm-enterprise
1+
DYNAMIC_IMPORTS=/tools,/graal-enterprise,/truffle-enterprise,/vm-enterprise,/substratevm-enterprise,substratevm-enterprise-gcs
22
BUILD_TARGETS=GRAALPY_NATIVE_STANDALONE
3-
COMPONENTS=SubstrateVM Enterprise,Truffle SVM Macro Enterprise
3+
COMPONENTS=SubstrateVM Enterprise,Truffle SVM Macro Enterprise,suite:substratevm-enterprise-gcs
44
NATIVE_IMAGES=lib:pythonvm
55
GRAALVM_SKIP_ARCHIVE=true

mx.graalpython/suite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -847,8 +847,8 @@
847847
"-J-Xms14g", # GR-46399: libpythonvm needs more than the default minimum of 8 GB to be built
848848
"-Dpolyglot.python.PosixModuleBackend=native",
849849
"-Dpolyglot.python.Sha3ModuleBackend=native",
850-
"<bytecode_dsl_build_args>",
851850
],
851+
"dynamicBuildArgs": "libpythonvm_build_args",
852852
},
853853
},
854854

0 commit comments

Comments
 (0)