Skip to content

Commit 8c650c7

Browse files
committed
[GR-68626] Only use PGO on GraalVM 25+
PullRequest: graalpython/3949
2 parents 6f23c2b + f4cc6ce commit 8c650c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def libpythonvm_build_args():
272272
build_args += bytecode_dsl_build_args()
273273
if mx_sdk_vm_ng.is_nativeimage_ee() and mx.get_os() == 'linux' and 'NATIVE_IMAGE_AUXILIARY_ENGINE_CACHE' not in os.environ:
274274
build_args += ['--gc=G1', '-H:-ProtectionKeys']
275-
if not os.environ.get("GRAALPY_PGO_PROFILE") and mx.suite('graalpython-enterprise', fatalIfMissing=False):
275+
if not os.environ.get("GRAALPY_PGO_PROFILE") and mx.suite('graalpython-enterprise', fatalIfMissing=False) and mx_sdk_vm_ng.get_bootstrap_graalvm_version() >= mx.VersionSpec("25.0"):
276276
cmd = mx.command_function('python-get-latest-profile', fatalIfMissing=False)
277277
if cmd:
278278
profile = None
@@ -299,6 +299,9 @@ def graalpy_native_pgo_build_and_test(_):
299299
then builds a PGO-optimized GraalPy native standalone with the collected profile.
300300
The profile file will be named 'default.iprof' in native image build directory.
301301
"""
302+
if mx_sdk_vm_ng.get_bootstrap_graalvm_version() < mx.VersionSpec("25.0"):
303+
mx.abort("python-native-pgo not supported on GraalVM < 25")
304+
302305
with set_env(GRAALPY_PGO_PROFILE=""):
303306
mx.log(mx.colorize("[PGO] Building PGO-instrumented native image", color="yellow"))
304307
build_home = graalpy_standalone_home('native', enterprise=True, build=True)

0 commit comments

Comments
 (0)