{"record":{"id":"a864727583a2a632","repo":"nodejs/node","slug":"unable-to-locate-armasm64-exe","errorCode":null,"errorMessage":"Unable to locate armasm64.exe","messagePattern":"Unable to locate armasm64\\.exe","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"deps/libffi/preprocess_asm.py","lineNumber":53,"sourceCode":"\ndef find_armasm64():\n    \"\"\"Find armasm64.exe in the PATH or common Visual Studio locations.\"\"\"\n    # First check PATH\n    path = shutil.which('armasm64.exe')\n    if path:\n        return path\n\n    # Check common VS locations via environment\n    vc_install_dir = os.environ.get('VCINSTALLDIR', '')\n    if vc_install_dir:\n        candidate = os.path.join(vc_install_dir, 'bin', 'Hostx64', 'arm64', 'armasm64.exe')\n        if os.path.exists(candidate):\n            return candidate\n        candidate = os.path.join(vc_install_dir, 'bin', 'Hostarm64', 'arm64', 'armasm64.exe')\n        if os.path.exists(candidate):\n            return candidate\n\n    raise RuntimeError('Unable to locate armasm64.exe')\n\n\ndef normalize_path(value):\n    return str(value).strip().strip('\"')\n\n\ndef unique_paths(paths):\n    seen = set()\n    result = []\n    for path in paths:\n        if path in seen:\n            continue\n        seen.add(path)\n        result.append(path)\n    return result\n\n\ndef preprocess(args):","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/libffi/preprocess_asm.py#L35-L71","documentation":"On Windows ARM64, libffi assembly must be assembled with Microsoft's armasm64.exe because the .S files use ARM syntax clang-cl can't fully assemble. find_armasm64() checks PATH then VCINSTALLDIR\\bin\\Hostx64\\arm64 and Hostarm64\\arm64; if none of those exist it raises RuntimeError, so the script fails before producing a broken object.","triggerScenarios":"Raised by find_armasm64() when args.assemble is set, shutil.which('armasm64.exe') returns None, and no armasm64.exe exists under the VCINSTALLDIR candidates. Only reached on the ARM64-Windows assembly path.","commonSituations":"Building for ARM64 Windows without the 'Desktop development with C++' > ARM64 build tools component installed; CI image with only the x64 toolchain; VCINSTALLDIR set but pointing at a VS install that lacks the ARM64 workload.","solutions":["Install the MSVC ARM64 build tools (VS Installer > Individual components > MSVC v143 - VS 2022 C++ ARM64 build tools).","Open the build from a Developer Command Prompt so PATH and VCINSTALLDIR are populated.","Drop --assemble if you only need the preprocessed text and will assemble elsewhere."],"exampleFix":"# before: arm64 toolchain missing\npython preprocess_asm.py --input sysv.S --output out.s --assemble out.obj\n# after: install MSVC ARM64 tools, then\npython preprocess_asm.py --input sysv.S --output out.s --assemble out.obj","handlingStrategy":"validation","validationCode":"import os, shutil\nfrom pathlib import Path\ndef have_armasm64():\n    if shutil.which('armasm64.exe'): return True\n    vc = os.environ.get('VCINSTALLDIR','')\n    return bool(vc) and (Path(vc)/'bin'/'Hostx64'/'arm64'/'armasm64.exe').exists()\nassert have_armasm64(), 'install MSVC ARM64 build tools or run from a Developer Command Prompt'","typeGuard":null,"tryCatchPattern":"try:\n    armasm = find_armasm64()\nexcept RuntimeError:\n    raise SystemExit('ARM64 assembly needs armasm64.exe from the MSVC ARM64 workload')","preventionTips":["Install the MSVC ARM64 build-tools component on any Windows ARM64 build agent.","Run builds from a Developer Command Prompt so VCINSTALLDIR and PATH are set."],"tags":["libffi","build","ffi","windows","arm64","toolchain","msvc"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}