From b7e3e30ce5d9fa58545f40d13dad366aacd78e82 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Thu, 12 Feb 2026 21:25:11 +0000 Subject: [PATCH] fix(rust-binary-locator): auto-fix missing execute permission for located Rust binaries --- changelog.md | 7 +++++++ ts/00_commitinfo_data.ts | 2 +- ts/classes.rustbinarylocator.ts | 11 ++++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/changelog.md b/changelog.md index aadbc07..16f7f13 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2026-02-12 - 1.2.1 - fix(rust-binary-locator) +auto-fix missing execute permission for located Rust binaries + +- If a located binary exists but lacks the execute bit, attempt to chmod it to 0o755 and treat it as executable. +- Logs an info message when the auto-fix is applied: 'Auto-fixed missing execute permission on: '. +- Addresses cases where npm/pnpm installs remove the execute permission from bundled binaries. + ## 2026-02-11 - 1.2.0 - feat(rustbridge) add streaming responses and robust large-payload/backpressure handling to RustBridge diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 48dcc14..cf246af 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartrust', - version: '1.2.0', + version: '1.2.1', description: 'a bridge between JS engines and rust' } diff --git a/ts/classes.rustbinarylocator.ts b/ts/classes.rustbinarylocator.ts index d7c199c..4cb3ce3 100644 --- a/ts/classes.rustbinarylocator.ts +++ b/ts/classes.rustbinarylocator.ts @@ -124,7 +124,16 @@ export class RustBinaryLocator { await plugins.fs.promises.access(filePath, plugins.fs.constants.X_OK); return true; } catch { - return false; + // File may exist but lack execute bit (common after npm/pnpm install). + // Try to make it executable. + try { + await plugins.fs.promises.access(filePath, plugins.fs.constants.F_OK); + await plugins.fs.promises.chmod(filePath, 0o755); + this.logger.log('info', `Auto-fixed missing execute permission on: ${filePath}`); + return true; + } catch { + return false; + } } }