{"record":{"id":"c5dae384c276fcc6","repo":"oracle/graal","slug":"could-not-extract-the-jar-file-path-from-the-comma","errorCode":null,"errorMessage":"Could not extract the jar file path from the command output! Expected to match pattern {repr(jar_pattern)}.","messagePattern":"Could not extract the jar file path from the command output! Expected to match pattern (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdk/mx.sdk/mx_sdk_benchmark.py","lineNumber":3715,"sourceCode":"        \"\"\"Checks if the benchmark JAR exists and generates it if it doesn't.\"\"\"\n        jar_path = self._get_jar_path(benchmark)\n        if not Path(jar_path).is_file():\n            self._generate_jar(benchmark)\n\n    def _get_jar_path(self, benchmark: str) -> str:\n        if benchmark not in bm_exec_context().get(self.JARS):\n            self._acquire_jar_path(benchmark)\n        return bm_exec_context().get(self.JARS)[benchmark]\n\n    def _acquire_jar_path(self, benchmark: str):\n        jar_path_cmd = [f\"{self.baristaBuilderPath()}\", \"--get-jar\", benchmark]\n        out = mx.OutputCapture()\n        mx.run(jar_path_cmd, out=out)\n        # Capture the application jar from the Barista 'build' script output\n        jar_pattern = r\"application jar file path is: ([^\\n]+)\\n\"\n        jar_match = re.search(jar_pattern, out.data)\n        if not jar_match:\n            raise ValueError(f\"Could not extract the jar file path from the command output! Expected to match pattern {repr(jar_pattern)}.\")\n        # Cache for future access\n        bm_exec_context().get(self.JARS)[benchmark] = jar_match.group(1)\n\n    def _generate_jar(self, benchmark: str):\n        \"\"\"Generates the benchmark JAR file.\"\"\"\n        jar_generation_cmd = [str(self.baristaBuilderPath()), \"--skip-nib-generation\", benchmark]\n        mx.log(f\"Generating the JAR file by running {jar_generation_cmd}. This can take a while.\")\n        try:\n            mx.run(jar_generation_cmd)\n        except BaseException as e:\n            if isinstance(e, SystemExit):\n                mx.abort(f\"Generating the JAR file failed with exit code {e}!\")\n            else:\n                mx.abort(f\"{e}\\nGenerating the JAR file failed!\")\n\n    def before(self, bmSuiteArgs):\n        super().before(bmSuiteArgs)\n        bm_exec_context().add_context_value(self.ENV, ConstantContextValue(os.environ.copy()))","sourceCodeStart":3697,"sourceCodeEnd":3733,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/mx.sdk/mx_sdk_benchmark.py#L3697-L3733","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\n$ ../barista/build --get-jar dacapo-chopin:fop   # prints nothing matching -> ValueError\n\n# after\ngit -C ../barista checkout <rev-expected-by-sdk>\n$ ../barista/build --get-jar dacapo-chopin:fop   # prints: application jar file path is: /path/to/app.jar","handlingStrategy":"validation","validationCode":"import re, subprocess\nout = subprocess.run([str(builder), \"--get-jar\", bench], capture_output=True, text=True).stdout\nassert re.search(r\"application jar file path is: ([^\\n]+)\\n\", out), (\n    \"barista build output does not contain the jar-path line; version skew?\")","typeGuard":null,"tryCatchPattern":"try:\n    suite._acquire_jar_path(benchmark)\nexcept ValueError as e:\n    if \"jar file path\" in str(e):\n        # run build --get-jar manually, inspect output, align barista revision, then retry\n        raise","preventionTips":["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."],"tags":["graalvm","benchmark","barista","parsing","mx"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}