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

PcreException with composer 2.2 #10385

Closed
thbley opened this issue Dec 22, 2021 · 6 comments
Closed

PcreException with composer 2.2 #10385

thbley opened this issue Dec 22, 2021 · 6 comments
Labels
Milestone

Comments

@thbley
Copy link

thbley commented Dec 22, 2021

Composer version 2.2.0 2021-12-22 11:03:27 fails with:

Installing dependencies from lock file (including require-dev)
Verifying lock file contents can be installed on current platform.
Nothing to install, update or remove
Generating optimized autoload files

[Composer\Pcre\PcreException]                                     
  preg_match(): failed executing "{[^?"'</cit]+}A": Internal error

install [--prefer-source] [--prefer-dist] [--prefer-install PREFER-INSTALL] [--dry-run] [--dev] [--no-suggest] [--no-dev] [--no-autoloader] [--no-progress] [--no-install] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--apcu-autoloader-prefix APCU-AUTOLOADER-PREFIX] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--] [<packages>]...

Composer version 2.1.14 did not have this error.

error happens with:

install -o -a --ignore-platform-reqs --no-progress

error does not happen with:

install -o --ignore-platform-reqs --no-progress
@Seldaek
Copy link
Member

Seldaek commented Dec 22, 2021

How did you get this? What's your composer.json, what command did you run, etc? Please follow the issue template.. and report a run with -v at least or -vvv ideally so we get a full stack trace.

@Seldaek Seldaek added this to the 2.2 milestone Dec 22, 2021
@Seldaek Seldaek added the Bug label Dec 22, 2021
@thbley
Copy link
Author

thbley commented Dec 22, 2021

Here is my composer.json, it works without my php files, the problem seems to be related to "--classmap-authoritative".
I'm trying to find a way to reproduce the error.

{
    "name" : "foo/bar",
    "description" : "bar",
    "license" : "proprietary",
    "config" : {
        "secure-http" : true,
        "platform" : {
            "php" : "8.0"
        },
        "preferred-install" : "dist"
    },
    "require" : {
        "php" : ">=8.0.0",
        "ext-intl": "*",
        "ext-mbstring": "*",
        "globalcitizen/php-iban": "4.1.0",
        "aws/aws-sdk-php": "3.208.4",
        "algolia/algoliasearch-client-php": "3.1.0"
    },
    "replace": {
        "paragonie/random_compat": "*",
        "symfony/polyfill-intl-grapheme": "*",
        "symfony/polyfill-intl-normalizer": "*",
        "symfony/polyfill-intl-idn": "*",
        "symfony/polyfill-iconv": "*",
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-mbstring": "*",
        "symfony/polyfill-php80": "*",
        "symfony/polyfill-php74": "*",
        "symfony/polyfill-php73": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php71": "*",
        "symfony/polyfill-php70": "*"
    },
    "autoload" : {
        "psr-4" : {
            "Foo\\Bar\\" : "./"
        }
    },
    "minimum-stability" : "stable",
    "prefer-stable" : true
}

@Seldaek
Copy link
Member

Seldaek commented Dec 22, 2021

OK thanks, I can reproduce.

@thbley
Copy link
Author

thbley commented Dec 22, 2021

Great, seems when I remove "globalcitizen/php-iban", the error disappears.

@thbley
Copy link
Author

thbley commented Dec 22, 2021

[Composer\Pcre\PcreException]                                     
  preg_match(): failed executing "{[^?"'</cit]+}A": Internal error  
                                                                    

Exception trace:
 () at phar:///usr/local/sbin/composer.phar/vendor/composer/pcre/src/PcreException.php:29
 Composer\Pcre\PcreException::fromFunction() at phar:///usr/local/sbin/composer.phar/vendor/composer/pcre/src/Preg.php:34
 Composer\Pcre\Preg::match() at phar:///usr/local/sbin/composer.phar/vendor/composer/pcre/src/Preg.php:255
 Composer\Pcre\Preg::isMatch() at phar:///usr/local/sbin/composer.phar/src/Composer/Autoload/PhpFileCleaner.php:274
 Composer\Autoload\PhpFileCleaner->match() at phar:///usr/local/sbin/composer.phar/src/Composer/Autoload/PhpFileCleaner.php:139
 Composer\Autoload\PhpFileCleaner->clean() at phar:///usr/local/sbin/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:249
 Composer\Autoload\ClassMapGenerator::findClasses() at phar:///usr/local/sbin/composer.phar/src/Composer/Autoload/ClassMapGenerator.php:116
 Composer\Autoload\ClassMapGenerator::createMap() at phar:///usr/local/sbin/composer.phar/src/Composer/Autoload/AutoloadGenerator.php:490
 Composer\Autoload\AutoloadGenerator->generateClassMap() at phar:///usr/local/sbin/composer.phar/src/Composer/Autoload/AutoloadGenerator.php:447
 Composer\Autoload\AutoloadGenerator->addClassMapCode() at phar:///usr/local/sbin/composer.phar/src/Composer/Autoload/AutoloadGenerator.php:354
 Composer\Autoload\AutoloadGenerator->dump() at phar:///usr/local/sbin/composer.phar/src/Composer/Installer.php:341
 Composer\Installer->run() at phar:///usr/local/sbin/composer.phar/src/Composer/Command/InstallCommand.php:139
 Composer\Command\InstallCommand->execute() at phar:///usr/local/sbin/composer.phar/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/sbin/composer.phar/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/sbin/composer.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/sbin/composer.phar/src/Composer/Console/Application.php:335
 Composer\Console\Application->doRun() at phar:///usr/local/sbin/composer.phar/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/sbin/composer.phar/src/Composer/Console/Application.php:130
 Composer\Console\Application->run() at phar:///usr/local/sbin/composer.phar/bin/composer:73
 require() at /usr/local/sbin/composer.phar:29

@thbley
Copy link
Author

thbley commented Dec 22, 2021

Thanks!

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

2 participants