{"record":{"id":"d0bc2a57f820b360","repo":"oracle/graal","slug":"environment-variable-rootfs-points-to-rootfs","errorCode":null,"errorMessage":"Environment variable 'ROOTFS' points to '{rootfs}' which is not a directory!","messagePattern":"Environment variable 'ROOTFS' points to '(.+?)' which is not a directory!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdk/mx.sdk/mx_sdk_benchmark.py","lineNumber":2254,"sourceCode":"    def _resolve_graalos_build_dir() -> Path:\n        \"\"\"Verifies that the GRAALOS_BUILD env var is set and points to a directory. Returns the directory path.\"\"\"\n        graalos_build_env_var = os.getenv(\"GRAALOS_BUILD\")\n        if graalos_build_env_var is None:\n            raise ValueError(\"Environment variable 'GRAALOS_BUILD' is unset! It must point to the GraalOS build directory!\")\n        build_dir = Path(graalos_build_env_var).resolve()\n        if not build_dir.is_dir():\n            raise ValueError(f\"Environment variable 'GRAALOS_BUILD' points to '{build_dir}' which is not a directory!\")\n        return build_dir\n\n    @staticmethod\n    def _resolve_rootfs() -> Path:\n        \"\"\"Verifies that the ROOTFS env var is set and points to a directory. Returns the directory path.\"\"\"\n        rootfs_env_var = os.getenv(\"ROOTFS\")\n        if rootfs_env_var is None:\n            raise ValueError(\"Environment variable 'ROOTFS' is unset! It must point to the CPython file-system root!\")\n        rootfs = Path(rootfs_env_var).resolve()\n        if not rootfs.is_dir():\n            raise ValueError(f\"Environment variable 'ROOTFS' points to '{rootfs}' which is not a directory!\")\n        return rootfs\n\n    @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.\"\"\"","sourceCodeStart":2236,"sourceCodeEnd":2272,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/mx.sdk/mx_sdk_benchmark.py#L2236-L2272","documentation":"Same _resolve_rootfs resolver, but ROOTFS is set and resolves to something that is not a directory (file, nonexistent path, broken symlink). Since the harness will write staged files and create temp directories inside it, it validates is_dir() and raises ValueError with the resolved path.","triggerScenarios":"ROOTFS pointing at a tarball instead of the extracted root, a removed directory, or a typo. Path.resolve() absolutizes, so relative paths that made sense in another cwd fail here.","commonSituations":"ROOTFS set to the .tar.gz artifact name by mistake; build cleaned between runs; NFS/symlink to an unmounted share.","solutions":["Extract/prepare the CPython root directory and export its absolute path as ROOTFS.","Verify with 'test -d \"$ROOTFS\" && ls \"$ROOTFS\"/tmp'.","Re-create rootfs/tmp if it was cleaned."],"exampleFix":"# before\nexport ROOTFS=$HOME/downloads/cpython-rootfs.tar.gz\n\n# after\nexport ROOTFS=$HOME/graalos/roots/cpython-rootfs","handlingStrategy":"validation","validationCode":"r = Path(os.environ['ROOTFS']).resolve()\nassert r.is_dir(), f'ROOTFS={r} is not a directory; extract the CPython rootfs and export its path'","typeGuard":null,"tryCatchPattern":"try/except ValueError; print the resolved path plus whether its parent exists to distinguish typos from missing mounts.","preventionTips":["Export the extracted root directory, never the tarball.","Check mounts (noexec/NFS availability) before runs."],"tags":["mx","benchmark","graalos","environment","path-validation"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}