oracle/graal · error · ValueError

Launcher '{self.launcher}' does not resolve to an executable

Error message

Launcher '{self.launcher}' does not resolve to an executable file!

What it means

Raised in _prepare_for_running of the PolyBench staging VM: after resolving possible environment-variable references in the configured launcher name, shutil.which() cannot find it on PATH, so the benchmark cannot run and a ValueError is thrown. It is a setup/environment error, not a benchmark failure.

Source

Thrown at sdk/mx.sdk/mx_sdk_benchmark.py:2014

                layered_stages.append(Stage(s.stage_name, layer))
        return layered_stages


class PolyBenchStagingVm(StageAwareGraalVm):
    def __init__(self, name, config_name, language, launcher, ext, extra_java_args=None, extra_launcher_args=None):
        super().__init__(name, config_name, extra_java_args, extra_launcher_args)
        self.language: str = language
        self.launcher: str = launcher
        self.ext: str = ext
        self.stages_context: StagesContext | None = None
        self.output_dir: Path | None = None
        self.staged_program_file_path: Path | None = None
        self.staging_args: list[str] = []

    def _prepare_for_running(self, args, out, err, cwd, nonZeroIsFatal):
        self.launcher = self._resolve_possible_env_var(self.launcher)
        if shutil.which(self.launcher) is None:
            raise ValueError(f"Launcher '{self.launcher}' does not resolve to an executable file!")
        self.stages_context = StagesContext(self, out, err, nonZeroIsFatal, os.path.abspath(cwd if cwd else os.getcwd()))
        file_name = f"staged-benchmark.{self.ext}"
        output_dir = self.bmSuite.get_image_output_dir(
            self.bmSuite.benchmark_output_dir(bm_exec_context().get("benchmark"), args),
            self.bmSuite.get_full_image_name(self.bmSuite.get_base_image_name(), bm_exec_context().get("vm").config_name())
        )
        if self.language == "Python":
            # C-extension-module micros would break if they did not have 'graalpython' somewhere in the path
            output_dir = output_dir / "graalpython"
        self.output_dir = output_dir
        self.staged_program_file_path = output_dir / file_name
        self.staged_program_file_path.parent.mkdir(parents=True, exist_ok=True)
        self.staging_args = args + [
            "--stage-to-language",
            self.language,
            "--stage-to-file",
            str(self.staged_program_file_path),
            "--log-staged-program",

View on GitHub (pinned to a66e9ccd1d)

Solutions

  1. Install the launcher tool and verify with 'which <launcher>' in the same environment mx runs in.
  2. If the launcher is given as '$VAR', export VAR pointing to an absolute executable path on PATH.
  3. Run mx with the environment the suite expects (e.g. source emsdk_env.sh before mx benchmark).

Example fix

# before
$ EMCC= mx benchmark polybench ... # launcher 'emcc' unresolved -> ValueError

# after
$ source ~/emsdk/emsdk_env.sh && mx benchmark polybench ...
Defensive patterns

Strategy: validation

Validate before calling

import shutil, sys
launcher = os.path.expandvars(configured_launcher)
if shutil.which(launcher) is None:
    sys.exit(f"launcher '{launcher}' not on PATH; install it or export the referenced env var")

Try / catch

try/except ValueError in the CI wrapper script; print PATH and the resolved launcher name to speed diagnosis.

Prevention

When it happens

Trigger: Running a staged PolyBench benchmark (e.g. via mx benchmark with a PolyBenchStagingVm subclass) where the launcher is 'emcc', 'graalpython', or similar and it is not installed / not on PATH, or the env-var placeholder (e.g. '$EMCC') it references is unset so it resolves to a bogus name.

Common situations: Fresh CI container without emscripten/graalpython in PATH; launcher configured via env var that is unset in the benchmark environment; PATH differences between interactive shell and mx subprocess.

Related errors


AI-assisted analysis of oracle/graal@a66e9ccd1d (2026-08-14). Data as JSON: /api/errors/989cb945a3161afd. Report an issue: GitHub.