{"record":{"id":"be903863729e04c3","repo":"oraios/serena","slug":"unsupported-architecture-for-foundry-forge-machi","errorCode":null,"errorMessage":"Unsupported architecture for foundry forge: {machine}","messagePattern":"Unsupported architecture for foundry forge: (.+?)","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/solidity_language_server.py","lineNumber":160,"sourceCode":"                    f\"nomicfoundation-solidity-language-server executable not found at {solidity_executable_path}. \"\n                    \"Something went wrong with the installation.\"\n                )\n\n            return solidity_executable_path\n\n        @staticmethod\n        def _get_forge_npm_package() -> str:\n            \"\"\"\n            Returns the platform-specific @foundry-rs forge npm subpackage name. Installing\n            the meta-package fails on Windows due to a POSIX-only postinstall script.\n            \"\"\"\n            machine = platform.machine().lower()\n            if machine in (\"x86_64\", \"amd64\"):\n                arch = \"amd64\"\n            elif machine in (\"arm64\", \"aarch64\"):\n                arch = \"arm64\"\n            else:\n                raise RuntimeError(f\"Unsupported architecture for foundry forge: {machine}\")\n\n            if os.name == \"nt\":\n                if arch != \"amd64\":\n                    raise RuntimeError(f\"foundry forge does not publish a Windows {arch} npm package\")\n                return \"@foundry-rs/forge-win32-amd64\"\n            if platform.system() == \"Darwin\":\n                return f\"@foundry-rs/forge-darwin-{arch}\"\n            return f\"@foundry-rs/forge-linux-{arch}\"\n\n        def create_launch_command_env(self) -> dict[str, str]:\n            solidity_language_server_version = self._custom_settings.get(\n                \"solidity_language_server_version\", DEFAULT_SOLIDITY_LANGUAGE_SERVER_VERSION\n            )\n            forge_version = self._custom_settings.get(\"forge_version\", DEFAULT_FORGE_VERSION)\n            solidity_ls_dir = self._resolve_solidity_ls_dir(solidity_language_server_version, forge_version)\n            managed_bin_dir = os.path.join(solidity_ls_dir, \"node_modules\", \".bin\")\n            return {\"PATH\": managed_bin_dir + os.pathsep + os.environ.get(\"PATH\", \"\")}\n","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/solidity_language_server.py#L142-L178","documentation":"When mapping the CPU architecture to a foundry forge npm package, _get_forge_npm_package only recognizes x86_64/amd64 and arm64/aarch64. Any other platform.machine() value (e.g. i686, armv7l, riscv64) triggers this RuntimeError because Foundry does not publish forge binaries for those architectures.","triggerScenarios":"Starting the Solidity language server on a machine whose platform.machine() is not x86_64/amd64/arm64/aarch64 — typically 32-bit x86, ARMv7 SBCs (Raspberry Pi 32-bit OS), or uncommon architectures.","commonSituations":"Running inside a 32-bit Docker container on 64-bit hardware, Raspberry Pi OS (32-bit), or niche embedded/emulated environments.","solutions":["Switch to a 64-bit OS/image (x86_64 or arm64) for the process and container.","Run in an x86_64 emulation layer (e.g. Docker with --platform linux/amd64 under QEMU).","Provide forge separately and adapt the launch command, or request/await an official forge package for your architecture.","Use a hosted/devcontainer environment with a supported architecture."],"exampleFix":"// before (32-bit container)\ndocker run 32bit/ubuntu\n// after\ndocker run --platform linux/amd64 ubuntu:latest","handlingStrategy":"validation","validationCode":"import platform\narch = platform.machine().lower()\nif arch not in (\"x86_64\", \"amd64\", \"arm64\", \"aarch64\"):\n    raise SystemExit(f\"Foundry forge needs x86_64/arm64, got {arch}; run under 64-bit emulation\")","typeGuard":"def forge_arch_supported() -> bool:\n    import platform\n    return platform.machine().lower() in (\"x86_64\", \"amd64\", \"arm64\", \"aarch64\")","tryCatchPattern":"try:\n    server = SolidityLanguageServer(config, repo_root, settings)\nexcept RuntimeError as e:\n    if \"Unsupported architecture\" in str(e):\n        raise SystemExit(\"Run on x86_64/arm64, or use Docker --platform linux/amd64\") from e\n    raise","preventionTips":["Use 64-bit images/OS for all environments that run the Solidity server.","In CI, pin runner architecture (ubuntu-latest amd64 or arm64 runners).","Check platform.machine() in your entrypoint and fail fast with a clear message."],"tags":["solidity","foundry","architecture","platform"],"backgroundTag":"unsupported-architecture","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}