[Meta] Symfony 7 compatibility

Created on 17 October 2023, 8 months ago
Updated 30 April 2024, about 1 month ago

Problem/Motivation

Track what needs to be for Symfony 7.

Symfony 7 will include types on many methods, which requires that extending classes and interface implementations will need to be updated. There is an issue upstream ✨ Generate JSON schema for content entity types Needs review for collecting feedback, and with compatibility-checking steps.

Steps to reproduce

Proposed resolution

Remaining tasks

📌 Fork Symfony's ContainerAwareTrait and ContainerAwareInterface into core Needs work
📌 [11.x] Add void returns for Symfony 7 RTBC
📌 [META] Reduce use of ContainerAware classes where possible Active

done

User interface changes

API changes

Data model changes

Release notes snippet

📌 Task
Status

Fixed

Version

11.0 🔥

Component
Base  →

Last updated 1 minute ago

Created by

🇺🇸United States bradjones1 Digital Nomad Life

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @bradjones1
  • 🇺🇸United States bradjones1 Digital Nomad Life

    I'm going to bump this to major since there is a kinda time-sensitive request in the Symfony IS for dependent frameworks to determine if there are particular types that will be hugely problematic. There are instructions, and I think this should be easy enough to do in GitLab CI.

  • Status changed to Closed: duplicate 8 months ago
  • 🇺🇸United States bradjones1 Digital Nomad Life

    Closing as a duplicate of 📌 Update to Symfony 6.4 Needs work

  • Status changed to Active 7 months ago
  • 🇺🇸United States bradjones1 Digital Nomad Life

    Not a duplicate.

  • 🇳🇿New Zealand quietone New Zealand
  • 🇬🇧United Kingdom longwave UK

    The following dependencies need to declare Symfony 7 compatibility:

  • 🇳🇿New Zealand quietone New Zealand

    @longwave, thanks.

    I've moved the list of upstream changes to the Issue Summary and added a link for the behat/mink-browserkit-driver issue.

  • 🇬🇧United Kingdom longwave UK
  • 🇺🇸United States mglaman WI, USA

    Merged https://github.com/mglaman/phpstan-drupal/pull/639 – I just want to wait a few days to release phpstan-drupal as I cut 1.2.3 this morning, right before the issue was filed.

  • 🇬🇧United Kingdom longwave UK

    I have a pipeline running on Symfony 7 over in a test issue, where almost all the tests are passing with a handful of changes to core - need to break those out into separate issues so we can decide what to do with them in 10.x and 11.x but overall it's looking quite good to me: https://git.drupalcode.org/project/drupal/-/pipelines/49497/test_report

  • 🇫🇷France andypost

    Updated IS a bit with current state

  • 🇫🇷France andypost

    https://github.com/asm89/stack-cors/releases/tag/v2.2.0 is out as well as SF 6.4.0/7.0.0

    Only behat/mink* is not ready (as always)

  • 🇫🇷France andypost

    ordering to IS points

  • 🇫🇷France andypost

    mink merged changes to master so only tagged releases left

  • 🇫🇷France andypost

    asm89/stack-cors will be included in 📌 Update dependencies for Drupal 10.2 Needs review

    mglaman/phpstan-drupal needs bump constraint s/1.2.1/1.2.4

  • 🇬🇧United Kingdom longwave UK
  • 🇬🇧United Kingdom longwave UK
  • 🇬🇧United Kingdom catch

    composer 2.6.6 apparently resolves https://github.com/composer/composer/issues/11741#issuecomment-1847572878 so we might be able to just update to that instead of waiting for 2.7.

  • 🇫🇷France andypost

    It resolving conflict st least so let's upgrade

  • 🇬🇧United Kingdom longwave UK

    The list of tasks is incomplete, there are more than those listed.

    https://git.drupalcode.org/project/drupal/-/merge_requests/5388 is an old work in progress MR that has some more SF7 fixes in it.

  • First commit to issue fork.
  • Merge request !6514Yolo! → (Closed) created by Spokje
  • Pipeline finished with Failed
    4 months ago
    Total: 198s
    #90699
  • 🇳🇱Netherlands Spokje
  • 🇳🇱Netherlands Spokje

    Pushed a YOLO! commit to the MR, just with the updated dependencies, now that all external dependencies are SF7 ready.

    As PHPStan shows (and @longwave already said in #21 📌 Symfony 7 compatibility Active ): The list of tasks is incomplete, there are more than those listed.

    A lot of wheels are already in motion to get rid of the "last" SF6.4 issues, for Behat and friends there's an issue somewhere, and there are bound to be more issues floating around.

  • Pipeline finished with Failed
    4 months ago
    Total: 195s
    #93532
  • Pipeline finished with Failed
    4 months ago
    Total: 197s
    #94624
  • Merge request !6594Draft: Resolve #3394694 "Sf7" → (Closed) created by Spokje
  • 🇳🇱Netherlands Spokje

    Spokje → changed the visibility of the branch 11.x to hidden.

  • Pipeline finished with Failed
    4 months ago
    Total: 200s
    #94637
  • 🇳🇱Netherlands Spokje

    New MR, either me or GitLab couldn't figure out a rebase on the previous one (yeah, prob me...).

    Not much to see until 📌 [11.x] Add void returns for Symfony 7 RTBC lands.

  • 🇭🇺Hungary Gábor Hojtsy Hungary

    📌 [11.x] Add void returns for Symfony 7 RTBC is for the 11.x codebase only, so it cannot be committed right now. Are there any other changes to be made on "the 10.3.x branch" for Symfony 7 or none left?

  • 🇬🇧United Kingdom longwave UK

    Some of the ContainerAware removals will likely also be committed to 10.3.x as they will involve deprecations. It's hard to see the full picture without clearing the void returns and ContainerAware issues first, there may be more we need to do after that that also involve adding deprecations to 10.3.x.

  • Pipeline finished with Failed
    4 months ago
    Total: 101s
    #95507
  • Pipeline finished with Failed
    4 months ago
    Total: 189s
    #95514
  • Pipeline finished with Canceled
    4 months ago
    Total: 25s
    #95543
  • Pipeline finished with Failed
    4 months ago
    Total: 187s
    #95544
  • Pipeline finished with Failed
    3 months ago
    Total: 175s
    #105173
  • Pipeline finished with Failed
    3 months ago
    #105179
  • 🇬🇧United Kingdom catch

    Rebased the MR.

    Before the rebase:

    88 errors

    After the rebase:
    62 errors

  • Pipeline finished with Canceled
    3 months ago
    Total: 68s
    #106776
  • Pipeline finished with Failed
    3 months ago
    Total: 219s
    #106777
  • 🇳🇱Netherlands Spokje

    Rebased and bumped symfony/* to 7.0.4.
    After the rebase:
    58 errors

  • Pipeline finished with Failed
    3 months ago
    Total: 173s
    #107861
  • Pipeline finished with Failed
    3 months ago
    Total: 199s
    #111361
  • 🇳🇱Netherlands Spokje

    Rebased and bumped symfony/* to 7.0.5.
    After the rebase:
    58 errors

  • Pipeline finished with Failed
    3 months ago
    Total: 190s
    #111590
  • 🇬🇧United Kingdom longwave UK

    One existing issue reparented and two new child issues to handle Symfony Validator issues that are picked up here:

    📌 Symfony deprecations in Constraint plugins Active
    📌 Overwrite Symfony constraint errors in constructors instead of properties Active
    📌 Remove $context properties from ConstraintValidators Active

  • Pipeline finished with Failed
    3 months ago
    Total: 186s
    #119138
  • Pipeline finished with Failed
    3 months ago
    #119148
  • 🇳🇱Netherlands Spokje

    Rebased: Found 23 errors

  • 🇬🇧United Kingdom longwave UK

    Whoops, your push wasn't there when I started my own rebase, and then I repeated and overwrote your work, sorry!

  • 🇳🇱Netherlands Spokje

    No worries, as long as the end result is less errors :)

  • 🇬🇧United Kingdom longwave UK

    Rebase again following two more commits, down to 10 errors.

  • 🇫🇷France andypost

    needs rebase/fixes

  • Pipeline finished with Failed
    3 months ago
    Total: 213s
    #119708
  • 🇳🇱Netherlands Spokje

    Down to 7 PHPStan errors

  • 🇬🇧United Kingdom longwave UK

    Opened 📌 Notify downstream users that ContainerAware is going away Needs review which if accepted means 📌 Fork Symfony's ContainerAwareTrait and ContainerAwareInterface into core Needs work is won't fix.

  • Pipeline finished with Failed
    3 months ago
    Total: 553s
    #120951
  • Pipeline finished with Canceled
    3 months ago
    Total: 14s
    #120971
  • Pipeline finished with Failed
    3 months ago
    #120972
  • Pipeline finished with Failed
    3 months ago
    Total: 238s
    #121091
  • 🇳🇱Netherlands Spokje

    Spokje → changed the visibility of the branch 3394694-sf7 to hidden.

  • 🇬🇧United Kingdom longwave UK

    Urgh, that was no fun to figure out. See #3054535-37: Discuss whether to decouple from Symfony Validator → for the backstory on 95a33fe4.

  • Pipeline finished with Failed
    3 months ago
    Total: 512s
    #121155
  • Pipeline finished with Failed
    3 months ago
    Total: 164s
    #121167
  • Pipeline finished with Failed
    3 months ago
    Total: 177s
    #121170
  • Pipeline finished with Success
    3 months ago
    Total: 575s
    #121171
  • 🇬🇧United Kingdom longwave UK

    A green pipeline on Symfony 7!

    Only a few BaseFieldDefinition tweaks needed, will open another issue to backport those; was surprised that translated constraint errors didn't break, but it appears we have test coverage and all is good.

  • Pipeline finished with Failed
    3 months ago
    Total: 176s
    #121330
  • Pipeline finished with Failed
    3 months ago
    Total: 183s
    #121456
  • 🇬🇧United Kingdom longwave UK

    Raised https://github.com/symfony/symfony/issues/54321 as there is a type error in Symfony that we currently work around here, unsure which way they will fix this.

  • Pipeline finished with Failed
    3 months ago
    Total: 184s
    #122654
  • 🇬🇧United Kingdom longwave UK

    https://github.com/symfony/symfony/issues/54321 was fixed so once Symfony 7.0.6 is out we can revert the change around Request::setFactory().

  • Pipeline finished with Failed
    2 months ago
    Total: 188s
    #124052
  • Pipeline finished with Failed
    2 months ago
    Total: 178s
    #124966
  • 🇫🇷France andypost

    Last child issue can be marked fixed 📌 [META] Reduce use of ContainerAware classes where possible Active as commited 📌 [PP-2] Remove support for ContainerAwareInterface Postponed and remaining is no longer a blocker 📌 Inject services into LoggerChannelFactory RTBC

  • Pipeline finished with Failed
    2 months ago
    Total: 200s
    #125001
  • Status changed to Needs work 2 months ago
  • 🇫🇷France andypost

    No blockers, needs work for upgrade issue

  • Merge request !7153Resolve #3394694 "Sf7 even less rebases" → (Closed) created by Spokje
  • 🇮🇹Italy mondrake 🇮🇹

    Think 📌 [11.x] [PP-1] Add PHP 8.3 requirement to Drupal 11.0.x Postponed needs to be done first as it will set PHP to 8.3 min.

  • Pipeline finished with Failed
    2 months ago
    Total: 493s
    #125987
  • 🇳🇱Netherlands Spokje

    PHP 8.2 is the minimum for SF 7, so not really a hard blocker.

    However the release of SF 7.0.6 is, if we want to prevent using workarounds (as said by @longwave in #52 📌 Symfony 7 compatibility Active )

  • 🇳🇱Netherlands Spokje

    Spokje → changed the visibility of the branch 3394694-sf7-no-containeraware-less-rebases to hidden.

  • 🇬🇧United Kingdom longwave UK

    Opened 📌 [PP-1] Update to Symfony 7.0 Postponed to actually do the update, we must do 📌 [11.x] [PP-1] Add PHP 8.3 requirement to Drupal 11.0.x Postponed first and we have a Validator component problem to sort out as well which probably should be its own issue.

  • 🇮🇹Italy mondrake 🇮🇹

    Out there in 📌 Upgrade PHPUnit to 10, drop Symfony PHPUnit-bridge dependency Needs work there are still a lot of DebugClassloader deprecations for Symfony 7 typehints, see https://git.drupalcode.org/issue/drupal-3417066/-/pipelines/127550 and its test jobs.

    For some reason 📌 Upgrade PHPUnit to 10, drop Symfony PHPUnit-bridge dependency Needs work seems to be stricter than current symfony-bridge in reporting deprecations triggered before the test start.

    Example:

     PHPUnit 10.5.14 by Sebastian Bergmann and contributors.
        
        Runtime:       PHP 8.3.4
        Configuration: /builds/issue/drupal-3417066/core/phpunit.xml.dist
        
        D                                                                   1 / 1
        (100%)
        
        Time: 00:00.843, Memory: 16.00 MB
        
        1 test triggered 15 deprecations:
        
        1)
        /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
        Method
        "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
        might add "void" as a native return type declaration in the future. Do the
        same in implementation
        "Drupal\Core\DependencyInjection\Compiler\ModifyServiceDefinitionsPass" now
        to avoid errors or add an explicit @return annotation to suppress this
        message.
        
        Triggered by:
        
        *
        Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
         
        /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
        
        2)
        /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
        Method
        "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
        might add "void" as a native return type declaration in the future. Do the
        same in implementation
        "Drupal\Core\DependencyInjection\Compiler\DevelopmentSettingsPass" now to
        avoid errors or add an explicit @return annotation to suppress this
        message.
        
        Triggered by:
        
        *
        Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
         
        /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
        
        3)
        /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
        Method
        "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
        might add "void" as a native return type declaration in the future. Do the
        same in implementation
        "Drupal\Core\DependencyInjection\Compiler\CorsCompilerPass" now to avoid
        errors or add an explicit @return annotation to suppress this message.
        
        Triggered by:
        
        *
        Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
         
        /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
        
        4)
        /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
        Method
        "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
        might add "void" as a native return type declaration in the future. Do the
        same in implementation
        "Drupal\Core\DependencyInjection\Compiler\StackedSessionHandlerPass" now to
        avoid errors or add an explicit @return annotation to suppress this
        message.
        
        Triggered by:
        
        *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    5)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation
    "Drupal\Core\Render\MainContent\MainContentRenderersPass" now to avoid
    errors or add an explicit @return annotation to suppress this message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    6)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation
    "Drupal\Core\DependencyInjection\Compiler\RegisterStreamWrappersPass" now
    to avoid errors or add an explicit @return annotation to suppress this
    message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    7)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation
    "Drupal\Core\DependencyInjection\Compiler\TwigExtensionPass" now to avoid
    errors or add an explicit @return annotation to suppress this message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    8)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation
    "Drupal\Core\DependencyInjection\Compiler\RegisterEventSubscribersPass" now
    to avoid errors or add an explicit @return annotation to suppress this
    message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    9)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation
    "Drupal\Core\DependencyInjection\Compiler\RegisterAccessChecksPass" now to
    avoid errors or add an explicit @return annotation to suppress this
    message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    10)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation
    "Drupal\Core\DependencyInjection\Compiler\RegisterServicesForDestructionPass"
    now to avoid errors or add an explicit @return annotation to suppress this
    message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    11)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation "Drupal\Core\Cache\ListCacheBinsPass" now to avoid
    errors or add an explicit @return annotation to suppress this message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    12)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation "Drupal\Core\Cache\Context\CacheContextsPass" now to
    avoid errors or add an explicit @return annotation to suppress this
    message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    13)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation "Drupal\Core\Plugin\PluginManagerPass" now to avoid
    errors or add an explicit @return annotation to suppress this message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    14)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface::process()"
    might add "void" as a native return type declaration in the future. Do the
    same in implementation
    "Drupal\Core\DependencyInjection\Compiler\DeprecatedServicePass" now to
    avoid errors or add an explicit @return annotation to suppress this
    message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
    /builds/issue/drupal-3417066/core/tests/Drupal/KernelTests/Core/DrupalKernel/DrupalKernelSiteTest.php:18
    15)
    /builds/issue/drupal-3417066/vendor/symfony/error-handler/DebugClassLoader.php:337
    Method
    "Symfony\Component\EventDispatcher\EventSubscriberInterface::getSubscribedEvents()"
    might add "array" as a native return type declaration in the future. Do the
    same in implementation "Drupal\Core\Update\UpdateRegistry" now to avoid
    errors or add an explicit @return annotation to suppress this message.
    Triggered by:
    *
    Drupal\KernelTests\Core\DrupalKernel\DrupalKernelSiteTest::testServicesYml
     
  • 🇫🇷France andypost

    Most of it should be fixed by related rector to prevent manual intervention, the scariest is how contrib will adopt it...

  • 🇮🇹Italy mondrake 🇮🇹
  • Status changed to Fixed 2 months ago
  • 🇬🇧United Kingdom longwave UK

    📌 [PP-1] Update to Symfony 7.0 Postponed landed, so we are all done here - thanks to everyone who contributed especially @Spokje for keeping on top of this.

  • Automatically closed - issue fixed for 2 weeks with no activity.

  • 🇳🇿New Zealand quietone New Zealand
Production build 0.69.0 2024