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

make-phar: strip autoloads of phpcs stuff. #4477

Merged
merged 2 commits into from Nov 11, 2017

Conversation

3 participants
@gitlost
Contributor

gitlost commented Nov 2, 2017

Related wp-cli/package-command#44

Strips the phpcs entries "dealerdirect/phpcodesniffer-composer-installer", "wp-coding-standards/wpcs" (squizlabs), and "wimg/php-compatibility" (added in #4339 and #4402) from the autoload*s in utils/make-phar.php.

Only partly addresses wp-cli/package-command#44 in that that issue needs further investigation.

@gitlost gitlost requested a review from wp-cli/committers Nov 2, 2017

@danielbachhuber danielbachhuber requested a review from schlessera Nov 2, 2017

@danielbachhuber danielbachhuber added this to the 1.5.0 milestone Nov 5, 2017

@danielbachhuber danielbachhuber added the bug label Nov 5, 2017

@schlessera schlessera merged commit 1c298a8 into master Nov 11, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@schlessera schlessera deleted the make-phar_phpcs_autoload_strip branch Nov 11, 2017

@danielbachhuber

This comment has been minimized.

Show comment
Hide comment
@danielbachhuber

danielbachhuber Nov 13, 2017

Member

@gitlost This seems to have fixed wp-cli/package-command#44 for me. Is that not the case for you?

Member

danielbachhuber commented Nov 13, 2017

@gitlost This seems to have fixed wp-cli/package-command#44 for me. Is that not the case for you?

@gitlost

This comment has been minimized.

Show comment
Hide comment
@gitlost

gitlost Nov 13, 2017

Contributor

I couldn't reproduce it locally wp-cli/package-command#44 (comment), except by doing

composer global require -dev dealerdirect/phpcodesniffer-composer-installer

which was why I was hesitant. Is/was there a global require in your ~/.composer/composer.json?

Contributor

gitlost commented Nov 13, 2017

I couldn't reproduce it locally wp-cli/package-command#44 (comment), except by doing

composer global require -dev dealerdirect/phpcodesniffer-composer-installer

which was why I was hesitant. Is/was there a global require in your ~/.composer/composer.json?

@danielbachhuber

This comment has been minimized.

Show comment
Hide comment
@danielbachhuber

danielbachhuber Nov 13, 2017

Member

Is/was there a global require in your ~/.composer/composer.json?

Nope. Here's the reproduction steps from one of my webservers:

web590.webfaction.com ➜  ~  wp cli update --stable --yes
Downloading from https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar...
md5 hash verified: 179fc8dacbfe3ebc2d00ba57a333c982
New version works. Proceeding to replace.
Success: Updated WP-CLI to the latest stable release.
web590.webfaction.com ➜  ~  alias wp="php70 -d memory_limit=512M $HOME/bin/wp"
web590.webfaction.com ➜  ~  wp package list

Warning: include(phar:///home/handbuiltco/bin/wp/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php): failed to open stream: phar error: "vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php" is not a file in phar "/home/handbuiltco/bin/wp" in phar:///home/handbuiltco/bin/wp/vendor/composer/ClassLoader.php on line 444

Warning: include(): Failed opening 'phar:///home/handbuiltco/bin/wp/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php' for inclusion (include_path='phar:///home/handbuiltco/bin/wp/vendor/phpunit/php-token-stream:phar:///home/handbuiltco/bin/wp/vendor/phpunit/phpunit-mock-objects:phar:///home/handbuiltco/bin/wp/vendor/phpunit/php-code-coverage:phar:///home/handbuiltco/bin/wp/vendor/phpunit/phpunit:phar:///home/handbuiltco/bin/wp/vendor/symfony/yaml:.:/usr/local/share/pear70') in phar:///home/handbuiltco/bin/wp/vendor/composer/ClassLoader.php on line 444
+------------------------------------+------------------+------------+--------+----------------+
| name                               | authors          | version    | update | update_version |
+------------------------------------+------------------+------------+--------+----------------+
| danielbachhuber/php-compat-command |                  | dev-master | none   |                |
| wp-cli/dist-archive-command        | Daniel Bachhuber | dev-master | none   |                |
| wp-cli/find-command                |                  | dev-master | none   |                |
| wp-cli/scaffold-package-command    | Daniel Bachhuber | dev-master | none   |                |
+------------------------------------+------------------+------------+--------+----------------+
web590.webfaction.com ➜  ~  wp cli update --nightly --yes
Downloading from https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar...
md5 hash verified: 4409ec14f8c5e729738eef5efa10dd92
New version works. Proceeding to replace.
Success: Updated WP-CLI to the latest nightly release.
web590.webfaction.com ➜  ~  wp package list
+------------------------------------+------------------+------------+--------+----------------+
| name                               | authors          | version    | update | update_version |
+------------------------------------+------------------+------------+--------+----------------+
| danielbachhuber/php-compat-command |                  | dev-master | none   |                |
| wp-cli/dist-archive-command        | Daniel Bachhuber | dev-master | none   |                |
| wp-cli/find-command                |                  | dev-master | none   |                |
| wp-cli/scaffold-package-command    | Daniel Bachhuber | dev-master | none   |                |
+------------------------------------+------------------+------------+--------+----------------+

So, it seems to be fixed now in the nightly build.

Member

danielbachhuber commented Nov 13, 2017

Is/was there a global require in your ~/.composer/composer.json?

Nope. Here's the reproduction steps from one of my webservers:

web590.webfaction.com ➜  ~  wp cli update --stable --yes
Downloading from https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar...
md5 hash verified: 179fc8dacbfe3ebc2d00ba57a333c982
New version works. Proceeding to replace.
Success: Updated WP-CLI to the latest stable release.
web590.webfaction.com ➜  ~  alias wp="php70 -d memory_limit=512M $HOME/bin/wp"
web590.webfaction.com ➜  ~  wp package list

Warning: include(phar:///home/handbuiltco/bin/wp/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php): failed to open stream: phar error: "vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php" is not a file in phar "/home/handbuiltco/bin/wp" in phar:///home/handbuiltco/bin/wp/vendor/composer/ClassLoader.php on line 444

Warning: include(): Failed opening 'phar:///home/handbuiltco/bin/wp/vendor/dealerdirect/phpcodesniffer-composer-installer/src/Plugin.php' for inclusion (include_path='phar:///home/handbuiltco/bin/wp/vendor/phpunit/php-token-stream:phar:///home/handbuiltco/bin/wp/vendor/phpunit/phpunit-mock-objects:phar:///home/handbuiltco/bin/wp/vendor/phpunit/php-code-coverage:phar:///home/handbuiltco/bin/wp/vendor/phpunit/phpunit:phar:///home/handbuiltco/bin/wp/vendor/symfony/yaml:.:/usr/local/share/pear70') in phar:///home/handbuiltco/bin/wp/vendor/composer/ClassLoader.php on line 444
+------------------------------------+------------------+------------+--------+----------------+
| name                               | authors          | version    | update | update_version |
+------------------------------------+------------------+------------+--------+----------------+
| danielbachhuber/php-compat-command |                  | dev-master | none   |                |
| wp-cli/dist-archive-command        | Daniel Bachhuber | dev-master | none   |                |
| wp-cli/find-command                |                  | dev-master | none   |                |
| wp-cli/scaffold-package-command    | Daniel Bachhuber | dev-master | none   |                |
+------------------------------------+------------------+------------+--------+----------------+
web590.webfaction.com ➜  ~  wp cli update --nightly --yes
Downloading from https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli-nightly.phar...
md5 hash verified: 4409ec14f8c5e729738eef5efa10dd92
New version works. Proceeding to replace.
Success: Updated WP-CLI to the latest nightly release.
web590.webfaction.com ➜  ~  wp package list
+------------------------------------+------------------+------------+--------+----------------+
| name                               | authors          | version    | update | update_version |
+------------------------------------+------------------+------------+--------+----------------+
| danielbachhuber/php-compat-command |                  | dev-master | none   |                |
| wp-cli/dist-archive-command        | Daniel Bachhuber | dev-master | none   |                |
| wp-cli/find-command                |                  | dev-master | none   |                |
| wp-cli/scaffold-package-command    | Daniel Bachhuber | dev-master | none   |                |
+------------------------------------+------------------+------------+--------+----------------+

So, it seems to be fixed now in the nightly build.

@schlessera

This comment has been minimized.

Show comment
Hide comment
@schlessera

schlessera Nov 13, 2017

Member

I can confirm, the issue is fixed for me as well on nightly.

Member

schlessera commented Nov 13, 2017

I can confirm, the issue is fixed for me as well on nightly.

@gitlost

This comment has been minimized.

Show comment
Hide comment
@gitlost

gitlost Nov 13, 2017

Contributor

Okay, I'm just puzzled what's triggering the lookup. It'd be nice to nail it.

Contributor

gitlost commented Nov 13, 2017

Okay, I'm just puzzled what's triggering the lookup. It'd be nice to nail it.

@danielbachhuber

This comment has been minimized.

Show comment
Hide comment
@danielbachhuber

danielbachhuber Nov 13, 2017

Member

@gitlost Dealerdirect\Composer\Plugin is a Composer plugin, no? Wouldn't this mean it's always loaded when Composer is loaded?

Member

danielbachhuber commented Nov 13, 2017

@gitlost Dealerdirect\Composer\Plugin is a Composer plugin, no? Wouldn't this mean it's always loaded when Composer is loaded?

@gitlost

This comment has been minimized.

Show comment
Hide comment
@gitlost

gitlost Nov 13, 2017

Contributor

Okay it must be in your ~/.wp-cli/packages/vendor/composer/installed.json for some reason (as it's not in ~/.composer/composer.json and wouldn't be in ~/.wp-cli/packages/composer.json) - I think.

(A topical little twist in light of wp-cli/package-command#43 is that the git hub user is the mixed-case DealerDirect...)

Contributor

gitlost commented Nov 13, 2017

Okay it must be in your ~/.wp-cli/packages/vendor/composer/installed.json for some reason (as it's not in ~/.composer/composer.json and wouldn't be in ~/.wp-cli/packages/composer.json) - I think.

(A topical little twist in light of wp-cli/package-command#43 is that the git hub user is the mixed-case DealerDirect...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment