lando / lando

A development tool for all your projects that is fast, easy, powerful and liberating
https://lando.dev
GNU General Public License v3.0
4.09k stars 545 forks source link

Use another version of composer #3163

Closed deshiloh closed 2 years ago

deshiloh commented 3 years ago

Hi ! I would like to know how to use composer with the version 1. I'm trying to work with a project that I can't update with composer 2

Generally these questions should end up as guides https://docs.lando.dev/contrib/guides-intro.html#what-is-a-guide

uberhacker commented 3 years ago

@deshiloh: You could "downgrade" temporarily with lando composer self-update --1.

deshiloh commented 3 years ago

I tried but I got : curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported 🤔

uberhacker commented 3 years ago

Maybe try to set the version in your recipe?

services:
  appserver:
    composer_version: "1.10.22"

More info here.

deshiloh commented 3 years ago

Thanks, that worked but still have curl_multi_setopt(): CURLPIPE_HTTP1 is no longer supported seems to be cause by symfony/flex (v. 1.2.0). Tried to update by changing the version in composer.json, but now the composer install / update give me a Can not allocate memory tried with memory_limit=-1 but doesn't work... Any tips ? i'm totally stuck ^^'

uberhacker commented 3 years ago

Maybe try lando composer require symfony/flex --update-with-dependencies?

deshiloh commented 3 years ago

same, still got : mmap() failed: [12] Cannot allocate memory

I also tried to get the composer.phar with the version 1.10.22 and tried : lando php -d memory_limit=-1 composer.phar require symfony/flex --update-with-dependencies

still not working...

uberhacker commented 3 years ago

How about lando composer update symfony/* --with-dependencies?

uberhacker commented 3 years ago

Try updating symfony with composer 2. Then try to revert back to composer 1.

deshiloh commented 3 years ago

got weird thing :

➜  motobleu git:(master) ✗ php -d memory_limit=-1 composer.phar update --with-dependencies
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Loading composer repositories with package information
Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.2.*"
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - The requested PHP extension ext-zip * is missing from your system. Install or enable PHP's zip extension.
  Problem 2
    - phpoffice/phpspreadsheet 1.9.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.8.2 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.8.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.8.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.7.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.6.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.18.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.17.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.17.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.16.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.15.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.14.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.14.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.13.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.12.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.11.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.10.1 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.10.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - phpoffice/phpspreadsheet 1.6.0 requires ext-zip * -> the requested PHP extension zip is missing from your system.
    - Installation request for phpoffice/phpspreadsheet ^1.6 -> satisfiable by phpoffice/phpspreadsheet[1.10.0, 1.10.1, 1.11.0, 1.12.0, 1.13.0, 1.14.0, 1.14.1, 1.15.0, 1.16.0, 1.17.0, 1.17.1, 1.18.0, 1.6.0, 1.7.0, 1.8.0, 1.8.1, 1.8.2, 1.9.0].

ext zip is already installed...

cchoe1 commented 2 years ago

php -d memory_limit=-1 composer.phar update --with-dependencies

You shouldn't be running any local copies of composer. You need to prefix your composer usage with lando so that it gets ran within your containerized application. When you use lando composer install it's calling the composer that is installed within your appserver. That is the composer which gets the version set when either setting it via the landofile or the command line.

Just run lando composer update with whatever flags you need like --with-dependencies