{"record":{"id":"51c77ed7e9568613","repo":"oracle/graal","slug":"graalhost-toolchain-library-directory-toolchain","errorCode":null,"errorMessage":"GraalHost toolchain library directory '{toolchain_lib_path}' is not a directory!","messagePattern":"GraalHost toolchain library directory '(.+?)' is not a directory!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdk/mx.sdk/mx_sdk_benchmark.py","lineNumber":2302,"sourceCode":"            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\n\n    @staticmethod\n    def _resolve_graalhost_toolchain_lib_dir(vm: \"GraalHostPolyBenchStagingVm\", args: list[str]) -> Path | None:\n        toolchain_lib_dir = vm.bmSuite.polybench_bench_suite_args(args).graalhost_toolchain_lib_dir\n        if toolchain_lib_dir is None:\n            return None\n        toolchain_lib_path = Path(toolchain_lib_dir).resolve()\n        if not toolchain_lib_path.is_dir():\n            raise ValueError(f\"GraalHost toolchain library directory '{toolchain_lib_path}' is not a directory!\")\n        return toolchain_lib_path\n\n    @staticmethod\n    def _graalhost_toolchain_fs_mapping(toolchain_lib_dir: Path, library_name: str) -> dict[str, object]:\n        return json.loads(\n            GraalHostPolyBenchStagingVm.GRAALHOST_TOOLCHAIN_FSMAPPING_TEMPLATE.substitute(\n                concrete=str((toolchain_lib_dir / library_name).resolve()),\n                virt=f\"/lib/{library_name}\",\n            )\n        )\n\n    def _create_staged_benchmark_fs_mapping_file(self) -> Path:\n        \"\"\"\n        Create a graalhost configuration file that contains a single fs-mapping entry,\n        exposing the staged benchmark directory to the isolate.\n        \"\"\"\n        # The staged PolyBench artifact is produced on the host side, so GraalHost needs an explicit\n        # fs-mapping for this output dir or the benchmark file is not visible inside the isolate.","sourceCodeStart":2284,"sourceCodeEnd":2320,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/mx.sdk/mx_sdk_benchmark.py#L2284-L2320","documentation":"Raised in _resolve_graalhost_toolchain_lib_dir: the benchmark suite argument graalhost_toolchain_lib_dir, when provided, must point to an existing directory containing the GraalHost toolchain shared libraries that get fs-mapped into the guest at /lib. A non-directory value (or typo) fails fast with ValueError before any staging command runs.","triggerScenarios":"Passing --polybench-benchsuite-args graalhost_toolchain_lib_dir=<path> where <path> is missing, a file, or a symlink to a removed dir; the resolved Path fails is_dir().","commonSituations":"Suite args referencing a toolchain sysroot that was cleaned or never built; CI caching a stale path; typos in long argument strings.","solutions":["Point graalhost_toolchain_lib_dir at the real toolchain lib directory and verify it contains the expected .so files.","Rebuild the GraalHost toolchain sysroot if it was removed.","Omit the argument entirely when no toolchain libraries are needed (None is accepted)."],"exampleFix":"# before\n--polybench-benchsuite-args graalhost_toolchain_lib_dir=/tmp/does-not-exist\n\n# after\n--polybench-benchsuite-args graalhost_toolchain_lib_dir=$HOME/graalos/toolchain/lib","handlingStrategy":"validation","validationCode":"from pathlib import Path\nd = Path(suite_args.graalhost_toolchain_lib_dir).resolve() if suite_args.graalhost_toolchain_lib_dir else None\nif d is not None:\n    assert d.is_dir(), f'graalhost_toolchain_lib_dir={d} is not a directory'","typeGuard":null,"tryCatchPattern":"try/except ValueError; on failure either fix the path or drop the argument (None is valid) and rerun.","preventionTips":["Omit graalhost_toolchain_lib_dir when no toolchain fs-mappings are needed.","Re-validate suite arg paths after cleaning or moving the toolchain sysroot."],"tags":["mx","benchmark","graalos","toolchain","path-validation","configuration"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}