Consider loosening our constraint to allow sites to install Guzzle 6 or 7, or otherwise handle PHP 8.1 deprecations for Guzzle 6

Created on 30 July 2021, over 3 years ago
Updated 27 February 2024, 9 months ago

Problem/Motivation

Drupal 9 requires Guzzle 6. Guzzle 6 now is in security support only. In particular, they are not adding compliance with PHP 8.1 to Guzzle 6, which creates issues for Drupal 9's own PHP 8.1 compatibility.

Guzzle 7 includes breaking changes from Guzzle 6, so we should not force sites to update to Guzzle 7 until the next major release (D10). However, we could also allow sites that want to use Guzzle 7 and PHP 8.1 to do so.

Even though we've managed to make Drupal 9 not trigger any deprecations from Guzzle 6 or skip some, there are other deprecations that Guzzle 6 will trigger when it's used by contrib projects. Such deprecations are not user deprecations but they are language level deprecations. For example:

Return type of GuzzleHttp\Command\Command::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice

Sites exposing this error cannot update to PHP 8.1, so they cannot prepare for Drupal 10.

Proposed resolution

  1. Consider changing our Guzzle constraint to:
    "guzzlehttp/guzzle": "^6.5.2 || ^7.4.1"
    
  2. Keep core-recommended and the composer.lock for tarballs pinned to the Guzzle 6 version.

Ensure HEAD remains compatible with Guzzle 7 with #3104353: Upgrade to Guzzle 7 .

Remaining tasks

User interface changes

N/A

API changes

Not in core itself.

Data model changes

N/A

Release notes snippet

Sites are able to install Guzzle 7 due to a widening of Drupal core's composer constraints. This allows for more complete PHP 8.1 support.

📌 Task
Status

Fixed

Version

9.4

Component
Composer 

Last updated 1 day ago

No maintainer
Created by

🇺🇸United States xjm

Live updates comments and jobs are added and updated live.
  • PHP 8.1

    The issue particularly affects sites running on PHP version 8.1.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • The above patch in #86 works for me using `drupal/core-recommended` version 9.5.11 on PHP 8.1.11, thanks.

  • 🇮🇳India bapi_22

    The interesting part: when we remove the package "drupal/core-recommended", the site is running fine with out any issue with Guzzle 7.
    As, the package drupal/core-composer-scaffold and drupal/core-project-message is having a dependency of drupal/core.

    anyone think, there might be an issue when we remove the package "drupal/core-recommended" completely ?

Production build 0.71.5 2024