Skip to content
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

Error with PHP 8.0-dev and Composer 2.0.0 #9331

Closed
sebastianbergmann opened this issue Oct 24, 2020 · 16 comments
Closed

Error with PHP 8.0-dev and Composer 2.0.0 #9331

sebastianbergmann opened this issue Oct 24, 2020 · 16 comments
Labels
Milestone

Comments

@sebastianbergmann
Copy link

Running Composer 2.0.0 with PHP 8.0-dev results in:

$ ./tools/composer update --no-ansi --no-interaction --no-progress
PHP Warning:  require_once(phar:///home/runner/work/exporter/exporter/tools/composer/vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8): Failed to open stream: phar error: "vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8" is not a file in phar "/home/runner/work/exporter/exporter/tools/composer" in phar:///home/runner/work/exporter/exporter/tools/composer/vendor/symfony/polyfill-mbstring/bootstrap.php on line 115
PHP Fatal error:  Uncaught Error: Failed opening required 'phar:///home/runner/work/exporter/exporter/tools/composer/vendor/symfony/polyfill-mbstring/Resources/mb_convert_variables.php8' (include_path='.:/usr/local/php/8.0/share/pear') in phar:///home/runner/work/exporter/exporter/tools/composer/vendor/symfony/polyfill-mbstring/bootstrap.php:115
Stack trace:
#0 phar:///home/runner/work/exporter/exporter/tools/composer/vendor/composer/autoload_real.php(69): require()
#1 phar:///home/runner/work/exporter/exporter/tools/composer/vendor/composer/autoload_real.php(59): composerRequireComposerPhar1603530979()
#2 phar:///home/runner/work/exporter/exporter/tools/composer/vendor/autoload.php(7): ComposerAutoloaderInitComposerPhar1603530979::getLoader()
#3 phar:///home/runner/work/exporter/exporter/tools/composer/src/bootstrap.php(15): include('...')
#4 phar:///home/runner/work/exporter/exporter/tools/composer/src/bootstrap.php(18): includeIfExists()
#5 phar:///home/runner/work/exporter/exporter/tools/composer/bin/composer(8): require('...')
#6 /home/runner/work/exporter/exporter/tools/composer(24): require('...')
#7 {main}
  thrown in phar:///home/runner/work/exporter/exporter/tools/composer/vendor/symfony/polyfill-mbstring/bootstrap.php on line 115
@beberlei
Copy link
Contributor

@Seldaek
Copy link
Member

Seldaek commented Oct 24, 2020

.php8 😱 I thought we stopped doing this since php4 or something.

I also see that this is only a problem in symfony/polyfill-mbstring 1.19.0 to which I upgraded just before the release... Obviously this "inconsequential" update had to mess things up.

@nicolas-grekas any clue when the next release is planned? Or should I rather switch to dev-main?

@nicolas-grekas
Copy link
Contributor

To make a release, we'd need to do a change before :)
What would be the change about? Why is this file not in the phar?

@Seldaek
Copy link
Member

Seldaek commented Oct 24, 2020

The file is not in the phar because we only include .php files, because the rest is supposedly useless. And symfony/polyfill-mbstring@39d483b already got rid of that file, that's why I ask :)

@Seldaek Seldaek added this to the 2.0 milestone Oct 24, 2020
@Seldaek Seldaek added the Bug label Oct 24, 2020
@sebastianbergmann
Copy link
Author

I learned a similar lesson not too long ago ;) Since then, we do not only run the regular tests for PHPUnit but also build the PHAR and run additional tests to ensure that it works.

@nicolas-grekas
Copy link
Contributor

nicolas-grekas commented Oct 24, 2020

But that commit also bumped the minimum version of PHP to 7.1, and I suppose you want your phar to run on php 5.3?
Better build a new phar imho...

@Seldaek
Copy link
Member

Seldaek commented Oct 24, 2020

@nicolas-grekas Right, ok yeah will fix this on our end then.. Thanks.

@sebastianbergmann we actually do build a phar and run an install from it as part of CI AFAIK, but I guess we do have mbstring enabled and you don't or some such bad luck event..

@Seldaek
Copy link
Member

Seldaek commented Oct 24, 2020

Composer snapshot should now be fixed.. I gotta go for a while, can do a release later today.

@shivammathur
Copy link

I have patched phars setup-php uses. So please re-run your workflows if you got this error.

@ondrejmirtes
Copy link
Contributor

Thanks to everyone involved, you're awesome 👍 :)

@Seldaek
Copy link
Member

Seldaek commented Oct 24, 2020

@shivammathur that's awesome, then I don't have to do a release so soon, I doubt anyone uses php8 much outside CI..

@GrahamCampbell
Copy link
Contributor

People using other CI systems like travis will still be affected. Travis runs composer self-update which will result in composer 2.0.0 being installed.

@Seldaek
Copy link
Member

Seldaek commented Oct 24, 2020

2.0.1 is out now, with proper future proof fix so such accidents should hopefully not happen anymore.

@LeRoyJulian
Copy link

Just upgraded PHP with Homebrew, I have the same error with the latest Composer version.

@Seldaek
Copy link
Member

Seldaek commented Nov 27, 2020

@LeRoyJulian please report a new issue with details as to what you see.

@LeRoyJulian
Copy link

Done #9522

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants