drupal9ci icon indicating copy to clipboard operation
drupal9ci copied to clipboard

Create Composer 2 version for both Dockerfile and Dockerfile9

Open isholgueras opened this issue 4 years ago • 5 comments

Is your feature request related to a problem? Please describe. The current images only support Composer 1, and even with hirak/prestissimo, the speed of dependency calculation and download are not comparable with Composer 2.

Describe the solution you'd like I think this images should support Composer 2, but keeping Composer 1 to avoid breaking compatibility with existing services using the current images.

Describe alternatives you've considered The clearer workaround, meanwhile, is to update composer and remove hirak/prestissimo on the very first step with the following:

      - run:
          name: Update Composer to version 2
          command: |
            set -eux
            composer global remove hirak/prestissimo
            composer self-update

This should update the image to Composer 2, removing hirak/prestissimo, until there is an alternative image using Composer 2.

Additional context After a few months, Composer 2 still throw some issues in projects with Composer 1 dependencies. One example are phpro/grumphp:0.16. The upgrade from Composer 1 to Composer 2 is not trivial and easy in some cases. There should be, in my opinion, a clear distinction between the images running composer 1, the current ones, and the new images running composer 2, to avoid breaking compatibility with existing projects.

isholgueras avatar Jun 10 '21 08:06 isholgueras

Maybe use semver and add to the README that the new major version supports Composer 2 only?

salvamomo avatar Jun 10 '21 08:06 salvamomo

I don't really have much to add here other than +1 for using semver and building some images with Composer 2 installed in them. And if there's anything I can do help make that happen let me know!

eojthebrave avatar Nov 18 '21 19:11 eojthebrave

At this point I think Composer 2 had resolved most of the issues with projects, I would prefer to have it updated by default.

davereid-pfg avatar Jan 04 '22 18:01 davereid-pfg

    - set -eux
    - composer global remove hirak/prestissimo
    - composer self-update --2

Update to composer 2

erikseifert avatar Apr 13 '22 09:04 erikseifert

I needed to force it in some steps here: https://github.com/Lullabot/drupal9ci/pull/79

I think we are at a point where we should just use composer 2 in the images. I'm actually creating a follow up issue because it's not just composer, it's the PHP version, the node version, etc.

fjgarlin avatar Jun 10 '22 09:06 fjgarlin