Problem/Motivation

Composer 2 is required for Drupal 10. Potentially 2.2, see #3215870: Require Composer 2.3.5 for developing Drupal 10 core.

Steps to reproduce

Proposed resolution

Remove any Composer 1 specific code paths from Drupal 10.

Remaining tasks

Find them. Remove them.

User interface changes

API changes

Data model changes

Release notes snippet

CommentFileSizeAuthor
#7 3284420-7.patch5.84 KBlongwave
#5 3284420-5.patch5.59 KBlongwave

Comments

Gábor Hojtsy created an issue. See original summary.

andypost’s picture

gábor hojtsy’s picture

xjm’s picture

longwave’s picture

Status: Active » Needs review
StatusFileSize
new5.59 KB

Bumped composer-plugin-api to ^2 in all our plugins. The scaffolding plugin has a code path to support Composer 1 which has been removed. The check in Drupal\Composer\Composer::ensureComposerVersion() now ensures core developers use Composer 2.

spokje’s picture

Status: Needs review » Needs work

PHPCS failed on an unused use.

Besides that, shouldn't these all be requiring PHP ">=8.1.0" in the 10.x branches?
If so, probably for a follow-up issue?

--- a/composer/Plugin/ProjectMessage/composer.json
+++ b/composer/Plugin/ProjectMessage/composer.json
@@ -15,6 +15,6 @@
   },
   "require": {
-    "composer-plugin-api": "^1 || ^2",
+    "composer-plugin-api": "^2",
     "php": ">=7.3.0",
--- a/composer/Plugin/Scaffold/composer.json
+++ b/composer/Plugin/Scaffold/composer.json
@@ -6,7 +6,7 @@
   "homepage": "https://www.drupal.org/project/drupal",
   "license": "GPL-2.0-or-later",
   "require": {
-    "composer-plugin-api": "^1 || ^2",
+    "composer-plugin-api": "^2",
     "php": ">=7.3.0"
   },
--- a/composer/Plugin/VendorHardening/composer.json
+++ b/composer/Plugin/VendorHardening/composer.json
@@ -15,6 +15,6 @@
   },
   "require": {
     "php": ">=7.3.0",
-    "composer-plugin-api": "^1.1 || ^2"
+    "composer-plugin-api": "^2"
longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new5.84 KB

Fixed unused use statement.

FWIW I am in two minds as to whether we should do this, as the code path for Composer 1 is small and it's not causing us any issue, is there any need to drop it now?

Re #6 this should be added to #3272110: Drupal 9 and 10's Drupal\Component composer.json files are totally out of date if it's not already there

andypost’s picture

Status: Needs review » Reviewed & tested by the community

Looks enough

  • catch committed cec54c5 on 10.0.x
    Issue #3284420 by longwave, Gábor Hojtsy, Spokje: Remove Composer 1...
  • catch committed 6c6f6a3 on 10.1.x
    Issue #3284420 by longwave, Gábor Hojtsy, Spokje: Remove Composer 1...
catch’s picture

Status: Reviewed & tested by the community » Fixed

The main reason to drop composer 1 support is because automatic updates will require 2.1 or higher. We might want to raise the minimum further, but that issue is still active #3215870: Require Composer 2.3.5 for developing Drupal 10 core. Not many places you can actually enforce composer version but we might as well change the places we can.

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

Status: Fixed » Closed (fixed)

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