Problem/Motivation
Make sure Drupal 9 keeps being compatible with PHP 8.1. Work with dependencies as needed. See #3109885: [meta] Ensure compatibility of Drupal 9 with PHP 8.0 (as it evolves) for how we did it with PHP 8.0. PHP 8.1-alpha1 is now released, see https://www.php.net/archive/2021.php#2021-06-10-1
Proposed resolution
Figure out what breaks. Itemize and resolve one by one.
1. Dependency updates to support PHP 8
To produce a list of dependencies that are blocking PHP 8.1 support, you can do the following. Make sure you use PHP 8 to run it.
$ git clone --branch 9.3.x https://git.drupalcode.org/project/drupal.git whynotphp81
$ cd whynotphp81/
$ composer install
$ composer update
$ composer why-not php:8.1
List of upstream updates in progress
- justinrainbow/json-schema https://github.com/justinrainbow/json-schema/pull/657
- PHP https://bugs.php.net/bug.php?id=81273 (found in \Drupal\Tests\Component\Datetime\DateTimePlusTest)
- PHPCS https://github.com/squizlabs/PHP_CodeSniffer/pull/3394 (does not cause errors in tests but is very noisy in CLI
List of upstream dependencies that are likely to lack PHP 8.1 support
- Doctrine reflection - it is abandoned - #3180351: doctrine/reflection is abandoned
- Guzzle 6 https://github.com/guzzle/guzzle/pull/2918 - they want us to move to 7. Can use namespace hacking to fix this - see #41 and #3224421: [PHP 8.1] Add a shim to Guzzle 6 for PHP 8.1 compatibility
Upstream fixes that are merged but need a release:
- behat/mink-selenium2-driver https://github.com/minkphp/MinkSelenium2Driver/pull/329
- behat/mink https://github.com/minkphp/Mink/pull/807
- symfony/yaml https://github.com/symfony/symfony/pull/42074
- symfony/http-foundation new info in $_FILES - https://github.com/symfony/symfony/pull/42112
- twig/twig https://github.com/twigphp/Twig/pull/3536
2. Internal Drupal issues
List of issues TBD
- #3180351: doctrine/reflection is abandoned
- #3224000: Update dependencies for Drupal 9.3
- #3224245: Open MySQL connection using \PDO::ATTR_STRINGIFY_FETCHES
- #3224414: Installing the syslog module uses its configuration before it is written
- #3224420: [PHP 8.1] Exception codes should be numeric and not NULL
- #3224592: \Drupal\path_alias\AliasManager::cacheClear() can cause deprecations on PHP 8.1 and when set to NULL it does not flush the entire cache
DONE
TBD
Release notes snippet
TBD