-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support wp-cli #827
Comments
I just tried running wp-cli via Playground's
I started issue #828 to track this problem. |
Some
The next blocker is #931 and #930. These explorations are highly relevant. |
So cool! Thanks for driving this forward, @adamziel 😊 |
Shims read(2) functionallity by providing an alternative read() function called wasm_read() that gracefully handles blocking pipes. This is neecessary because Emscripten returns EWOULDBLOCK when reading from a blocking pipe, whereas a clang-compiled program would wait until data becomes available. See: * #951 * emscripten-core/emscripten#13214 ## Other changes This PR also ships: * A regexp fix for `@php-wasm/cli` to preserve a trailing whitespace when rewrite PHP-related spawn shell commands. * A fix to correctly propagate the child process exit code back to PHP. The WordPress bootstrap script for PHPUnit needs that to work correctly. ## Motivation ### wp-cli Without this PR, running `wp-cli.phar` doesn't output anything. The output is piped through a pager like `less` using `proc_open` and then displayed by reading from a blocking pipe. With this PR, running `wp-cli.phar` returns its regular help message as the pager pipe can be read: ``` NAME wp DESCRIPTION Manage WordPress through the command-line. SYNOPSIS wp <command> SUBCOMMANDS cache Adds, removes, fetches, and flushes the WP Object Cache object. cap Adds, removes, and lists capabilities of a user role. cli Reviews current WP-CLI info, checks for updates, or views defined aliases. ... ``` ### PHPUnit With this PR, Playground can run PHPunit on `wordpress-develop`! ``` TMPDIR=/tmp PHP=8.2 node --loader ../plugins/playground/packages/nx-extensions/src/executors/built-script/loader.mjs ../plugins/playground/dist/packages/php-wasm/cli/main.js ./vendor/bin/phpunit --no-coverage -v (node:87723) ExperimentalWarning: Custom ESM Loaders is an experimental feature. This feature could change at any time (Use `node --trace-warnings ...` to show where the warning was created) Installing... aaabb int(0) Running as single site... To run multisite, use -c tests/phpunit/multisite.xml Not running ajax tests. To execute these, use --group ajax. Not running ms-files tests. To execute these, use --group ms-files. Not running external-http tests. To execute these, use --group external-http. PHPUnit 9.6.15 by Sebastian Bergmann and contributors. Runtime: PHP 8.2.10-dev Configuration: /Users/cloudnik/www/Automattic/core/wordpress-develop/phpunit.xml.dist Warning: Your XML configuration validates against a deprecated schema. Suggestion: Migrate your XML configuration using "--migrate-configuration"! ........................................................... 59 / 17622 ( 0%) ........................................................... 118 / 17622 ( 0%) ............................FFFFFF......................... 177 / 17622 ( 1%) ........................................................... 236 / 17622 ( 1%) ``` ## Testing instructions Confirm the `proc_open()` tests pass on CI. This PR adjusts a few of them to make sure the output is read without the tricky sleep() call. Related: * #827 * #930 CC @mho22
Wp-cli is now supported!
let’s close this issue and track any bugs and enhancements separately. |
Now that proc_open support is available, let's find a way to support wp-cli.
Related tasks
Done is:
db
andsearch-replace
that @swissspidy mentioned won't work with SQLite yet)The text was updated successfully, but these errors were encountered: