silverstripe / recipe-plugin

Helper plugin to install Silverstripe recipes
BSD 3-Clause "New" or "Revised" License
11 stars 10 forks source link

Composer 2 introduces non-BC changes #15

Closed andrewandante closed 4 years ago

andrewandante commented 4 years ago

Trying to install using Composer 2 fails as the plugin version needs to be updated to 2.0 - you can see the requirements here: https://github.com/composer/composer/blob/master/UPGRADE-2.0.md#user-content-for-integrators-and-plugin-authors

Output from user on Slack:

:~/httpdocs$ composer update
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
 Problem 1
  - silverstripe/recipe-plugin 0.1.0 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
  - silverstripe/recipe-plugin 0.2.0 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
  - silverstripe/recipe-plugin 1.0.0 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
  - silverstripe/recipe-plugin 1.1.0 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
  - silverstripe/recipe-plugin 1.2.0 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
  - silverstripe/recipe-plugin 1.3.0 requires composer-plugin-api ^1.1 -> found composer-plugin-api[2.0.0] but it does not match your constraint.
  - Root composer.json requires silverstripe/recipe-plugin @stable -> satisfiable by silverstripe/recipe-plugin[1.3.0, 1.2.0, 1.1.0, 1.0.0, 0.2.0, 0.1.0].
You are using a snapshot build of Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report an issue to them to ask them to support Composer 2. To work around this you can run Composer with --ignore-platform-reqs, but this will also ignore your PHP version and may result in bigger problems down the line.

Shouldn't be too difficult of a change but will need to be done before Composer 2 is widely adopted

Pulls request

maxime-rainville commented 4 years ago

vendor-plugin will have the same problem.

maxime-rainville commented 4 years ago

Did 2 PRs to fix vendor-plugin and recipe-plugin.

I used this composer.json file to test it. For some reason, composer2 didn't want to run an update because it didn't seem to be picking the branch aliases. This might be a bug with the way composer2 picks up the aliases, or maybe something has changed there.

But otherwise it seemed to pick the plugins just fine and let them do their thing.

{
    "name": "silverstripe/installer",
    "type": "silverstripe-recipe",
    "description": "The SilverStripe Framework Installer",
    "require": {
        "php": ">=7.1.0",
        "silverstripe/recipe-plugin": "dev-pulls/1/support-composer-ii as 1.4.0",
        "silverstripe/vendor-plugin": "dev-pulls/1/support-composer-ii as 1.4.0",
        "silverstripe/recipe-cms": "4.5.x-dev",
        "silverstripe-themes/simple": "~3.2.0"
    },
    "require-dev": {
        "phpunit/phpunit": "^5.7"
    },
    "config": {
        "process-timeout": 600
    },
    "prefer-stable": true,
    "minimum-stability": "dev",
    "repositories": [
        {
            "type": "vcs",
            "url": "git@github.com:open-sausages/recipe-plugin.git"
        },
        {
            "type": "vcs",
            "url": "git@github.com:open-sausages/vendor-plugin.git"
        }
    ]
}
maxime-rainville commented 4 years ago

I'm reducing the impact of this one to "high". Composer 2 hasn't even hit alpha stage yet.

brynwhyman commented 4 years ago

Looks like there was a recent announcement to release v2.0 before the end of October.

michalkleiner commented 4 years ago

Composer 2.0 has been released. Could Maxime's PRs be merged now?