Skip to content

Commit 7f20333

Browse files
committed
Preinitialize context on all platforms
1 parent 06f6234 commit 7f20333

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -267,17 +267,19 @@ def libpythonvm_build_args():
267267
build_args = []
268268
build_args += bytecode_dsl_build_args()
269269

270-
if mx.is_linux():
271-
if "musl" in mx_subst.path_substitutions.substitute("<multitarget_libc_selection>"):
272-
build_args += ['-H:+GraalOS']
273-
else:
274-
build_args += ["-Dpolyglot.image-build-time.PreinitializeContexts=python"]
275-
if (
276-
mx_sdk_vm_ng.is_nativeimage_ee()
277-
and not os.environ.get('NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE')
278-
and not _is_overridden_native_image_arg("--gc")
279-
):
280-
build_args += ['--gc=G1', '-H:-ProtectionKeys']
270+
if graalos := ("musl" in mx_subst.path_substitutions.substitute("<multitarget_libc_selection>")):
271+
build_args += ['-H:+GraalOS']
272+
else:
273+
build_args += ["-Dpolyglot.image-build-time.PreinitializeContexts=python"]
274+
275+
if (
276+
mx.is_linux()
277+
and not graalos
278+
and mx_sdk_vm_ng.is_nativeimage_ee()
279+
and not os.environ.get('NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE')
280+
and not _is_overridden_native_image_arg("--gc")
281+
):
282+
build_args += ['--gc=G1', '-H:-ProtectionKeys']
281283

282284
profile = None
283285
if (

0 commit comments

Comments
 (0)