oracle/graal · error · ValueError
Could not extract the jar file path from the command output!
Error message
Could not extract the jar file path from the command output! Expected to match pattern {repr(jar_pattern)}. What it means
The Barista suite obtains application JAR paths by running 'build --get-jar <benchmark>' and parsing stdout with the regex 'application jar file path is: (.+)'. If the build script output format changes or the script fails silently, the match fails and ValueError is raised with the expected pattern.
Source
Thrown at sdk/mx.sdk/mx_sdk_benchmark.py:3715
"""Checks if the benchmark JAR exists and generates it if it doesn't."""
jar_path = self._get_jar_path(benchmark)
if not Path(jar_path).is_file():
self._generate_jar(benchmark)
def _get_jar_path(self, benchmark: str) -> str:
if benchmark not in bm_exec_context().get(self.JARS):
self._acquire_jar_path(benchmark)
return bm_exec_context().get(self.JARS)[benchmark]
def _acquire_jar_path(self, benchmark: str):
jar_path_cmd = [f"{self.baristaBuilderPath()}", "--get-jar", benchmark]
out = mx.OutputCapture()
mx.run(jar_path_cmd, out=out)
# Capture the application jar from the Barista 'build' script output
jar_pattern = r"application jar file path is: ([^\n]+)\n"
jar_match = re.search(jar_pattern, out.data)
if not jar_match:
raise ValueError(f"Could not extract the jar file path from the command output! Expected to match pattern {repr(jar_pattern)}.")
# Cache for future access
bm_exec_context().get(self.JARS)[benchmark] = jar_match.group(1)
def _generate_jar(self, benchmark: str):
"""Generates the benchmark JAR file."""
jar_generation_cmd = [str(self.baristaBuilderPath()), "--skip-nib-generation", benchmark]
mx.log(f"Generating the JAR file by running {jar_generation_cmd}. This can take a while.")
try:
mx.run(jar_generation_cmd)
except BaseException as e:
if isinstance(e, SystemExit):
mx.abort(f"Generating the JAR file failed with exit code {e}!")
else:
mx.abort(f"{e}\nGenerating the JAR file failed!")
def before(self, bmSuiteArgs):
super().before(bmSuiteArgs)
bm_exec_context().add_context_value(self.ENV, ConstantContextValue(os.environ.copy()))View on GitHub (pinned to a66e9ccd1d)
Solutions
- Run '<barista>/build --get-jar <benchmark>' manually and compare its output against the regex shown in the message.
- Update the barista checkout to the revision matching your sdk suite (or vice versa) so the message format matches.
- If you maintain the harness, keep the 'application jar file path is: ' line stable or update jar_pattern in _acquire_jar_path.
Example fix
# before $ ../barista/build --get-jar dacapo-chopin:fop # prints nothing matching -> ValueError # after git -C ../barista checkout <rev-expected-by-sdk> $ ../barista/build --get-jar dacapo-chopin:fop # prints: application jar file path is: /path/to/app.jar
Defensive patterns
Strategy: validation
Validate before calling
import re, subprocess
out = subprocess.run([str(builder), "--get-jar", bench], capture_output=True, text=True).stdout
assert re.search(r"application jar file path is: ([^\n]+)\n", out), (
"barista build output does not contain the jar-path line; version skew?") Try / catch
try:
suite._acquire_jar_path(benchmark)
except ValueError as e:
if "jar file path" in str(e):
# run build --get-jar manually, inspect output, align barista revision, then retry
raise Prevention
- Keep the barista checkout revision in lockstep with the sdk suite.
- Treat the 'application jar file path is:' line as a stable contract; change parser and producer together.
- Log the raw build output when the parse fails to speed diagnosis.
When it happens
Trigger: Running a Barista benchmark whose 'build' script (from a different barista revision) prints a different message, prints nothing, or exits before printing the jar path line.
Common situations: Version skew between the barista repo checkout and the mx_sdk_benchmark.py parser; build script erroring to stderr while exiting 0; extra log lines or localization changing the exact wording.
Related errors
- The Barista repository does not contain a {path_components}
- Could not find the path to the java executable in: {jvm_cmd}
- You should not set the Barista '--mode' option manually! Fou
- Expected staged GraalHost run config at '{run_config_path}'
- Neither {daCapoClasspathEnvVarName} variable nor {daCapoLibr
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/c5dae384c276fcc6.
Report an issue: GitHub.