Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Composer conflict in a laravel project #88

Closed
mathieutu opened this issue Feb 22, 2018 · 17 comments
Closed

Composer conflict in a laravel project #88

mathieutu opened this issue Feb 22, 2018 · 17 comments

Comments

@mathieutu
Copy link

mathieutu commented Feb 22, 2018

Hi, it's me again!
After some problems in sf projects, I've them now during a Laravel update.

In fact:

In mathieutu/exporter v2.0.0 I'm requiring tightenco/collect ^5.6 : https://github.com/mathieutu/exporter/blob/master/composer.json.

With this package in a Laravel project, I can't update laravel/framework to 5.6.4 (where the change of collect replace was done):

Problem 1
    - mathieutu/exporter 2.0.0 requires tightenco/collect ^5.6 -> satisfiable by laravel/framework[v5.6.3], illuminate/support[v5.6.0, v5.6.1, v5.6.2, v5.6.3], tightenco/collect[5.6.4.x-dev, v5.6.0, v5.6.4].
    - mathieutu/exporter 2.0.0 requires tightenco/collect ^5.6 -> satisfiable by laravel/framework[v5.6.3], illuminate/support[v5.6.0, v5.6.1, v5.6.2, v5.6.3], tightenco/collect[5.6.4.x-dev, v5.6.0, v5.6.4].
    - Can only install one of: laravel/framework[v5.6.4, v5.6.3].
    - don't install illuminate/support v5.6.0|don't install laravel/framework v5.6.4
    - don't install illuminate/support v5.6.1|don't install laravel/framework v5.6.4
    - don't install illuminate/support v5.6.2|don't install laravel/framework v5.6.4
    - don't install illuminate/support v5.6.3|don't install laravel/framework v5.6.4
    - don't install tightenco/collect 5.6.4.x-dev|don't install laravel/framework v5.6.4
    - don't install tightenco/collect v5.6.0|don't install laravel/framework v5.6.4
    - don't install tightenco/collect v5.6.4|don't install laravel/framework v5.6.4
    - Installation request for laravel/framework 5.6.4 -> satisfiable by laravel/framework[v5.6.4].
    - Installation request for mathieutu/exporter ^2.0 -> satisfiable by mathieutu/exporter[2.0.0].

If I require tightenco/collect in my root project, it's fine, and I can update. If I remove it, laravel is downgraded to 5.6.3.

Do you guys have any idea of where the problem could come from??

Thank you for your help.

@mattstauffer
Copy link
Member

@mathieutu My guess is this has to do with #76, which we are going to fix going forward. I MAY be able to also back-release Collect for 5.6.1, 5.6.2, and 5.6.3, which would fix this problem. I'll take a look ASAP.

@antonioribeiro
Copy link
Contributor

@mathieutu, Collect has no requirement ties with Laravel. Your problem is probably related to something else you have installed.

So I tried installing only your package:

image

And then required the Framework:

image

As you can see, it's all good, it even installed the newly released laravel/framework 5.6.5.

@antonioribeiro
Copy link
Contributor

Sorry, scratch that. I was able to reproduce your problem, which keeps making no sense. The only tie with Laravel was the "replace", in place only for Collect <5.5.33 now:

laravel/framework@5caa88a

@antonioribeiro
Copy link
Contributor

@mathieutu, @mattstauffer just upgraded it to 5.6.5, and I did a test here with your package and it works fine now.

image

@mathieutu
Copy link
Author

Yeah no problem like that too.
But if you do, like a real case acomposer require laravel/framework in a empty folder, then composer require mathieutu/exporter, you will see the exact same problem (the same if you create-project of laravel/laravel).
And collect is the only dependency the package has, so I can't see another source of the problem.
The conflicts occur since version 5.6.4, where we don't replace collect anymore...

