{"record":{"id":"989cb945a3161afd","repo":"oracle/graal","slug":"launcher-self-launcher-does-not-resolve-to-an","errorCode":null,"errorMessage":"Launcher '{self.launcher}' does not resolve to an executable file!","messagePattern":"Launcher '(.+?)' does not resolve to an executable file!","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"sdk/mx.sdk/mx_sdk_benchmark.py","lineNumber":2014,"sourceCode":"                layered_stages.append(Stage(s.stage_name, layer))\n        return layered_stages\n\n\nclass PolyBenchStagingVm(StageAwareGraalVm):\n    def __init__(self, name, config_name, language, launcher, ext, extra_java_args=None, extra_launcher_args=None):\n        super().__init__(name, config_name, extra_java_args, extra_launcher_args)\n        self.language: str = language\n        self.launcher: str = launcher\n        self.ext: str = ext\n        self.stages_context: StagesContext | None = None\n        self.output_dir: Path | None = None\n        self.staged_program_file_path: Path | None = None\n        self.staging_args: list[str] = []\n\n    def _prepare_for_running(self, args, out, err, cwd, nonZeroIsFatal):\n        self.launcher = self._resolve_possible_env_var(self.launcher)\n        if shutil.which(self.launcher) is None:\n            raise ValueError(f\"Launcher '{self.launcher}' does not resolve to an executable file!\")\n        self.stages_context = StagesContext(self, out, err, nonZeroIsFatal, os.path.abspath(cwd if cwd else os.getcwd()))\n        file_name = f\"staged-benchmark.{self.ext}\"\n        output_dir = self.bmSuite.get_image_output_dir(\n            self.bmSuite.benchmark_output_dir(bm_exec_context().get(\"benchmark\"), args),\n            self.bmSuite.get_full_image_name(self.bmSuite.get_base_image_name(), bm_exec_context().get(\"vm\").config_name())\n        )\n        if self.language == \"Python\":\n            # C-extension-module micros would break if they did not have 'graalpython' somewhere in the path\n            output_dir = output_dir / \"graalpython\"\n        self.output_dir = output_dir\n        self.staged_program_file_path = output_dir / file_name\n        self.staged_program_file_path.parent.mkdir(parents=True, exist_ok=True)\n        self.staging_args = args + [\n            \"--stage-to-language\",\n            self.language,\n            \"--stage-to-file\",\n            str(self.staged_program_file_path),\n            \"--log-staged-program\",","sourceCodeStart":1996,"sourceCodeEnd":2032,"githubUrl":"https://github.com/oracle/graal/blob/a66e9ccd1d7bf2552883939aa0788dfd0e294aab/sdk/mx.sdk/mx_sdk_benchmark.py#L1996-L2032","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Install the launcher tool and verify with 'which <launcher>' in the same environment mx runs in.","If the launcher is given as '$VAR', export VAR pointing to an absolute executable path on PATH.","Run mx with the environment the suite expects (e.g. source emsdk_env.sh before mx benchmark)."],"exampleFix":"# before\n$ EMCC= mx benchmark polybench ... # launcher 'emcc' unresolved -> ValueError\n\n# after\n$ source ~/emsdk/emsdk_env.sh && mx benchmark polybench ...","handlingStrategy":"validation","validationCode":"import shutil, sys\nlauncher = os.path.expandvars(configured_launcher)\nif shutil.which(launcher) is None:\n    sys.exit(f\"launcher '{launcher}' not on PATH; install it or export the referenced env var\")","typeGuard":null,"tryCatchPattern":"try/except ValueError in the CI wrapper script; print PATH and the resolved launcher name to speed diagnosis.","preventionTips":["Run 'which <launcher>' as a preflight step in benchmark scripts.","Export env vars referenced by launcher placeholders in the same CI step that runs mx.","Pin tool versions (emscripten, graalpython) in CI images."],"tags":["mx","benchmark","polybench","environment","path","launcher"],"backgroundTag":null,"analyzedSha":"a66e9ccd1d7bf2552883939aa0788dfd0e294aab","analyzedAt":"2026-08-14T13:58:47.161Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}