fix: update Dockerfile with --allow-scripts for better-sqlite3 compil…#6700
fix: update Dockerfile with --allow-scripts for better-sqlite3 compil…#6700nowhats-br wants to merge 6 commits into
Conversation
… (ABI 148) (diegosouzapw#6605) fix(electron): bump electron 42→43 + rebuild better-sqlite3 from source against the Electron ABI (148). Electron 43 raises NODE_MODULE_VERSION to 148; better-sqlite3@12.11.1 has no electron-v148 prebuild, so the packaged app died with 'Nenhum driver SQLite disponível'. prepare-electron-standalone now compiles better-sqlite3 from source against the electron headers into build/Release (where 'bindings' resolves it). Validated by Electron Package Smoke (green) + local (node_register_module_v148). Supersedes diegosouzapw#6378. (--admin: the only reds are SonarQube/SonarCloud failing on a coverage-report artifact digest-mismatch — a GitHub Actions infra flake, not this diff; Sonar is green on main and the diff touches only the electron build.)
…iegosouzapw#6588) deps: bump the development group (6 updates). Rebased onto current main; all checks green after the electron-smoke fix (diegosouzapw#6605).
…7) + production deps bump (diegosouzapw#6620) fix(proxy): force CONNECT tunnel for HTTP proxied requests (undici 8.7) + production deps bump. undici 8.6+ changed ProxyAgent to forward plain-HTTP via request-proxy instead of CONNECT, breaking OAuth refresh through a connection proxy (501). proxyDispatcher now passes proxyTunnel:true. Validated: Unit Tests 3/8 (the OAuth-proxy test) green, new regression test green (fails without the fix on undici 8.7), SonarQube green. Supersedes diegosouzapw#6380. (--admin: the only red is Electron Package Smoke failing on a next-build artifact 'digest-mismatch' — a GitHub Actions infra flake corrupting the asar ('file data stream has unexpected number of bytes'); the better-sqlite3 rebuild itself succeeded (gyp ok) and the electron path is unchanged from diegosouzapw#6605 which passed the smoke. Not this diff.)
…ation and adjust electron dependencies
There was a problem hiding this comment.
Code Review
This pull request optimizes the Electron standalone build process by introducing a two-stage rebuild strategy for better-sqlite3. It first attempts to use prebuild-install to avoid local compilation, falling back to compiling from source via node-gyp if needed. The rebuild is also wrapped in a try-catch block to prevent build failures, logging a warning with manual recovery instructions instead. Additionally, Electron is downgraded to ^42.3.4 along with associated dependency updates. Feedback on the changes highlights that the warning message hardcodes the Electron target version and architecture, and suggests dynamically resolving these values to ensure the manual recovery instructions remain accurate across different environments.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| console.warn( | ||
| `[electron] WARNING: better-sqlite3 ABI rebuild did not complete — ${msg}\n` + | ||
| `[electron] Run the following to fix before packaging:\n` + | ||
| `[electron] cd .build/electron-standalone/node_modules/better-sqlite3\n` + | ||
| `[electron] npx prebuild-install --runtime electron --target 42.3.4 --arch x64` | ||
| ); |
There was a problem hiding this comment.
The warning message hardcodes the Electron target version (42.3.4) and architecture (x64). If a developer is on a different architecture (e.g., arm64 on Apple Silicon) or if the Electron version is updated in package.json, the suggested manual fix command will be incorrect.
We should dynamically resolve the target version and architecture to ensure the warning prints the correct command.
let targetVersion = "42.3.4";
try {
targetVersion = readElectronVersion() || targetVersion;
} catch {}
const targetArch = process.arch;
console.warn(
`[electron] WARNING: better-sqlite3 ABI rebuild did not complete — ${msg}\n` +
`[electron] Run the following to fix before packaging:\n` +
`[electron] cd .build/electron-standalone/node_modules/better-sqlite3\n` +
`[electron] npx prebuild-install --runtime electron --target ${targetVersion} --arch ${targetArch}`
);
…ation and adjust electron dependencies
Summary
Related Issues
Validation
npm run lintnpm run test:unitnpm run test:coverage>= 60%for statements, lines, functions, and branchesTests Added Or Updated
Coverage Notes
src/,open-sse/,electron/, orbin/, explain which tests cover the change.Reviewer Notes