Problem 1
    - Installation request for mathieutu/exporter ^2.0 -> satisfiable by mathieutu/exporter[2.0.0].
    - Conclusion: remove laravel/framework v5.6.5
    - Conclusion: don't install laravel/framework v5.6.5
    - mathieutu/exporter 2.0.0 requires tightenco/collect ^5.6 -> satisfiable by laravel/framework[v5.6.0, v5.6.1, v5.6.2, v5.6.3], illuminate/support[v5.6.0, v5.6.1, v5.6.2, v5.6.3], tightenco/collect[5.6.4.x-dev, v5.6.0, v5.6.4].
    - Can only install one of: laravel/framework[v5.6.0, v5.6.5].
    - Can only install one of: laravel/framework[v5.6.1, v5.6.5].
    - Can only install one of: laravel/framework[v5.6.2, v5.6.5].
    - Can only install one of: laravel/framework[v5.6.3, v5.6.5].
    - don't install illuminate/support v5.6.0|don't install laravel/framework v5.6.5
    - don't install illuminate/support v5.6.1|don't install laravel/framework v5.6.5
    - don't install illuminate/support v5.6.2|don't install laravel/framework v5.6.5
    - don't install illuminate/support v5.6.3|don't install laravel/framework v5.6.5
    - don't install tightenco/collect 5.6.4.x-dev|don't install laravel/framework v5.6.5
    - don't install tightenco/collect v5.6.0|don't install laravel/framework v5.6.5
    - don't install tightenco/collect v5.6.4|don't install laravel/framework v5.6.5
    - Installation request for laravel/framework (locked at v5.6.5, required as 5.6.*) -> satisfiable by laravel/framework[v5.6.5].

@mathieutu
Copy link
Author

mathieutu commented Feb 22, 2018

Sorry didn't see your previous comments @antonioribeiro
But I've still the pb :/ .
Just try: mkdir foo && cd foo && composer req laravel/framework && composer req mathieutu/exporter

I think that if it happens to me, it should happens to others package maintainer that use collect.

@mathieutu
Copy link
Author

But as I said, if you mkdir foo && cd foo && cr laravel/framework && cr tightenco/collect && cr mathieutu/exporter it works. It needs to have collect as root dependency, and I can't understand why.. 😞

@antonioribeiro
Copy link
Contributor

antonioribeiro commented Feb 22, 2018

Yeah, this dependency resolution is somehow broken. You can try to change the requirement to >=5.6.5 instead of ^5.6, but it's very long shot.

@antonioribeiro
Copy link
Contributor

Opened an issue in Composer: composer/composer#7129

@mathieutu
Copy link
Author

Ok, I've understood the problem with some similar issues in composer repo, you can check my comment here: composer/composer#7129 (comment)

(I don't know where to continue the discussion now 😅)

@mathieutu
Copy link
Author

mathieutu commented Feb 23, 2018

see composer/composer#3746 (comment) for the explanation about different versions.

So to summarize if I've understood well, the collect package is not supposed to work anymore with laravel, because it can't be installed with different version. The fact we can install it in root is probably a bug.

It's exactly the same think that if we try to install laravel/framework:5.6.5 alongside with illuminate/support:5.5.33. You'll have the exact same error.

@antonioribeiro
Copy link
Contributor

antonioribeiro commented Feb 23, 2018

Yeah, yesterday I was almost sure it was the replace, so I started a test I was just able to finish now. Copied the framework: https://packagist.org/packages/antonioribeiro/framerocks, to try some scenarios:

  • [working] self.version (which is not an option, we moved from it to <5.5.33)
  • [working] without replace
  • [working] using >=5.5.33 (which works fine, ignoring Collect 5.6.*, but so also not an option)
  • [broken] using <5.5.33 (current the only one broken)

If this is a feature and not a bug, we will have to think a way to make it work.

@antonioribeiro
Copy link
Contributor

Just sent a new PR to fix it, according this discussion: laravel/framework#23379

@mattstauffer
Copy link
Member

@antonioribeiro is this good and close-able?

@antonioribeiro
Copy link
Contributor

Yeah, I think it's definitely fixed now, please close.

@A-Elshorafa
Copy link

I am discover that i am download wronge file for php_mongodb that's for later verison of php

Check that the php_mongodb.dll is for your php version

@saqib006
Copy link

You'll want to make sure you upgrade both the web and cli versions of php to 7.1.2. A lot of times people will only upgrade the web version (and composer will then allow the install), but laravel uses both.
Free Code Zilla

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants