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

Support composer/composer:^2 #305

Merged
merged 2 commits into from
May 7, 2021
Merged

Support composer/composer:^2 #305

merged 2 commits into from
May 7, 2021

Conversation

Legion112
Copy link
Contributor

@Legion112 Legion112 commented May 7, 2021

Fixes #304

@Ocramius
Copy link
Member

Ocramius commented May 7, 2021 via email

@Legion112
Copy link
Contributor Author

Legion112 commented May 7, 2021

@Ocramius I added the output of my composer version to the issue.
It's version Composer version 2.0.13 2021-04-27 13:11:08.

@Ocramius
Copy link
Member

Ocramius commented May 7, 2021

@Legion112 composer.lock also needs updating here

@Ocramius Ocramius added this to the 5.1.0 milestone May 7, 2021
@Ocramius Ocramius changed the title Fixed bug with supporting composer version ^2.0 Support composer/composer:^2 May 7, 2021
@Ocramius
Copy link
Member

Ocramius commented May 7, 2021

To update composer.lock, please run a composer update nothing within the project

@Legion112
Copy link
Contributor Author

@Ocramius Why does the third-party package contains composer.lock?
I think It should be deleted in order to allow install a different version.

@Ocramius
Copy link
Member

Ocramius commented May 7, 2021

@Legion112 composer.lock here has no effect on downstream packages: it is only here to keep builds stable / avoid moving dependencies between builds and code changes.

@Legion112
Copy link
Contributor Author

@Ocramius
I have tied several different ways to run the update. Nothing seems to work.

Install the latest stable version of composer by

max@pop-os:~/github/BackwardCompatibilityCheck$ composer self-update --2
You are already using the latest available Composer version 2.0.13 (2.x channel).
max@pop-os:~/github/BackwardCompatibilityCheck$ composer --version
Composer version 2.0.13 2021-04-27 13:11:08
max@pop-os:~/github/BackwardCompatibilityCheck$ composer update --lock
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires composer/composer == dev-master, found composer/composer[dev-master, 2.1.x-dev (alias of dev-master)] but it does not match your minimum-stability.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

To install the latest commit of composer:

max@pop-os:~/github/BackwardCompatibilityCheck$ php ../composer-setup.php --snapshot 
All settings correct for using Composer
Downloading...

Composer (version 649087d6de158dc4da73a06c7759dec5932be5a5) successfully installed to: /home/max/github/BackwardCompatibilityCheck/composer.phar
Use it: php composer.phar

max@pop-os:~/github/BackwardCompatibilityCheck$ php ../composer.phar --version
Composer version 2.1-dev (2.1-dev+649087d6de158dc4da73a06c7759dec5932be5a5) 2021-05-04 14:47:54
max@pop-os:~/github/BackwardCompatibilityCheck$ ../composer.phar update --lock 
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires composer/composer == dev-master, found composer/composer[dev-master, 2.1.x-dev (alias of dev-master)] but it does not match your minimum-stability.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
max@pop-os:~/github/BackwardCompatibilityCheck$ ../composer.phar update --lock -W
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires composer/composer == dev-master, found composer/composer[dev-master, 2.1.x-dev (alias of dev-master)] but it does not match your minimum-stability.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Even have tried to use composer inside the vendor/bin directory

max@pop-os:~/github/BackwardCompatibilityCheck$ vendor/bin/composer update --lock
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires composer/composer == dev-master, found composer/composer[dev-master, 2.1.x-dev (alias of dev-master)] but it does not match your minimum-stability.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
max@pop-os:~/github/BackwardCompatibilityCheck$ vendor/bin/composer update --lock -W
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires composer/composer == dev-master, found composer/composer[dev-master, 2.1.x-dev (alias of dev-master)] but it does not match your minimum-stability.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
max@pop-os:~/github/BackwardCompatibilityCheck$ vendor/bin/composer update --lock --with-all-dependencies

@Ocramius
Copy link
Member

Ocramius commented May 7, 2021

I've updated your patch by running composer update composer/composer 👍

@Legion112
Copy link
Contributor Author

Wel... it's not what you told me to do )

@Ocramius
Copy link
Member

Ocramius commented May 7, 2021

Yeah, I just tried it locally and noticed the failures too 👍

No worries, at least we move forward 🥳

@Ocramius Ocramius self-assigned this May 7, 2021
@Ocramius Ocramius merged commit 34d4cd8 into Roave:master May 7, 2021
@Legion112 Legion112 deleted the patch-1 branch May 7, 2021 15:42
@MGatner
Copy link

MGatner commented May 12, 2021

@Ocramius Any idea when this will be released?

@Ocramius
Copy link
Member

Releases are blocked by missing release automation:

@MGatner
Copy link

MGatner commented May 13, 2021

Ah, thanks for explaining! I didn't look back far enough. I'm using Nyholm's Action for now - I do love the options file feature it introduces.

@Ocramius Ocramius modified the milestones: 5.1.0, 6.0.0 Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work with composer v2
3 participants