[PHP 8.2] Composer - Upgrade Status conflicts with core 10.1.5

Created on 20 October 2023, about 1 year ago
Updated 21 February 2024, 10 months ago

Problem/Motivation

Spent some time on debugging.

Upgrade Status requires mathieuviossat/arraytotexttable which requires laminas/laminas-text which requires laminas/laminas-servicemanager:^3.19 in latest release. And here goes the problem, because laminas-servicemanager (3.19+ releases) also requires psr/container: ^1.0

Drupal core requires psr/container: ^2.0.2

It results in composer error:
Problem 1
- Root composer.json requires drupal/upgrade_status ^4.0 -> satisfiable by drupal/upgrade_status[4.0.0-alpha1, 4.0.0, 4.x-dev].
- drupal/core-recommended[10.1.5, ..., 10.2.x-dev] require psr/container ~2.0.2 -> satisfiable by psr/container[2.0.2, 2.0.x-dev].
- Conclusion: don't install psr/container 2.0.2 (conflict analysis result)
- Root composer.json requires drupal/core-recommended ^10.1.5 -> satisfiable by drupal/core-recommended[10.1.5, 10.1.x-dev, 10.2.x-dev].

Steps to reproduce

PHP 8.2
Drupal Core 10.1.5
Try to install Upgrade Status with composer

Proposed resolution

Not sure. Obviously, we can just wait until required libraries will support both PHP 8.2 and psr/container: ^2.0.2. Alternatively, maybe we can decide to not use arraytotexttable or make it optional?

🐛 Bug report
Status

Closed: duplicate

Version

4.0

Component

Code

Created by

🇵🇱Poland nsavitsky

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

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

Sign in to follow issues

Comments & Activities

  • Issue created by @nsavitsky
  • 🇺🇸United States papagrande US West Coast
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    Interesting, a very similar issue is at 📌 Composer conflict prevents search_api_solr to be installed Active .

  • 🇭🇺Hungary Gábor Hojtsy Hungary

    In [] the problem is a combination of psr/container v2 and PHP 8.3. Sounds like from the issue summary you hit the same package already on PHP 8.2. Drupal 10.0 already required psr/container v2 so its not a change in 10.1.5 specifically. It looks to be related to your PHP version (which the downstream packages don't seem to be ready for).

  • Status changed to Postponed: needs info 10 months ago
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    I tried a fresh composer setup:

    gitpod /workspace/DrupalPod (main) $ composer show drupal/core
    Notice: running 'composer show drupal/core' in ddev
    name     : drupal/core
    descrip. : Drupal is an open source content management platform powering millions of websites and applications.
    keywords : 
    versions : * 10.2.3
    [...]
    
    gitpod /workspace/DrupalPod (main) $ php -v
    Notice: running 'php -v' in ddev
    PHP 8.2.15 (cli) (built: Jan 20 2024 14:13:38) (NTS)
    Copyright (c) The PHP Group
    Zend Engine v4.2.15, Copyright (c) Zend Technologies
        with Zend OPcache v8.2.15, Copyright (c), by Zend Technologies
    
    gitpod /workspace/DrupalPod (main) $ composer require drupal/upgrade_status
    Notice: running 'composer require drupal/upgrade_status' in ddev
    ./composer.json has been updated
    Running composer update drupal/upgrade_status
    Loading composer repositories with package information
    Updating dependencies
    Lock file operations: 7 installs, 0 updates, 0 removals
      - Locking container-interop/container-interop (1.1.0)
      - Locking drupal/upgrade_status (4.x-dev)
      - Locking mathieuviossat/arraytotexttable (v1.0.7)
      - Locking zendframework/zend-hydrator (1.0.0)
      - Locking zendframework/zend-servicemanager (2.6.0)
      - Locking zendframework/zend-stdlib (2.7.4)
      - Locking zendframework/zend-text (2.5.1)
    Writing lock file
    Installing dependencies from lock file (including require-dev)
    Package operations: 7 installs, 0 updates, 0 removals
      - Installing container-interop/container-interop (1.1.0): Extracting archive
      - Installing zendframework/zend-stdlib (2.7.4): Extracting archive
      - Installing zendframework/zend-hydrator (1.0.0): Extracting archive
      - Installing zendframework/zend-servicemanager (2.6.0): Extracting archive
      - Installing zendframework/zend-text (2.5.1): Extracting archive
      - Installing mathieuviossat/arraytotexttable (v1.0.7): Extracting archive
      - Installing drupal/upgrade_status (4.x-dev): Source already present
    8 package suggestions were added by new dependencies, use `composer suggest` to see details.
    Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
    Package zendframework/zend-hydrator is abandoned, you should avoid using it. Use laminas/laminas-hydrator instead.
    Package zendframework/zend-servicemanager is abandoned, you should avoid using it. Use laminas/laminas-servicemanager instead.
    Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
    Package zendframework/zend-text is abandoned, you should avoid using it. Use laminas/laminas-text instead.
    Generating autoload files
    94 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    phpstan/extension-installer: Extensions installed
    > repos/add-project-as-symlink.sh
    Replace project with a symlink
    No security vulnerability advisories found.
    Using version 4.x-dev for drupal/upgrade_status

    Why are you getting a different result?

    mathieuviossat/arraytotexttable's 1.0.7 version was (a) PHP 8.2 and 8.3 compatible (in fact compatible with any future version of PHP) and did not use the laminas dependencies yet, so there was no conflict on that version.

  • Status changed to Closed: duplicate 10 months ago
  • 🇭🇺Hungary Gábor Hojtsy Hungary

    Actually this should be resolved by 📌 Composer conflict prevents search_api_solr to be installed Active , please see there!

  • 🇵🇱Poland nsavitsky

    Hey @gábor-hojtsy, sorry for late response, I have just received notification.

    >Why are you getting a different result?

    Well, I guess that it is due the fact that I had this issue few months back (oct 2023), probably new version of the dependency arrived (as I actually expected in the ticket description), and conflict was resolved for PHP 8.2. I see that you replaced MathieuViossat\Util\ArrayToTextTable with dekor\ArrayToTextTable library to also support PHP 8.3 and I think this is great solution. Thank you very much for taking care!

Production build 0.71.5 2024