Skip to content

Commit 12cd10f

Browse files
committed
Make sure we only pick up GRAALPY_HOME for a custom benchmark config
1 parent b121170 commit 12cd10f

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

mx.graalpython/mx_graalpython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ def graalpy_native_pgo_build_and_test(_):
321321
GRAALPY_HOME=instrumented_home,
322322
):
323323
graalpytest(["--python", instrumented_launcher, "test_venv.py"])
324-
mx.command_function('benchmark')(["meso-small:*"])
324+
mx.command_function('benchmark')(["meso-small:*", "--", "--python-vm", "graalpython", "--python-vm-config", "custom"])
325325

326326
iprof_path = Path(SUITE.dir) / 'default.iprof'
327327
lcov_path = Path(SUITE.dir) / 'default.lcov'

mx.graalpython/mx_graalpython_benchmark.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262

6363
PYTHON_VM_REGISTRY_NAME = "Python"
6464
CONFIGURATION_DEFAULT = "default"
65+
CONFIGURATION_CUSTOM = "custom"
6566
CONFIGURATION_INTERPRETER = "interpreter"
6667
CONFIGURATION_NATIVE_INTERPRETER = "native-interpreter"
6768
CONFIGURATION_DEFAULT_MULTI = "default-multi"
@@ -279,9 +280,12 @@ def launcher_type(self):
279280
@property
280281
@functools.lru_cache
281282
def interpreter(self):
282-
if home := mx.get_env("GRAALPY_HOME"):
283+
if self.config_name() == CONFIGURATION_CUSTOM:
284+
home = mx.get_env("GRAALPY_HOME")
285+
if not home:
286+
mx.abort("The custom benchmark config for graalpy is to run with a custom GRAALPY_HOME locally")
283287
launcher = join(home, "bin", "graalpy")
284-
mx.log(f"Using {launcher} based on GRAALPY_HOME environment variable.")
288+
mx.log(f"Using {launcher} based on GRAALPY_HOME environment for custom config.")
285289
return launcher
286290
from mx_graalpython import graalpy_standalone
287291
launcher = graalpy_standalone(self.launcher_type, build=False)
@@ -1033,6 +1037,7 @@ def add_graalpy_vm(name, *extra_polyglot_args):
10331037
python_vm_registry.add_vm(GraalPythonVm(config_name=name, extra_polyglot_args=extra_polyglot_args), suite, 10)
10341038

10351039
# GraalPy VMs:
1040+
add_graalpy_vm(CONFIGURATION_CUSTOM)
10361041
add_graalpy_vm(CONFIGURATION_DEFAULT)
10371042
add_graalpy_vm(CONFIGURATION_INTERPRETER, '--experimental-options', '--engine.Compilation=false')
10381043
add_graalpy_vm(CONFIGURATION_DEFAULT_MULTI, '--experimental-options', '-multi-context')

0 commit comments

Comments
 (0)