{"record":{"id":"ce361cdebe86196d","repo":"can1357/oh-my-pi","slug":"binary-mode-unsupported-container-arch-arch-r","errorCode":null,"errorMessage":"binary mode: unsupported container arch {arch!r}","messagePattern":"binary mode: unsupported container arch (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"packages/metaharness/agent/omp_local.py","lineNumber":408,"sourceCode":"                'ver=$(bun -e \"process.stdout.write(require(\\\\\"./package.json\\\\\").version)\"); '\n                'echo \"pinning native @oh-my-pi/pi-natives-linux-$na@$ver\"; '\n                'bun add --production \"@oh-my-pi/pi-natives-linux-$na@$ver\"'\n            ),\n            timeout_sec=900,\n        )\n        return f\"{app}/dist/cli.js\"\n\n    async def _install_binary(self, environment: BaseEnvironment) -> str:\n        \"\"\"Probe container arch, upload only the matching self-contained omp binary.\"\"\"\n        arch = (\n            await self.exec_as_agent(environment, command=\"uname -m\")\n        ).stdout.strip()\n        if arch in (\"aarch64\", \"arm64\"):\n            hostbin = self._binary_arm64\n        elif arch in (\"x86_64\", \"amd64\"):\n            hostbin = self._binary_x64\n        else:\n            raise RuntimeError(f\"binary mode: unsupported container arch {arch!r}\")\n        if not hostbin:\n            raise RuntimeError(\n                f\"binary mode: no omp binary provided for container arch {arch}\"\n            )\n        app_dir = f\"{self._home}/.omp-bench\"\n        dst = f\"{app_dir}/omp\"\n        staging = \"/tmp/omp-bin\"\n        await self.exec_as_agent(\n            environment, command=f\"mkdir -p {shlex.quote(app_dir)}\"\n        )\n        await environment.upload_file(hostbin, staging)\n        await self.exec_as_agent(\n            environment,\n            command=f\"cp {shlex.quote(staging)} {shlex.quote(dst)} && chmod +x {shlex.quote(dst)}\",\n        )\n        self._cli = dst\n        return dst\n","sourceCodeStart":390,"sourceCodeEnd":426,"githubUrl":"https://github.com/can1357/oh-my-pi/blob/969062200754ea02cfac922e5ebb8c608c079e15/packages/metaharness/agent/omp_local.py#L390-L426","documentation":"In binary install mode, omp_local maps the container's detected CPU architecture (aarch64/arm64 or x86_64/amd64) to the matching prebuilt omp binary supplied by the host. If uname reports any other architecture, there is no binary to install and it raises this RuntimeError.","triggerScenarios":"Running a binary-mode install inside a container whose uname -m output is neither arm64/aarch64 nor x64/x86_64/amd64 — e.g. riscv64, s390x, ppc64le, or an unexpected arch string.","commonSituations":"Exotic CI hardware (s390x/ppc64le runners); unusual emulated containers; a base image or runtime reporting a nonstandard machine string that the arch normalization doesn't cover.","solutions":["Run the task on an arm64 or x86_64 container/host instead.","Use source install mode and build omp natively for the unsupported architecture.","If the arch string should be supported, extend the mapping in _install_binary (e.g. handle new uname spellings) and provide the corresponding binary.","Verify what uname -m prints in the container; fix --platform or image selection if it's not what you expected."],"exampleFix":"# before\nOMP_BENCH_INSTALL=binary ... (on s390x container)  # raises\n# after\nOMP_BENCH_INSTALL=source ... (build natively) — or run on linux/amd64","handlingStrategy":"validation","validationCode":"import platform\narch = platform.machine()\nif arch not in (\"aarch64\", \"arm64\", \"x86_64\", \"amd64\"):\n    raise SystemExit(f\"binary mode unsupported here ({arch}); use install=source\")","typeGuard":null,"tryCatchPattern":"try:\n    await harness.install(env)\nexcept RuntimeError as e:\n    if \"unsupported container arch\" in str(e):\n        harness = make_harness(install=\"source\")\n        await harness.install(env)\n    else:\n        raise","preventionTips":["Check uname -m in the target container before selecting binary mode.","Only run binary mode on x86_64/arm64 containers.","Fall back to source mode for exotic architectures."],"tags":["architecture","containerization","unsupported-platform"],"backgroundTag":"unsupported-architecture","analyzedSha":"969062200754ea02cfac922e5ebb8c608c079e15","analyzedAt":"2026-08-31T10:29:35.737Z","schemaVersion":2},"datasetVersion":"2026-08-31T14:17:45.589Z"}