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

Specify the platform configuration in composer.json #3862

Merged
merged 1 commit into from
Jan 30, 2020

Conversation

morozov
Copy link
Member

@morozov morozov commented Jan 30, 2020

Q A
Type improvement
BC Break no
Fixed issues build #643647287

Having the target platform specified in Composer configuration will help make sure we won't lock the dependencies to a version incompatible with the oldest supported PHP version (see the linked build) without the need to use the oldest supported PHP in the development environment.

@morozov morozov added this to the 3.0.0 milestone Jan 30, 2020
@morozov morozov requested a review from greg0ire January 30, 2020 01:57
Copy link
Member

@greg0ire greg0ire left a comment

Choose a reason for hiding this comment

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

We should remove the composer.lock IMO, but until then, 👍

@morozov morozov merged commit 7e3e435 into doctrine:3.0.x Jan 30, 2020
@morozov morozov deleted the composer-platform branch January 30, 2020 15:02
@morozov morozov self-assigned this Jan 30, 2020
@morozov
Copy link
Member Author

morozov commented Jan 30, 2020

We should remove the composer.lock IMO

@greg0ire please see #3778. The practice shows that keeping it is the right choice.

How would removing it help to solve the problem of adding incompatible dependencies?

@greg0ire
Copy link
Member

greg0ire commented Jan 30, 2020

If we have no composer.lock, and somebody requires a version that requires PHP 7.3, the 7.2 build will fail and prevent the PR from being merged, won't it?

@morozov
Copy link
Member Author

morozov commented Jan 30, 2020

Instead of relying on CI building against the lowest supported version, this approach does the same in the development environment and does not require the lowest supported PHP version to resolve the dependencies.

@greg0ire
Copy link
Member

What if the version in the composer.lock is not compatible with the highest supported PHP version? You would have the exact same issue, reversed.

Also see @beberlei and I struggling to fix the build the other day because of a similar issue: https://doctrine.slack.com/archives/GERFT2W5T/p1579212730062400?thread_ts=1579212399.059900&cid=GERFT2W5T

@morozov
Copy link
Member Author

morozov commented Jan 30, 2020

What if the version in the composer.lock is not compatible with the highest supported PHP version? You would have the exact same issue, reversed.

Then the incompatibility will be detected on CI. For most packages, the lowest version requirement is by design since they are using certain language features or APIs while the highest version requirement is implicit and is not by design. I.e. it's a relatively rare case to worry about.

@greg0ire
Copy link
Member

Then the incompatibility will be detected on CI.

That's my point. There might be no incompatibility. There might exist a more recent version of the lib that is compatible with 7.4, yet one that is compatible with 7.2 and not 7.4 is in use.

while the lowest version requirement

did you mean "while the highest"?

@morozov
Copy link
Member Author

morozov commented Jan 30, 2020

did you mean "while the highest"?

Yes, corrected.

@morozov
Copy link
Member Author

morozov commented Jan 30, 2020

That's my point. There might be no incompatibility.

I see. Makes sense. Let’s reconsider this once it happens.

@greg0ire
Copy link
Member

I agree that we will be quite unlucky if it happens. Relying on packages that aggressively bump the versions of php (such as ocramius/package-versions) increase the likelihood of this happening I think.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 4, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants