Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Composer 2.0 Compatibility (or force Composer to 1.9) #178

Open
SilverPreece opened this issue Dec 7, 2020 · 1 comment
Open

Composer 2.0 Compatibility (or force Composer to 1.9) #178

SilverPreece opened this issue Dec 7, 2020 · 1 comment
Labels

Comments

@SilverPreece
Copy link

Describe your environment

  • OS: Kubuntu 20.04
  • Joomla version: Any
  • Joomlatools Vagrant version: 1.6.0

Describe the problem:

Composer 2.0 has been released, and the plugins being used inside the Joomlatools Vagrant box do not appear to be compatible. These plugins would either need to be updated, or the Composer version needs to be locked to 1.x.

Steps to reproduce:

  1. Log in to the Vagrant box after provisioning, either via the web control panel or via SSH.
  2. When prompted, accept the Joomlatools console upgrade.

Observed Results:

Welcome to Joomlatools Vagrant box (running on Ubuntu 18.04.3 LTS)
Last login: Mon Dec  7 04:59:38 2020 from ::1

New release 1.5.9 available for joomlatools/console.
Do you want to update now? [y/N] y
Updating Composer ..
The "cweagans/composer-patches" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "pyrech/composer-changelogs" plugin was skipped because it requires a Plugin API version ("^1.0 || ^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "cweagans/composer-patches" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "pyrech/composer-changelogs" plugin was skipped because it requires a Plugin API version ("^1.0 || ^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
You are running composer as "root", while "/home/vagrant/.composer" is owned by "vagrant"
Upgrading to version 2.0.8 (stable channel).
   
Use composer self-update --rollback to return to version 2.0.7
Updating joomlatools/console ..
Changed current directory to /home/vagrant/.composer
The "cweagans/composer-patches" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "pyrech/composer-changelogs" plugin was skipped because it requires a Plugin API version ("^1.0 || ^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
./composer.json has been updated
The "cweagans/composer-patches" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "hirak/prestissimo" plugin was skipped because it requires a Plugin API version ("^1.0.0") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
The "pyrech/composer-changelogs" plugin was skipped because it requires a Plugin API version ("^1.0 || ^1.1") that does not match your Composer installation ("2.0.0"). You may need to run composer update with the "--no-plugins" option.
Running composer update joomlatools/console --with-dependencies
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - pyrech/composer-changelogs is locked to version v1.7.0 and an update of this package was not requested.
    - pyrech/composer-changelogs v1.7.0 requires composer-plugin-api ^1.0 || ^1.1 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 2
    - hirak/prestissimo is locked to version 0.3.9 and an update of this package was not requested.
    - hirak/prestissimo 0.3.9 requires composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
  Problem 3
    - cweagans/composer-patches 1.6.7 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - wp-cli/extension-command v2.0.7 requires wp-cli/wp-cli ^2 -> satisfiable by wp-cli/wp-cli[v2.4.0].
    - foliolabs/folioshell v0.2.1 requires wp-cli/extension-command ^2.0 -> satisfiable by wp-cli/extension-command[v2.0.7].
    - wp-cli/wp-cli v2.4.0 requires cweagans/composer-patches ^1.6 -> satisfiable by cweagans/composer-patches[1.6.7].
    - foliolabs/folioshell is locked to version v0.2.1 and an update of this package was not requested.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

Expected Results:

The Joomlatools console package can be installed and updated successfully.

@SilverPreece
Copy link
Author

SilverPreece commented Dec 9, 2020

I have worked out a workaround for this issue, until it can be correctly resolved. (I attempted to make a patch myself but the Puppet provisioning was not working on my local.)

As you can see above, the issue is that the various actual dependencies used by the Joomlatools console are workable on Composer 2.0 but the plugins being used in the box are not. I have modified my project's Vagrantfile to remove all plugins after the box comes up, and then add back the ones required. I would have removed only the ones no longer needed and updated the others, but for some reason even with the --no-plugins flag Composer would block this.

Reasoning for each plugin:

  • pyrech/composer-changelogs - Added back. Is locked to 1.7.0 in the box after Puppet, 1.7.1 provides Composer 2.0 compatibility.
  • cweagans/composer-patches - Added back. Newest version supports Composer 2.0
  • hirak/prestissimo - Removed. No Composer 2.0 compatibility, author suggests that Composer 2.0's performance is such that the plugin is no longer required. (Apparently this was already done in the code base also, see 2a3a1ea)

With these plugins sorted out, joomlatools-console installs and works perfectly. With some of this work already done, we may simply need a new release of the box cutting.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants