Project

General

Profile

Actions

Bug #96388

open

Error when replacing polyfill packages in the root composer.json

Added by Simon Gilli almost 3 years ago. Updated about 1 month ago.

Status:
Under Review
Priority:
Should have
Assignee:
Category:
composer
Target version:
Start date:
2021-12-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
11
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Symfony recommends to replace the polyfills of installed PHP extensions in the root package to reduce the overhead. Currently when replacing the various polyfill packages an exception is thrown during the autoload dump:

Executing "TYPO3\CMS\Core\Composer\PackageArtifactBuilder":

[UnexpectedValueException]
The package "backend" depends on "symfony/polyfill-mbstring" which is not present in the system.

Exception trace:
 () at /var/www/html/vendor/typo3/cms-core/Classes/Package/PackageManager.php:1116
 TYPO3\CMS\Core\Package\PackageManager->convertConfigurationForGraph() at /var/www/html/vendor/typo3/cms-core/Classes/Package/PackageManager.php:1197
 TYPO3\CMS\Core\Package\PackageManager->buildDependencyGraph() at /var/www/html/vendor/typo3/cms-core/Classes/Package/PackageManager.php:1085
 TYPO3\CMS\Core\Package\PackageManager->sortPackageStatesConfigurationByDependency() at /var/www/html/vendor/typo3/cms-core/Classes/Composer/PackageArtifactBuilder.php:138
 TYPO3\CMS\Core\Composer\PackageArtifactBuilder->sortPackagesAndConfiguration() at /var/www/html/vendor/typo3/cms-core/Classes/Composer/PackageArtifactBuilder.php:103
 TYPO3\CMS\Core\Composer\PackageArtifactBuilder->run() at /var/www/html/vendor/typo3/cms-composer-installers/src/Plugin/Core/ScriptDispatcher.php:72
 TYPO3\CMS\Composer\Plugin\Core\ScriptDispatcher->executeScripts() at /var/www/html/vendor/typo3/cms-composer-installers/src/Plugin/PluginImplementation.php:93
 TYPO3\CMS\Composer\Plugin\PluginImplementation->postAutoloadDump() at /var/www/html/vendor/typo3/cms-composer-installers/src/Installer/Plugin.php:101
 TYPO3\CMS\Composer\Installer\Plugin->listen() at n/a:n/a
 call_user_func() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:191
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/local/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:118
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/local/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:415
 Composer\Autoload\AutoloadGenerator->dump() at phar:///usr/local/bin/composer/src/Composer/Installer.php:333
 Composer\Installer->run() at phar:///usr/local/bin/composer/src/Composer/Command/UpdateCommand.php:248
 Composer\Command\UpdateCommand->execute() at phar:///usr/local/bin/composer/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:327
 Composer\Console\Application->doRun() at phar:///usr/local/bin/composer/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar:///usr/local/bin/composer/src/Composer/Console/Application.php:128
 Composer\Console\Application->run() at phar:///usr/local/bin/composer/bin/composer:73
 require() at /usr/local/bin/composer:29

There are currently two issues:

1. The replaces are not detected
2. It's always the backend which is listed in the message even if the backend has not dependency to polyfills at all

Minimal composer.json to reproduce:

{
    "name": "gilbertsoft/test-typo3-11",
    "license": "MIT",
    "description": "Testing TYPO3 11 polyfill issue.",
    "require": {
        "typo3/cms-core": "^11.5",
        "typo3/minimal": "^11.5" 
    },
    "provide": {
        "symfony/polyfill-ctype": "*",
        "symfony/polyfill-intl-grapheme": "*",
        "symfony/polyfill-intl-icu": "*",
        "symfony/polyfill-intl-idn": "*",
        "symfony/polyfill-intl-normalizer": "*",
        "symfony/polyfill-mbstring": "*",
        "symfony/polyfill-php72": "*",
        "symfony/polyfill-php73": "*" 
    }
}

Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Task #96980: Replace most symfony/polyfill-* packagesClosed2022-02-20

Actions
Has duplicate TYPO3 Core - Bug #101159: DependencyOrderingService cannot properly handle polyfill replacesClosed2023-06-23

Actions
Actions

Also available in: Atom PDF