fix: apply chmod at pkg creation time
Fixes
MODIFY
npm/rome/scripts/generate-packages.mjs
npm/rome/scripts/generate-packages.mjs
@@ -44,6 +44,7 @@ function generateNativePackage(platform, arch) {
console.log(`Copy binary ${binaryTarget}`);
fs.copyFileSync(binarySource, binaryTarget);
+ fs.chmodSync(binaryTarget, 0o755);
}
function updateWasmPackage(target) {

MODIFY
npm/rome/scripts/postinstall.js
npm/rome/scripts/postinstall.js
@@ -25,17 +25,6 @@ if (binName) {
`The Rome CLI postinstall script failed to resolve the binary file "${binName}". Running Rome from the npm package will probably not work correctly.`,
);
}
-
- if (binPath) {
- try {
- require("fs").chmodSync(binPath, 0o755);
- } catch {
- console.warn(
- "The Rome CLI postinstall script failed to set execution permissions to the native binary. " +
- "Running Rome from the npm package will probably not work correctly.",
- );
- }
- }
} else {
console.warn(
"The Rome CLI package doesn't ship with prebuilt binaries for your platform yet. " +

fix: apply chmod at pkg creation time (#3800)

Fixes https://github.com/rome/tools/issues/3799