Problem/Motivation

Before 2.3.6 composer throws to logs

> Drupal\Core\Composer\Composer::upgradePHPUnit
PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php on line 881
PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php on line 886
PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php on line 881
PHP Deprecated:  Using ${var} in strings is deprecated, use {$var} instead in /var/www/html/vendor/composer/composer/src/Composer/Autoload/AutoloadGenerator.php on line 886

Steps to reproduce

https://github.com/composer/composer/commit/c27dca83ef21bd44c41c1a60dd2e... fixes it

see https://dispatcher.drupalci.org/job/drupal_patches/138522/artifact/jenki...

Proposed resolution

require ^2.3.6 and upgrade composer to 2.3.10

Remaining tasks

review/commit

User interface changes

no

API changes

no

Data model changes

no

Release notes snippet

Drupal 10 requires Composer version 2.3.6 or higher to support Automatic Updates and PHP 8.2. Core developers must update to at least Composer 2.3.6 to work on Drupal core, and site owners may also receive a warning or error about older Composer versions in the future.

Issue fork drupal-3298396

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

andypost created an issue. See original summary.

andypost’s picture

the patch

ameymudras’s picture

FileSize
120.45 KB
24.93 KB

Thanks Andy,

  1. Patch applies cleanly.
  2. Title and issue summary are clear.
  3. Change is simple and addresses the issue from the issue summary.
  4. Issue metadata looks okay.

+1 for RTBC

andypost’s picture

Title: Upgrade composer to 2.3.10 to prevent warnings on PHP 8.2 » Upgrade composer requirement to 2.3.6 to prevent warnings on PHP 8.2
FileSize
4.51 KB

As commit in IS explains the required version is at least 2.3.6 (currently core requiring 2.3.5)

So improve title and newer patch to bump requirement as well

andypost’s picture

Issue summary: View changes

fixed IS

Vighneshh made their first commit to this issue’s fork.

Spokje’s picture

Unsure myself, but since we're bumping the composer version in the root composer.json from 2.3.5 to 2.3.6, shouldn't we also be doing this in \Drupal\Composer\Composer::ensureComposerVersion?

andypost’s picture

andypost’s picture

FileSize
907 bytes

interdiff for #8

Spokje’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @andypost, created #3299984: \Drupal\Tests\Composer\ComposerTest::testEnsureComposerVersion not testing what we expect. as a spin-off issue since that test still passes without being changed.

This issue is RTBC for me:
- composer/composer min version in composer.json is raised to 2.3.6,
- composer.lock gets version 2.3.10, which is what would happen in an Update-All-The-Dependency-Things!-issue just before the official release anyway.
- \Drupal\Composer\Composer::ensureComposerVersion ups its min version to 2.3.6 as well.

I _think_ we can fix/delete the test mentioned in the first sentence in that separate issue?

Spokje’s picture

Status: Reviewed & tested by the community » Needs work

Crap, we actually need a separate 10.1.x version of the patch. (Wonder how patch #4 got away with just a single patch for both branches). Sorry, back to NW.

andypost’s picture

patch for 10.1.x

andypost’s picture

Status: Needs work » Needs review
Spokje’s picture

Status: Needs review » Reviewed & tested by the community

Thanks @andypost, back to RTBC (see #10)

  • catch committed fe32bc3 on 10.0.x
    Issue #3298396 by andypost, Vighneshh, ameymudras, Spokje: Upgrade...
catch’s picture

Version: 10.0.x-dev » 9.5.x-dev
Status: Reviewed & tested by the community » Needs work

Committed/pushed to 10.1.x and cherry-picked to 10.0.x, thanks!

I think we could do with a 9.5.x version here that bumps the version but not the requirement.

  • catch committed f3a0d34 on 10.1.x
    Issue #3298396 by andypost, Vighneshh, ameymudras, Spokje: Upgrade...
andypost’s picture

Status: Needs work » Needs review
FileSize
2.34 KB

Bump for 9.5 makes sense as at least the commit fixes weird behavior https://github.com/composer/composer/commit/3ebd66b85108e5da3585371aa1de...

Anyway bumping version without requirement (FYI the commit from IS exists in 2.2.13 so 9.5.x is not affected by the bug)

Status: Needs review » Needs work

The last submitted patch, 18: 3298396-18.patch, failed testing. View results

Spokje’s picture

Do we really want to update composer/composer from "2.2.14" to "2.2.17" in an issue originally about bumping "2.3.5" to "2.3.10"?

Besides that: The main reason was originally to get PHP 8.2 working, which seems untestable on 9.x branches?
More importantly: 2.2.14 seems already PHP 8.2 ready: https://github.com/composer/composer/releases/tag/2.2.13

Not saying we shouldn't update composer/composer, but saying I don't think we should be doing it in this issue for PHP 8.2 reasons.
Dunno *shrug*

andypost’s picture

Status: Needs work » Needs review

CI was broken

Re #20 as 9.5 is in development I find it handy to bump all dependenies but maybe for that case it makes sense to file follow-up to update other ones as well a-la #3295520: Update dependencies for Drupal 10.0 and 9.5

catch’s picture

Version: 9.5.x-dev » 10.0.x-dev
Status: Needs review » Fixed

Yes I didn't realise 9.5.x already had the composer commit we needed here, fine to do the update in a general update dependencies issue I think. Moving this one back to fixed against 10.0.x

xjm’s picture

Issue tags: +10.0.0 release notes

Status: Fixed » Closed (fixed)

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

phenaproxima’s picture

Status: Closed (fixed) » Needs work
Issue tags: +Needs release note

I think the release note could be a little more detailed. What are the implications/impact? Will people be able to even use Drupal (or create new sites) with Composer <2.3.6? Let's elaborate on that a bit.

andypost’s picture

Issue summary: View changes
Status: Needs work » Needs review

Changed it to wording from release notes

Drupal 10 requires Composer version 2.3.6 or higher to support Automatic Updates and PHP 8.2. Core developers must update to at least Composer 2.3.6 to work on Drupal core, and site owners may also receive a warning or error about older Composer versions in the future

andypost’s picture

Status: Needs review » Fixed
Issue tags: -Needs release note

Suppose it's ok now

Status: Fixed » Closed (fixed)

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