Await PHP binary extraction before starting Electron - #129
Conversation
|
This bites electron-builder copies the PHP binary while it's still being written. The Mach-O signature lives at the end of the file, so a truncated copy is an unsigned one, and Apple Silicon SIGKILLs it. The app launches, the window is blank, nothing is logged. Doesn't look like a packaging bug — looks like your app is broken. Truncated, not corrupt: One gotcha if anyone guards this with a size check: re-signing changes the size in both directions (ours: 68,318,496 → 67,940,352 after a legitimate re-sign), so a size comparison calls a healthy binary damaged. Worth merging. |
What changed
Why
php.jspreviously started the callback-basedyauzlextraction and returned immediately. Because the package script chains it withelectron-vite dev, Electron could start while the PHP binary was still being written or beforechmodcompleted. On Linux this produced partial binaries, permission errors, and intermittent startup failures.Developer impact
NativePHP development startup now continues only after the bundled PHP executable is complete and runnable. Missing or unreadable archives also stop the package script instead of allowing startup to proceed with an invalid runtime.
Validation
npx prettier --check php.jsnpx eslint php.jsnode --check php.jsphp --versionimmediately after the script exited