composer: Error with PHP 8.0-dev and Composer 2.0.0
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
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 7
- Comments: 16 (12 by maintainers)
Commits related to this issue
- Fix php8 file being missing from phar, refs #9331 — committed to composer/composer by Seldaek 4 years ago
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.
2.0.1 is out now, with proper future proof fix so such accidents should hopefully not happen anymore.
I have patched phars
setup-php
uses. So please re-run your workflows if you got this error.@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ā¦
.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?