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
Are composer global packages installed correctly? #7289
Comments
Any luck with this? Trying the same thing with global install |
Do you have a build log URL that shows the problem you are describing here? |
At first I the install had
After researching a bit more I changed the install bit to
Which ended up working fine. |
Do you have a build log URL that we can take a look at, so that we can determine if there is anything for us to fix? |
The log is on the .com version of travis. But if you got admin access: build id is 42453136, install on line 398, error on line 453 the commands are as mentioned in my previous post |
@MarkVaughn Thanks for the info. Your log indicates:
which is different from what @natanmoraes wrote originally. In addition, it is not clear from your log how you are invoking I also see that the build 2759 on the same PR fixed the issue. How was it fixed? |
As mentioned in my previous post, this is the command: But i fixed it by switching to
Essentially ditching global composer for pear. When doing global composer installs the executables would be located in |
Thanks for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please do feel free to either reopen this issue or open a new one. We'll gladly take a look again! You can read more here: https://blog.travis-ci.com/2018-03-09-closing-old-issues |
Hi team, I've just noticed this happening on some of our builds as well (switching from |
Having the same issue. Any global composer installation results in
|
The output of
If the Travis PHP images have changed distro recently then that would explain the change |
@robbieaverill I'm used to |
|
@robbieaverill Use Example on my vagrant box:
|
Ah I see, I had to make it verbose to get output. So this could be a decent replacement for running global binaries via the composer global install path (which is variable) |
Due to an unknown change in Travis environment, WooCommerce unit tests stopped working with the following error (see for example https://travis-ci.org/woocommerce/woocommerce/jobs/463470674#L876): Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test) in /tmp/wordpress-tests-lib/includes/phpunit6-compat.php on line 18 This error is happening because Travis started ignoring the PHPUnit version that we install manually via Composer (https://github.com/woocommerce/woocommerce/blob/f7bc3fb85195df8f96c70d2846b0104ee224fef2/tests/bin/travis.sh#L6) and started using the PHPUnit version that is shipped with each of its PHP docker images. This means that for the docker images running PHP 7.2 and 7.3, PHPUnit 7 is used but the WordPress unit test framework is not compatible with PHPUnit 7 (see WordPress core ticket https://core.trac.wordpress.org/ticket/43218) and produces the error above. I believe that this is happening because Travis changed the directory where it installs composer global packages from `$HOME/.composer/` to `$HOME/.config/composer/` (travis-ci/travis-ci#7289 (comment)) and we add `$HOME/.composer/vendor/bin:$PATH` to the `$PATH`. To fix this, instead of changing the directory that we add to the `$PATH`, I'm using `composer exec`. This way we don't have to worry if the composer directory changes again in the future.
Due to an unknown change in Travis environment, WooCommerce unit tests stopped working with the following error (see for example https://travis-ci.org/woocommerce/woocommerce/jobs/463470674#L876): Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test) in /tmp/wordpress-tests-lib/includes/phpunit6-compat.php on line 18 This error is happening because Travis started ignoring the PHPUnit version that we install manually via Composer (https://github.com/woocommerce/woocommerce/blob/f7bc3fb85195df8f96c70d2846b0104ee224fef2/tests/bin/travis.sh#L6) and started using the PHPUnit version that is shipped with each of its PHP docker images. This means that for the docker images running PHP 7.2 and 7.3, PHPUnit 7 is used but the WordPress unit test framework is not compatible with PHPUnit 7 (see WordPress core ticket https://core.trac.wordpress.org/ticket/43218) and produces the error above. I believe that this is happening because Travis changed the directory where it installs composer global packages from `$HOME/.composer/` to `$HOME/.config/composer/` (travis-ci/travis-ci#7289 (comment)) and we add `$HOME/.composer/vendor/bin:$PATH` to the `$PATH`. To fix this, instead of changing the directory that we add to the `$PATH`, I'm using `composer exec`. This way we don't have to worry if the composer directory changes again in the future.
Due to a recent change in the Travis environment, WooCommerce unit tests stopped working with the following error (see for example https://travis-ci.org/woocommerce/woocommerce/jobs/463470674#L876) in the PHP 7.2 and 7.3 build jobs: Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test) in /tmp/wordpress-tests-lib/includes/phpunit6-compat.php on line 18 This error is happening because Travis started ignoring the PHPUnit version that we install manually via Composer (https://github.com/woocommerce/woocommerce/blob/f7bc3fb85195df8f96c70d2846b0104ee224fef2/tests/bin/travis.sh#L6) and started using the PHPUnit version that is shipped with each of its PHP docker images. This means that for the docker images running PHP 7.2 and 7.3, PHPUnit 7 is used but the WordPress unit test framework is not compatible with PHPUnit 7 (see WordPress core ticket https://core.trac.wordpress.org/ticket/43218) and produces the error above. I believe that this is happening because Travis changed the directory where it installs composer global packages from `$HOME/.composer/` to `$HOME/.config/composer/` (travis-ci/travis-ci#7289 (comment)) and we add `$HOME/.composer/vendor/bin:$PATH` to the `$PATH`. So this commit simply updates the path in the line where we add it to the `$PATH`. I tried to use `composer exec` instead of updating `$PATH` but that didn't work for PHP 5.2.
Due to a recent change in the Travis environment, WooCommerce unit tests stopped working with the following error (see for example https://travis-ci.org/woocommerce/woocommerce/jobs/463470674#L876) in the PHP 7.2 and 7.3 build jobs: Fatal error: Class PHPUnit_Util_Test may not inherit from final class (PHPUnit\Util\Test) in /tmp/wordpress-tests-lib/includes/phpunit6-compat.php on line 18 This error is happening because Travis started ignoring the PHPUnit version that we install manually via Composer (https://github.com/woocommerce/woocommerce/blob/f7bc3fb85195df8f96c70d2846b0104ee224fef2/tests/bin/travis.sh#L6) and started using the PHPUnit version that is shipped with each of its PHP docker images. This means that for the docker images running PHP 7.2 and 7.3, PHPUnit 7 is used but the WordPress unit test framework is not compatible with PHPUnit 7 (see WordPress core ticket https://core.trac.wordpress.org/ticket/43218) and produces the error above. I believe that this is happening because Travis changed the directory where it installs composer global packages from `$HOME/.composer/` to `$HOME/.config/composer/` (travis-ci/travis-ci#7289 (comment)) and we add `$HOME/.composer/vendor/bin:$PATH` to the `$PATH`. So this commit simply updates the path in the line where we add it to the `$PATH`. I tried to use `composer exec` instead of updating `$PATH` but that didn't work for PHP 5.2.
Due to a recent change in the Travis build environment, the path to Composer's global bin directory has changed. The suggested fix is to use 'composer exec' instead of relying on the hardcoded path. See: travis-ci/travis-ci#7289
This worked for me: |
In the migrated build environment global composer installs go to ~/.config/composer instead of ~/.composer travis-ci/travis-ci#7289
travis-ci now installs global composer packages to ~/.config/composer See travis-ci/travis-ci#7289
When I run
composer global require drupal/coder
, the vendor files are installed in~/.config/composer
.See build screenshot:
I was expecting they would be installed under
~/.composer
.Is this by design?
My .travis.yml file:
The text was updated successfully, but these errors were encountered: