Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for Composer 2 #467

Merged
merged 15 commits into from
Sep 5, 2020
Merged

Add support for Composer 2 #467

merged 15 commits into from
Sep 5, 2020

Conversation

villfa
Copy link
Contributor

@villfa villfa commented Jul 12, 2020

humbug/box cannot be installed with Composer 2 (see below). More details here.

$ composer --version
Composer version 2.0.0-alpha2 2020-06-24 21:36:18
$ composer install
No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - ocramius/package-versions[dev-master, 1.10.0, ..., 1.10.x-dev] require php ^7.4.7 -> your php version (7.2.0; overridden via config.platform, actual: 7.4.3) does not satisfy that requirement.
    - ocramius/package-versions[1.6.0, ..., 1.9.x-dev] require php ^7.4.0 -> your php version (7.2.0; overridden via config.platform, actual: 7.4.3) does not satisfy that requirement.
    - ocramius/package-versions[1.4.0, ..., 1.4.2] require composer-plugin-api ^1.0.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
    - ocramius/package-versions[1.5.0, ..., 1.5.1] require php ^7.3.0 -> your php version (7.2.0; overridden via config.platform, actual: 7.4.3) does not satisfy that requirement.
    - ocramius/package-versions 1.99.x-dev is an alias of ocramius/package-versions dev-master and thus requires it to be installed too.
    - Root composer.json requires ocramius/package-versions ^1.4 -> satisfiable by ocramius/package-versions[1.4.0, ..., 1.99.x-dev (alias of dev-master)].

ocramius/package-versions only provides support for Composer 2 in 1.8+, which requires PHP 7.4.
If you can not upgrade PHP you can require composer/package-versions-deprecated to resolve this with PHP 7.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-req=composer-plugin-api, but this may result in broken plugins and bigger problems down the line.

@villfa
Copy link
Contributor Author

villfa commented Jul 12, 2020

Closed by accident by using push force. I wanted to see if the tests pass without modification.

[Edit] the tests fail even without modification: https://travis-ci.org/github/humbug/box/builds/707399989

@villfa villfa reopened this Jul 12, 2020
@villfa villfa changed the title Add support for Composer 2 WIP Add support for Composer 2 Jul 12, 2020
@villfa villfa changed the title WIP Add support for Composer 2 Add support for Composer 2 Jul 12, 2020
@villfa
Copy link
Contributor Author

villfa commented Jul 12, 2020

FYI the tests fail when executed with Composer 2 since it generates more files:

  • vendor/composer/installed.php
  • vendor/composer/InstalledVersions.php
  • vendor/composer/platform_check.php

@theofidry
Copy link
Member

Thank you @villfa sorry I somehow missed it. I'll come back to it next week with hopefully another update for PHP-Scoper

@villfa
Copy link
Contributor Author

villfa commented Aug 21, 2020

make box fails because of php-scoper. See: humbug/php-scoper#404

@theofidry theofidry merged commit ee2e9aa into box-project:master Sep 5, 2020
@theofidry
Copy link
Member

Thank you @villfa , sorry it took so long

@villfa villfa deleted the compat-composer2 branch September 7, 2020 11:23
@smoench smoench mentioned this pull request Oct 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants