Project

General

Profile

Actions

Bug #96388

open

Error when replacing polyfill packages in the root composer.json

Added by Simon Gilli over 2 years ago. Updated 10 months 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 #1

Updated by Simon Gilli over 2 years ago

My fault, used provide instead of replace.

Actions #2

Updated by Simon Gilli over 2 years ago

  • Status changed from New to Closed
Actions #3

Updated by Simon Gilli over 2 years ago

  • Status changed from Closed to Accepted
  • Priority changed from Must have to Should have

It's the same behaviour when using replace instead of provide, so a real issue. Here new examples:

root composer.json

{
    "repositories": [
      {"type": "path", "url": "packages/*"}
    ],
    "name": "gilbertsoft/test-typo3-11",
    "license": "MIT",
    "description": "Testing TYPO3 11 polyfill issue.",
    "require": {
        "typo3/cms-core": "^11.5",
        "typo3/minimal": "^11.5",
        "gilbertsoft/test-typo3-11-ext": "@dev" 
    }
}

extension composer.json

{
    "name": "gilbertsoft/test-typo3-11-ext",
    "type": "typo3-cms-extension",
    "license": "MIT",
    "description": "Testing TYPO3 11 polyfill issue.",
    "replace": {
        "symfony/polyfill-intl-icu": "*" 
    },
    "extra": {
        "typo3/cms": {
            "extension-key": "test_typo3_11_ext" 
        }
    }
}
Actions #4

Updated by Gerrit Code Review over 2 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72711

Actions #5

Updated by Gerrit Code Review about 2 years ago

Patch set 2 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72711

Actions #6

Updated by Gerrit Code Review about 2 years ago

Patch set 3 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72711

Actions #7

Updated by Gerrit Code Review about 2 years ago

Patch set 4 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72711

Actions #8

Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72711

Actions #9

Updated by Gerrit Code Review 12 months ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72711

Actions #10

Updated by Gerrit Code Review 10 months ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72711

Actions #11

Updated by Riccardo De Contardi 9 months ago

  • Has duplicate Bug #101159: DependencyOrderingService cannot properly handle polyfill replaces added
Actions #12

Updated by Benni Mack 4 months ago

  • Related to Task #96980: Replace most symfony/polyfill-* packages added
Actions

Also available in: Atom PDF