Skip to content

fix: update Dockerfile with --allow-scripts for better-sqlite3 compil…#6700

Open
nowhats-br wants to merge 6 commits into
diegosouzapw:release/v3.8.47from
nowhats-br:fix/dokploy-build-allow-scripts
Open

fix: update Dockerfile with --allow-scripts for better-sqlite3 compil…#6700
nowhats-br wants to merge 6 commits into
diegosouzapw:release/v3.8.47from
nowhats-br:fix/dokploy-build-allow-scripts

Conversation

@nowhats-br

Copy link
Copy Markdown

…ation and adjust electron dependencies

Summary

  • Describe the user-facing or operational change.

Related Issues

  • Closes #
  • Related to #

Validation

  • npm run lint
  • npm run test:unit
  • npm run test:coverage
  • Coverage is still >= 60% for statements, lines, functions, and branches
  • SonarQube PR analysis is green or any remaining issues are explicitly documented below

Tests Added Or Updated

  • List every changed or added automated test file.
  • If no production code changed, state that here.

Coverage Notes

  • If this PR changes src/, open-sse/, electron/, or bin/, explain which tests cover the change.
  • If coverage moved down in any touched file, explain why and what follow-up task will recover it.

Reviewer Notes

  • Call out any risky areas, migrations, feature flags, or manual validation that reviewers should know about.

diegosouzapw and others added 4 commits July 7, 2026 23:10
… (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.)
@nowhats-br nowhats-br requested a review from diegosouzapw as a code owner July 9, 2026 00:42

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines +223 to +228
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`
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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}`
  );

@diegosouzapw diegosouzapw changed the base branch from main to release/v3.8.47 July 9, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants