{"record":{"id":"896ad2deb076ac83","repo":"oracle/graal","slug":"could-not-resolve-graalos-config-util-from-path","errorCode":null,"errorMessage":"Could not resolve 'graalos-config-util' from PATH!","messagePattern":"Could not resolve 'graalos-config-util' from PATH!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdk/mx.sdk/mx_sdk_benchmark.py","lineNumber":2275,"sourceCode":"    @staticmethod\n    def _require_executable(path: Path, description: str) -> Path:\n        if not path.is_file():\n            raise ValueError(f\"{description} '{path}' does not exist!\")\n        if not os.access(path, os.X_OK):\n            raise ValueError(f\"{description} '{path}' is not executable!\")\n        return path\n\n    @staticmethod\n    def _resolve_graalhost_binary(build_dir: Path) -> Path:\n        \"\"\"Resolve the GraalHost binary from the GraalOS build directory.\"\"\"\n        return GraalHostPolyBenchStagingVm._require_executable(build_dir / \"graalhost\" / \"graalhost\", \"GraalHost binary\")\n\n    @staticmethod\n    def _resolve_graalos_config_util() -> Path:\n        \"\"\"Resolve the graalos-config-util CLI from PATH.\"\"\"\n        config_util = shutil.which(\"graalos-config-util\")\n        if config_util is None:\n            raise ValueError(\"Could not resolve 'graalos-config-util' from PATH!\")\n        return GraalHostPolyBenchStagingVm._require_executable(Path(config_util).resolve(), \"graalos-config-util\")\n\n    def _get_staged_benchmark_run_config_path(self) -> Path:\n        return self.output_dir / \"staged_benchmark_run_config.json\"\n\n    @staticmethod\n    def _merge_graalhost_config_values(base: object, extra: object) -> object:\n        if isinstance(base, dict) and isinstance(extra, dict):\n            merged = dict(base)\n            for key, value in extra.items():\n                if key == \"fsmappings\" and isinstance(merged.get(key), list) and isinstance(value, list):\n                    merged[key] = [*merged[key], *value]\n                elif key in merged:\n                    merged[key] = GraalHostPolyBenchStagingVm._merge_graalhost_config_values(merged[key], value)\n                else:\n                    merged[key] = value\n            return merged\n        return extra","sourceCodeStart":2257,"sourceCodeEnd":2293,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/mx.sdk/mx_sdk_benchmark.py#L2257-L2293","documentation":"Raised in _resolve_graalos_config_util: the graalos-config-util command line tool must be findable on PATH because the run stage shells out to it to generate the staged benchmark's endpoint config. If shutil.which('graalos-config-util') returns None, the harness raises ValueError immediately.","triggerScenarios":"Running the GraalHost PolyBench run stage in an environment where the graalos-config-util package was never installed or its bin dir is not on PATH.","commonSituations":"Fresh CI images; PATH set inside a virtualenv/conda env that mx subprocesses do not inherit; tool installed only for another user.","solutions":["Install graalos-config-util (from the GraalOS tooling build) and verify 'which graalos-config-util'.","Prepend its bin directory to PATH in the shell/CI step that invokes mx benchmark.","Ensure the PATH export happens before mx spawns subprocesses (no per-command env stripping)."],"exampleFix":"# before\n$ mx benchmark polybench-graalhost  # ValueError: could not resolve graalos-config-util\n\n# after\n$ export PATH=\"$GRAALOS_BUILD/tools/bin:$PATH\" && mx benchmark polybench-graalhost","handlingStrategy":"validation","validationCode":"import shutil\nassert shutil.which('graalos-config-util'), 'graalos-config-util not on PATH; install it or extend PATH'","typeGuard":null,"tryCatchPattern":"try/except ValueError; report PATH and expected install location of graalos-config-util to the operator.","preventionTips":["Add a 'which graalos-config-util' preflight to benchmark scripts.","Install the tool into a directory already on PATH in CI images."],"tags":["mx","benchmark","graalos","environment","path","cli-tool"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}