oracle/graal · error · ValueError
Environment variable 'GRAALOS_BUILD' points to '{build_dir}'
Error message
Environment variable 'GRAALOS_BUILD' points to '{build_dir}' which is not a directory! What it means
Same resolver as the unset case, but here GRAALOS_BUILD is set and resolves (via Path.resolve) to a path that is not a directory — e.g. it points at a file, a broken symlink target, or a nonexistent path after resolve(). The harness needs a real build directory, so it raises ValueError naming the offending path.
Source
Thrown at sdk/mx.sdk/mx_sdk_benchmark.py:2243
# Disable C-native-extension benchmarks on GraalOS due to os.symlink not being supported (GR-71952)
mx.abort(f"Benchmark '{benchmark}' (and all other C-native-extension benchmarks) is not supported on GraalHost!")
def run_stage_image(self):
# Start with resolving prerequisite environment variables
build_dir = self._resolve_graalos_build_dir()
# Stage benchmark
super().run_stage_image()
self._create_staged_benchmark_run_config_file(build_dir)
@staticmethod
def _resolve_graalos_build_dir() -> Path:
"""Verifies that the GRAALOS_BUILD env var is set and points to a directory. Returns the directory path."""
graalos_build_env_var = os.getenv("GRAALOS_BUILD")
if graalos_build_env_var is None:
raise ValueError("Environment variable 'GRAALOS_BUILD' is unset! It must point to the GraalOS build directory!")
build_dir = Path(graalos_build_env_var).resolve()
if not build_dir.is_dir():
raise ValueError(f"Environment variable 'GRAALOS_BUILD' points to '{build_dir}' which is not a directory!")
return build_dir
@staticmethod
def _resolve_rootfs() -> Path:
"""Verifies that the ROOTFS env var is set and points to a directory. Returns the directory path."""
rootfs_env_var = os.getenv("ROOTFS")
if rootfs_env_var is None:
raise ValueError("Environment variable 'ROOTFS' is unset! It must point to the CPython file-system root!")
rootfs = Path(rootfs_env_var).resolve()
if not rootfs.is_dir():
raise ValueError(f"Environment variable 'ROOTFS' points to '{rootfs}' which is not a directory!")
return rootfs
@staticmethod
def _require_executable(path: Path, description: str) -> Path:
if not path.is_file():
raise ValueError(f"{description} '{path}' does not exist!")
if not os.access(path, os.X_OK):View on GitHub (pinned to a66e9ccd1d)
Solutions
- Point GRAALOS_BUILD at the actual GraalOS build directory (verify with 'ls "$GRAALOS_BUILD/graalhost").
- Rebuild GraalOS if the build tree was removed, then re-export.
- Use an absolute path to avoid cwd-dependent resolution.
Example fix
# before export GRAALOS_BUILD=~/graalos/build/graalhost # a subdirectory/file, not the build root # after export GRAALOS_BUILD=$HOME/graalos/build
Defensive patterns
Strategy: validation
Validate before calling
from pathlib import Path
b = Path(os.environ['GRAALOS_BUILD']).resolve()
assert b.is_dir(), f'GRAALOS_BUILD={b} is not a directory; rebuild GraalOS or fix the export' Try / catch
try/except ValueError; on failure print the resolved path and directory listing of its parent to spot typos.
Prevention
- Use absolute exports; avoid relative paths that break under a different cwd.
- Verify "$GRAALOS_BUILD/graalhost" exists before submitting long benchmark jobs.
When it happens
Trigger: GRAALOS_BUILD=/some/file.txt, a symlink to a removed build dir, or a typo'd path (resolve() of a nonexistent path yields an absolute nonexistent path, which is_dir() rejects).
Common situations: Stale export pointing to a deleted build tree after a clean; path typos; relative exports evaluated from a different cwd so resolve() lands elsewhere.
Related errors
- Environment variable 'ROOTFS' points to '{rootfs}' which is
- Environment variable 'GRAALOS_BUILD' is unset! It must point
- Environment variable 'ROOTFS' is unset! It must point to the
- {description} '{path}' does not exist!
- Could not resolve 'graalos-config-util' from PATH!
AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14).
Data as JSON: /api/errors/0bb134e196ab582a.
Report an issue: GitHub.