oracle/graal · error · ValueError
You should not set the Barista '--mode' option manually! Fou
Error message
You should not set the Barista '--mode' option manually! Found '{mode_match.group(0)}' in the run arguments! What it means
The Barista harness command is constructed programmatically and the suite injects '--mode' itself. If the user's run arguments already contain -m/--mode (matched by '^(?:-m|--mode)(=.*)?$'), the suite refuses to run to avoid a duplicate/conflicting option.
Source
Thrown at sdk/mx.sdk/mx_sdk_benchmark.py:4024
jvm_cmd = cmd
# Extract the path to the JVM distribution from the JVM command
java_exe_pattern = os.path.join("^(.*)", "bin", "java$")
java_exe_match = self._regexFindInCommand(jvm_cmd, java_exe_pattern)
if not java_exe_match:
raise ValueError(f"Could not find the path to the java executable in: {jvm_cmd}")
# Extract VM options and command prefix from the JVM command
index_of_java_exe = jvm_cmd.index(java_exe_match.group(0))
jvm_cmd_prefix = jvm_cmd[:index_of_java_exe]
jvm_vm_options = jvm_cmd[index_of_java_exe + 1:]
# Verify that the run arguments don't already contain a "--mode" option
run_args = suite.runArgs(bm_exec_context().get("bm_suite_args")) + self._energyTrackerExtraOptions(suite)
mode_pattern = r"^(?:-m|--mode)(=.*)?$"
mode_match = self._regexFindInCommand(run_args, mode_pattern)
if mode_match:
raise ValueError(f"You should not set the Barista '--mode' option manually! Found '{mode_match.group(0)}' in the run arguments!")
# Get bench name and workload to use in the barista harness - we might have custom named benchmarks that need to be mapped
barista_bench_name = suite.baristaHarnessBenchmarkName()
barista_workload = suite.baristaHarnessBenchmarkWorkload()
# Construct the Barista command
barista_cmd = [str(suite.baristaHarnessPath())]
barista_cmd.append(f"--java-home={java_exe_match.group(1)}")
if barista_workload is not None:
barista_cmd.append(f"--config={barista_workload}")
barista_cmd += run_args
if jvm_vm_options:
self._updateCommandOption(barista_cmd, "--vm-options", "-v", " ".join(jvm_vm_options))
if jvm_cmd_prefix:
self._updateCommandOption(barista_cmd, "--cmd-app-prefix", "-p", " ".join(jvm_cmd_prefix))
barista_cmd += ["--mode", "jvm"]
barista_cmd.append(barista_bench_name)
return barista_cmdView on GitHub (pinned to a66e9ccd1d)
Solutions
- Remove the -m/--mode flag from the run arguments; select the mode through the suite's own option if one exists.
- If you need a specific mode, use the suite-level knob that the Barista suite maps to --mode internally.
- Check _energyTrackerExtraOptions output too, since those options are concatenated before the check.
Example fix
# before mx benchmark barista:some-bench -- --mode=nib # after mx benchmark barista:some-bench # mode chosen by the suite
Defensive patterns
Strategy: validation
Validate before calling
import re
mode_pattern = r"^(?:-m|--mode)(=.*)?$"
bad = [a for a in run_args if re.match(mode_pattern, a)]
assert not bad, f"remove {bad}: the Barista suite sets --mode itself" Prevention
- Never forward barista CLI flags verbatim into mx run args.
- Filter -m/--mode out of user-supplied run args in wrapper scripts before invoking the suite.
When it happens
Trigger: Passing --mode=javassist or -m or --mode as benchmark run args, e.g. 'mx benchmark barista:... -- --mode=nib'.
Common situations: Copy-pasting barista CLI invocations into mx run args; energy-tracker extra options that include a mode flag.
Related errors
- The Barista repository does not contain a {path_components}
- Could not extract the jar file path from the command output!
- Could not find the path to the java executable in: {jvm_cmd}
- Setting the VM option '-Dnative-image.benchmark.stages' is n
- Expected staged GraalHost run config at '{run_config_path}'
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/790937304c32ddf6.
Report an issue: GitHub.