roots/trellis

Ubuntu 18.04: Composer v2

Closed this issue · 2 comments

Summary

(Optionally) force Composer to update to v2.

Motivation

On Ubuntu 18.04, Composer is currently stuck on 1.6.3.

$ apt-get changelog composer

composer (1.6.3-1) unstable; urgency=medium

  [ Jordi Boggiano ]
  * Release 1.6.3

  [ David Prévot ]
  * Move project repository to salsa.d.o
  * Update Standards-Version to 4.1.3

 -- David Prévot <taffit@debian.org>  Tue, 27 Feb 2018 17:40:39 -1000

For this reason, composer_keep_updated: true does not update Composer to v2.

Additional context

Currently, you have to log into each server as {{ admin_user }} and run

$ sudo composer selfupdate --2

To confirm, your $ composer --version still shows v1 after re-provisioning the server?
And, which Trellis version / commit you are using?

To confirm, your $ composer --version still shows v1 after re-provisioning the server?
Yes
And, which Trellis version / commit you are using?
1.7.0

I looked into the geerlingguy.composer role, vendor\roles\composer\tasks\main.yml:

- name: Update Composer to latest version (if configured).
  command: >
    {{ php_executable }} {{ composer_path }} self-update
  register: composer_update
  changed_when: "'Updating to version' in composer_update.stdout"
  when: composer_keep_updated | bool

So: not related to Ubuntu's packages, contrary to what I asserted above.

But, the explanation: Composer requires the --2 flag to update to v2, which geerlingguy.composer 1.7.6 is not capable of doing. It has been updated though. I will follow up with a PR.