{"record":{"id":"7dfbc3f157c51896","repo":"oraios/serena","slug":"foundry-forge-does-not-publish-a-windows-arch-np","errorCode":null,"errorMessage":"foundry forge does not publish a Windows {arch} npm package","messagePattern":"foundry forge does not publish a Windows (.+?) npm package","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/solidity_language_server.py","lineNumber":164,"sourceCode":"            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\n        def _resolve_solidity_ls_dir(self, solidity_language_server_version: str, forge_version: str) -> str:\n            # legacy unversioned dir reserved for INITIAL pair; any other combination goes into a versioned subdir\n            is_initial = (\n                solidity_language_server_version == INITIAL_SOLIDITY_LANGUAGE_SERVER_VERSION and forge_version == INITIAL_FORGE_VERSION","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/solidity_language_server.py#L146-L182","documentation":"On Windows, Foundry publishes forge only as an amd64 npm package. _get_forge_npm_package raises this RuntimeError when os.name == 'nt' but the detected architecture is arm64, since no Windows ARM forge npm package exists.","triggerScenarios":"Starting the Solidity language server on Windows-on-ARM (e.g. Surface Pro X, ARM Windows laptops) where platform.machine() reports arm64/aarch64.","commonSituations":"Windows ARM devices or Windows ARM VMs; developers assuming Windows support implies all architectures.","solutions":["Run the workload under x86_64 emulation (Windows 11 ARM's built-in x64 emulation) using an amd64 Python/Node.","Install forge natively via foundryup instead of the npm route and point the server at it.","Use an x64 virtual machine, WSL2 x86_64 image, or a cloud/dev container on amd64.","Track Foundry releases for a future Windows arm64 npm package."],"exampleFix":"// before: arm64 Windows native Python/Node\n// after: x64 toolchain under Windows ARM emulation\nwinget install Python.Python.3.12 --architecture x64","handlingStrategy":"validation","validationCode":"import platform, os\nif os.name == \"nt\" and platform.machine().lower() not in (\"amd64\", \"x86_64\"):\n    raise SystemExit(\"Windows ARM: run under x64 emulation or install forge via foundryup\")","typeGuard":"def windows_forge_supported() -> bool:\n    import platform, os\n    if os.name != \"nt\":\n        return True\n    return platform.machine().lower() in (\"amd64\", \"x86_64\")","tryCatchPattern":"try:\n    server = SolidityLanguageServer(config, repo_root, settings)\nexcept RuntimeError as e:\n    if \"Windows\" in str(e) and \"npm package\" in str(e):\n        raise SystemExit(\"Install forge via foundryup and configure its path, or use an x64 environment\") from e\n    raise","preventionTips":["On Windows ARM devices, use x64 Python/Node under Windows' built-in emulation.","Prefer WSL2 (x86_64) for Solidity toolchains on ARM hardware.","Document architecture requirements in your project's setup docs."],"tags":["solidity","foundry","windows","arm","platform"],"backgroundTag":"unsupported-architecture","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}