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

Make the require command guess versions more accurately #11160

Merged
merged 1 commit into from
Nov 1, 2022

Conversation

Seldaek
Copy link
Member

@Seldaek Seldaek commented Oct 28, 2022

If no version is provided we usually select the latest working version but in some cases this leads to problems if that conflicts with other stuff you have installed.

This PR makes it instead use a * constraint temporarily, effectively delegating the job to the solver (except if called with --no-update then we still use the best-effort version selector stuff). Once we have a solution we then replace version constraints again with whatever the locked version is.

This should improve the require experience especially for people that do not have very up to date dependencies.

@Seldaek Seldaek added this to the 2.5 milestone Oct 28, 2022
@Seldaek Seldaek requested a review from naderman October 28, 2022 14:17
Copy link
Member

@naderman naderman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

Copy link
Contributor

@Toflar Toflar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! <3

@Seldaek Seldaek merged commit 36bc30f into composer:main Nov 1, 2022
@Seldaek Seldaek deleted the require_correct branch November 1, 2022 14:48
mnocon added a commit to mnocon/composer-checkout that referenced this pull request Dec 1, 2022
nicolas-grekas added a commit to symfony/orm-pack that referenced this pull request Dec 5, 2022
This works around #37 

Note that after composer/composer#11160, Composer 2.5 would be able to take the conflict into account and thus not fall into #37, but we're not yet there.
nicolas-grekas added a commit to symfony/orm-pack that referenced this pull request Dec 5, 2022
This works around #37 

Note that after composer/composer#11160, Composer 2.5 would be able to take the conflict into account and thus not fall into #37, but we're not yet there.
emahorvat52 pushed a commit to emahorvat52/composer that referenced this pull request Feb 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants