Review main Merged

74169[BUGFIX] Remove Symfony polyfill replacements from core

Helmut Hummel CR +2 V +2 Easy +0 −9 updated 04/07/22, 11:30

Commit message

Adding a replace to a package semantically means, that
this package replaces another one. This is not true
for typo3/cms-core and therefore the replacement should
not be declared.

Additionally, composer fails when more than one dependency
declare identical replaces. We thus can not declare them
in typo3/cms-core since it would conflict as soon as any
other dependency does that, too.

It is fine for typo3/cms as this only serves as base for
a bundled build for non Composer installations and for
development. As such, the replacements are kept in
monorepo root composer.json.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Oliver Klee +1
    • Christian Kuhn +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 2

Files 1

Review log 1620

  1. Helmut Hummel uploaded patch set 1 04/04/22, 16:22

  2. core-ci voted on patch set 1 V +1 04/04/22, 16:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25443

  3. Helmut Hummel updated the commit message in patch set 2 04/04/22, 17:46

  4. Christian Kuhn commented on patch set 1 CR -1 04/04/22, 17:49

    I played around on this: * creating a project with typo3/cms-core:12.0.x-dev as dependency, which *contains* the replaces *does not* install the polyfills as expected. * creating a project with typo3/cms-core:^11.5 as dependency, which *does not contain* the replaces *does* install the polyfills as expected. So the goal of the initial patch not having the polyfills in v12 is achieved for projects. I agree this is a limitation of composer here and composer is aware of that (there was also a twitter thread about that a while ago, I could try to look it up if you're interested). Still, since our dependencies of php modules (mbstring, intl, ...) are properly set, we *know* the polyfills are not needed. For the sake of smaller projects, I still have the opinion we should keep these replacements in ext:core composer.json, too. The only alternative is that projects have to set this on their own, which most projects probably won't do. By setting this on typo3/cms-core, we thus save the overhead by default. I think that's good.
  5. Christian Kuhn voted on patch set 2 CR -1 04/04/22, 17:49

  6. core-ci voted on patch set 2 V +1 04/04/22, 17:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25454

  7. Benjamin Franzke voted on patch set 2 V +1 CR +1 04/04/22, 18:04

  8. Christian Kuhn commented on patch set 2 V +1 CR +1 04/06/22, 19:06

    Ok, the real problem with the 'replaces' is: When more than one dependency declare the same 'replaces', composer crashes. Adding the 'replaces' of ext:core to ext:backend and then: Build/Scripts/runTests.sh -s composerTestDistribution Problem 1 - Root composer.json requires typo3/cms-backend @dev -> satisfiable by typo3/cms-backend[12.0.x-dev]. - Only one of these can be installed: symfony/polyfill-php81[v1.22.0, ..., v1.25.0], typo3/cms-core[12.0.x-dev], typo3/cms-backend[12.0.x-dev]. [typo3/cms-core, typo3/cms-backend] replace symfony/polyfill-php81 and thus cannot coexist with it. - Root composer.json requires typo3/cms-core @dev -> satisfiable by typo3/cms-core[12.0.x-dev]. --> We actually need this patch. Otherwise ext:core triggers a composer crash when *any* other dependency sets a similar replace. Sad but true. Adapted my vote now.
  9. Christian Kuhn voted on patch set 2 V 0 CR 0 04/06/22, 19:06

  10. Christian Kuhn commented on patch set 2 04/06/22, 19:07

    Reply

    We should adapt the commit message to mention this conflict. After that the patch is fine with me.
  11. Benjamin Franzke commented on patch set 2 04/06/22, 21:17

    Reply

    good catch, thanks for posting that.
  12. Oliver Klee voted on patch set 2 CR +1 04/06/22, 21:49

  13. Christian Kuhn updated the commit message in patch set 3 04/07/22, 10:57

  14. Christian Kuhn updated the commit message in patch set 4 04/07/22, 11:00

  15. Christian Kuhn voted on patch set 4 V +1 CR +1 04/07/22, 11:00

  16. core-ci voted on patch set 3 V +1 04/07/22, 11:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25727

  17. core-ci voted on patch set 4 V +1 04/07/22, 11:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25728

  18. Oliver Klee voted on patch set 4 CR +1 04/07/22, 11:15

  19. Benjamin Franzke voted on patch set 4 V +2 CR +2 04/07/22, 11:30

  20. Benjamin Franzke merged patch set 5 04/07/22, 11:30