Try package downgrade

This commit is contained in:
Sander Declerck 2025-11-28 15:53:38 +01:00
parent ae9bc8a75d
commit 35ab58c440
No known key found for this signature in database
3 changed files with 11 additions and 28 deletions

View file

@ -35,25 +35,8 @@ async function bundleSafeChain() {
external: ["certifi"], external: ["certifi"],
}); });
// Post-process: Force node-forge to use pure JavaScript
// This prevents segmentation faults in pkg binaries on Linux
let bundledContent = await readFile("./build/bin/safe-chain.cjs", "utf-8"); let bundledContent = await readFile("./build/bin/safe-chain.cjs", "utf-8");
// 1. Set the option to true
bundledContent = bundledContent.replace(
/usePureJavaScript:\s*false/g,
"usePureJavaScript: true"
);
// 2. Replace all checks that would enable native crypto
// Change: if (!forge2.options.usePureJavaScript && ...)
// To: if (false && ...)
// This makes the native crypto branches unreachable
bundledContent = bundledContent.replace(
/!forge2\.options\.usePureJavaScript/g,
"false"
);
await writeFile("./build/bin/safe-chain.cjs", bundledContent); await writeFile("./build/bin/safe-chain.cjs", bundledContent);
} }

20
package-lock.json generated
View file

@ -1402,15 +1402,6 @@
"node": ">= 0.6" "node": ">= 0.6"
} }
}, },
"node_modules/node-forge": {
"version": "1.3.2",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.2.tgz",
"integrity": "sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw==",
"license": "(BSD-3-Clause OR GPL-2.0)",
"engines": {
"node": ">= 6.13.0"
}
},
"node_modules/node-pty": { "node_modules/node-pty": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.0.0.tgz", "resolved": "https://registry.npmjs.org/node-pty/-/node-pty-1.0.0.tgz",
@ -1685,7 +1676,7 @@
"https-proxy-agent": "7.0.6", "https-proxy-agent": "7.0.6",
"ini": "6.0.0", "ini": "6.0.0",
"make-fetch-happen": "15.0.3", "make-fetch-happen": "15.0.3",
"node-forge": "1.3.2", "node-forge": "1.3.1",
"npm-registry-fetch": "19.1.1", "npm-registry-fetch": "19.1.1",
"semver": "7.7.2" "semver": "7.7.2"
}, },
@ -1724,6 +1715,15 @@
"undici-types": "~5.26.4" "undici-types": "~5.26.4"
} }
}, },
"packages/safe-chain/node_modules/node-forge": {
"version": "1.3.1",
"resolved": "https://registry.npmjs.org/node-forge/-/node-forge-1.3.1.tgz",
"integrity": "sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==",
"license": "(BSD-3-Clause OR GPL-2.0)",
"engines": {
"node": ">= 6.13.0"
}
},
"packages/safe-chain/node_modules/undici-types": { "packages/safe-chain/node_modules/undici-types": {
"version": "5.26.5", "version": "5.26.5",
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz",

View file

@ -41,7 +41,7 @@
"https-proxy-agent": "7.0.6", "https-proxy-agent": "7.0.6",
"ini": "6.0.0", "ini": "6.0.0",
"make-fetch-happen": "15.0.3", "make-fetch-happen": "15.0.3",
"node-forge": "1.3.2", "node-forge": "1.3.1",
"npm-registry-fetch": "19.1.1", "npm-registry-fetch": "19.1.1",
"semver": "7.7.2" "semver": "7.7.2"
}, },