Repository navigation
Install the bundled PHP atomically to fix Windows first-launch site start failures - #5179
Merged
Merged
Conversation
…cesses can't leave it half-deleted on Windows Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing 55b7230 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related issues
sites.test.ts› preserves an existing MySQL wp-config.php,site-navigation.test.ts› opens site at homepage,sites.test.ts› duplicates a site)How AI was used in this PR
Claude Code read the Windows e2e log, traced every failed attempt to the bundled-PHP migration, and wrote the fix and test. I reviewed the diagnosis and the change.
Proposed Changes
~/.studio/php-bin. On Windows, one copy can hit a locked file. Its error handler then deleted the whole PHP folder, including the files the other process had just copied, and the delete itself threw (ENOTEMPTY/EPERM), so that CLI command failed too.php.exebut most of its extensions gone. The migration only checks whether the folder exists, so it never repaired it, and sites failed to start with "PDO Driver for SQLite is missing". Every failed attempt in the Windows e2e run above shows this sequence. Users on a fresh Windows install can hit the same thing.EBUSYrace on the bundled WordPress copy still shows up in the logs.Testing Instructions
npm test -- apps/cli/migrations/tests/06-install-bundled-default-php.test.ts. The new case fails on trunk, where the copy overwrites a folder another process already installed.ENOTEMPTY ... php-binor "PDO Driver for SQLite is missing" fromcreateSite.~/.studio/php-bin, launch Studio and create a site. It should start.Pre-merge Checklist
🤖 Generated with Claude Code