Skip to content

fix: install WP-CLI nightly so core download works with WordPress 7 - #42

Open
ma-04 wants to merge 1 commit into
flywp:mainfrom
ma-04:feat/wp-cli-nightly
Open

ma-04 wants to merge 1 commit into
flywp:mainfrom
ma-04:feat/wp-cli-nightly

Conversation

@ma-04

@ma-04 ma-04 commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

@jamil-mahmud

Why

WP-CLI 2.12.0 (latest stable) breaks wp core download on WordPress 7: it truncates long file paths on extract (wp-cli/wp-cli#6320, #6396). The fix (wp-cli/wp-cli#6319) was merged on 2026-05-25 but is only in nightly builds. The last stable release was 2025-05-07, and the 3.0.0 milestone has no due date. The maintainers call nightly "a legit workaround".

What

  • Both images download wp-cli-nightly.phar (now 3.0.0-alpha).
  • New php/wp-cli-packages.json replaces composer init (and the mkdir, since COPY creates the folder). Its replace block tells Composer that the phar already provides WP-CLI core and the bundled commands. Without it, doctor installs a second, older copy of WP-CLI core into the packages folder. That copy overrides the phar's classes, and with the nightly every wp command fatals (Cannot declare interface Mustache_Loader).
  • doctor-command:@stable becomes ^3. @stable picked v2.3.1, which needs the 2.x core, and that is how the old core got in. ^3 matches the 3.0 nightly, and the build fails instead of falling back to 2.x.

Switch back to wp-cli.phar once a fixed stable ships.

Testing (arm64)

  • PHP 7.4, 8.0 and 8.5 WP-CLI stage as www-data: only doctor v3.0.0 vendored, wp doctor list shows 16 checks.
  • In meghsh/php:8.3, wp core download --version=7.0.4: fails on 2.12.0; passes verify-checksums on nightly.
  • Full OLS 8.4 build: builds, and 7.0.4 passes verify-checksums.
  • Not tested: full PHP image build, amd64.

🤖 Generated with Claude Code

WP-CLI 2.12.0 (latest stable) cannot extract WordPress 7.0.x archives
(wp-cli/wp-cli#6320, #6396); the fix is only in nightly builds so far.
Both the PHP and OpenLiteSpeed images now download wp-cli-nightly.phar.

The doctor package was installed with @stable, which resolved to v2.3.1
and vendored the 2.x framework, core-command and legacy mustache into the
packages dir. With the 3.0 nightly that fatals on every command. The
packages dir now uses a composer.json that replaces the framework and
bundled commands, so only doctor-command v3 is vendored and the phar's
classes are used.

Move back to wp-cli.phar once a fixed stable release ships.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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