Skip to content

Await PHP binary extraction before starting Electron#129

Open
SRWieZ wants to merge 1 commit into
NativePHP:mainfrom
SRWieZ:agent/await-php-binary-extraction
Open

Await PHP binary extraction before starting Electron#129
SRWieZ wants to merge 1 commit into
NativePHP:mainfrom
SRWieZ:agent/await-php-binary-extraction

Conversation

@SRWieZ

@SRWieZ SRWieZ commented Jul 18, 2026

Copy link
Copy Markdown
Member

What changed

  • wait for the bundled PHP archive to finish extracting before the Electron development process continues
  • wait for executable permissions to be applied to the extracted PHP binary
  • propagate extraction failures through a non-zero process exit code

Why

php.js previously started the callback-based yauzl extraction and returned immediately. Because the package script chains it with electron-vite dev, Electron could start while the PHP binary was still being written or before chmod completed. 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.js
  • npx eslint php.js
  • node --check php.js
  • extracted DevKeepr's real 65 MB Linux PHP 8.4 archive and executed php --version immediately after the script exited
  • verified a missing archive returns exit code 1

@SRWieZ
SRWieZ marked this pull request as ready for review July 18, 2026 20:19
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.

1 participant