Skip to content

Commit a2e9c55

Browse files
committed
[GR-18877] Update overlay to fix benchmarks
PullRequest: graalpython/691
2 parents 35c73b9 + d4ed5d8 commit a2e9c55

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

ci.jsonnet

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{ overlay: "bb8c47317088fde566681fdc692580d3439600c7" }
1+
{ overlay: "2d87253efc83ec7b5cf875dd2ae52fac4a96db5e" }

mx.graalpython/mx_graalpython_benchmark.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,14 @@ def hosting_registry(self):
259259

260260
def run(self, cwd, args):
261261
_check_vm_args(self.name(), args)
262+
extra_polyglot_args = ["--experimental-options"]
262263

264+
host_vm = self.host_vm()
265+
if hasattr(host_vm, 'run_lang'): # this is a full GraalVM build
266+
with environ(self._env or {}):
267+
return host_vm.run_lang('graalpython', extra_polyglot_args + args, cwd)
268+
269+
# Otherwise, we're running from the source tree
263270
truffle_options = [
264271
# '-Dgraal.TruffleCompilationExceptionsAreFatal=true'
265272
]
@@ -278,7 +285,7 @@ def run(self, cwd, args):
278285
if mx.suite("sulong-managed", fatalIfMissing=False):
279286
dists.append('SULONG_MANAGED')
280287

281-
extra_polyglot_args += ["--experimental-options", "--python.CAPI=%s" % SUITE.extensions._get_capi_home() ]
288+
extra_polyglot_args += ["--python.CAPI=%s" % SUITE.extensions._get_capi_home()]
282289

283290
vm_args = mx.get_runtime_jvm_args(dists, cp_suffix=self._cp_suffix, cp_prefix=self._cp_prefix)
284291
if isinstance(self._extra_vm_args, list):
@@ -293,14 +300,10 @@ def run(self, cwd, args):
293300
args.remove(a)
294301
cmd = truffle_options + vm_args + extra_polyglot_args + args
295302

296-
host_vm = self.host_vm()
297303
if not self._env:
298304
self._env = dict()
299305
with environ(self._env):
300-
if hasattr(host_vm, 'run_lang'):
301-
return host_vm.run_lang('graalpython', extra_polyglot_args + args, cwd)
302-
else:
303-
return host_vm.run(cwd, cmd)
306+
return host_vm.run(cwd, cmd)
304307

305308
def name(self):
306309
return VM_NAME_GRAALPYTHON

0 commit comments

Comments
 (0)