Sentry-php: Update ocramius/package-versions

Created on 4 Feb 2020  路  7Comments  路  Source: getsentry/sentry-php

Earlier today I ran into an issue with Mailcoach conflicting with jean85/pretty-package-version's locked version of ocramius/package-versions. I reached out to the creator of the app to see if they could downgrade their requirement, but the longer-term fix would be to stop locking to a specific version.

For reference:

Most helpful comment

Just for the record:

As far as I understand Composer's version constraints, ^1.2.0 != ^1.2, as the first one allows installation up to 1.2.99999... and the second up to 1.999999..., but of course I could be wrong.

That's wrong for the "caret" operator (^) but would be right for the "tilde" operator (~): https://getcomposer.org/doc/articles/versions.md#next-significant-release-operators

All 7 comments

I've lowered the dependency on the end of spatie/laravel-mailcoach

I don't have a Mailcoach license but can I assume the following @freekmurze?:

You had ocramius/package-versions:^1.5 (or was it ocramius/package-versions:1.5.x?) required and now lowered it to ocramius/package-versions:^1.2 and that resolved the issue for you @m1guelpf?

What version of sentry/sentry-laravel / sentry/sentry / sentry/sdk are you requiring in your application @m1guelpf?

As far as I can tell we require (through jean85/pretty-package-versions) ocramius/package-versions:^1.2 which should install just fine when someone else requires a higher version (like ^1.5), so I'm trying to figure it if there is something we did wrong or can improve on.

You had ocramius/package-versions:^1.5 (or was it ocramius/package-versions:1.5.x?) required and now lowered it to ocramius/package-versions:^1.2

That's correct.

@stayallive I'm running on the latest version of the Laravel SDK, which I assume it's also the latest for the PHP SDK.

As far as I understand Composer's version constraints, ^1.2.0 != ^1.2, as the first one allows installation up to 1.2.99999... and the second up to 1.999999..., but of course I could be wrong.

As you can see, both ^1.2 or ^1.2.0 produces the same effect and allow any version up to 2.0 (not included), so I cannot get what the issue was, but it doesn't seems to be on our side :confused:

https://semver.mwl.be/#!?package=ocramius%2Fpackage-versions&version=%5E1.2.0&minimum-stability=stable#%3Fpackage=madewithlove%2Felasticsearcher&version=%5E0.5.2&minimum-stability=stable

Can confirm that it's not on out side. In reality, ^1.5 (them) is compatible with ^1.2 (us) as demonstrated by @ste93cry up here.

My suspicion is that you tried to install one of the two with a command like composer require mailcoach/mailcoach; that command doesn't whitelist any dependency which is already present, so if you had installed a version of ocramius/package-versions which was lower than 1.5 you would get that conflict.

Also note that ocramius/package-versions is pretty aggressive in term of PHP requirements, and with 1.5 it requires php: ^7.3.0, so if you're running on PHP 7.2 or lower that would make sense, and the fix from @freekmurze would totally solve it for you.

Closing as fixed in https://github.com/spatie/mailcoach-support/issues/37, feel free to discuss this further here.

Just for the record:

As far as I understand Composer's version constraints, ^1.2.0 != ^1.2, as the first one allows installation up to 1.2.99999... and the second up to 1.999999..., but of course I could be wrong.

That's wrong for the "caret" operator (^) but would be right for the "tilde" operator (~): https://getcomposer.org/doc/articles/versions.md#next-significant-release-operators

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brunowowk picture brunowowk  路  5Comments

realtebo picture realtebo  路  5Comments

caugner picture caugner  路  3Comments

garak picture garak  路  4Comments

bojanpejic picture bojanpejic  路  3Comments