From 3d305118014c9c99c46a562a94d82d9434214ebf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Zander?= <96420681+renezander030@users.noreply.github.com> Date: Mon, 23 Nov 2026 10:03:14 +0000 Subject: [PATCH] Check a macOS runtime's linked libraries only for a macOS archive buildPortable ran otool -L on the runtime for every target on a macOS host, so building the Windows archive's layout there (an official win-x64 node.exe, as the tests do) failed with "The runtime links non-system libraries" and every Windows archive test failed on macOS. The library check now runs only for the host's own archive, as the Linux ldd check already did. Co-Authored-By: Claude Opus 5.5 --- scripts/build-portable.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/build-portable.mjs b/scripts/build-portable.mjs index 063c211..c7dcd2e 100644 --- a/scripts/build-portable.mjs +++ b/scripts/build-portable.mjs @@ -160,7 +160,7 @@ export function buildPortable({ outDir, nodeRoot, root = sourceRoot, target = po if (!/^\d+\.\d+\.\d+$/.test(nodeVersion) || Number(nodeVersion.split(".")[0]) < 18) throw new Error("--node-version must name Node 18 or newer"); runtime = { version: nodeVersion, platform: "win32", arch: "x64" }; } - if (process.platform === "darwin") { + if (process.platform === "darwin" && !windows) { const libraries = run("otool", ["-L", node]).trim().split("\n").slice(1).map((line) => line.trim().split(" (", 1)[0]); if (!libraries.length || libraries.some((library) => !library.startsWith("/usr/lib/") && !library.startsWith("/System/Library/"))) { throw new Error("The runtime links non-system libraries; use the self-contained official Node distribution");