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 conflict with amphp/file lax #267

Merged
merged 1 commit into from
May 6, 2020
Merged

Make conflict with amphp/file lax #267

merged 1 commit into from
May 6, 2020

Conversation

enumag
Copy link
Contributor

@enumag enumag commented Apr 30, 2020

I'm trying to use "amphp/file": "dev-master as 1.0.1", in my composer.json because of amphp/file@7dc65ff but composer refuses to install it:

  Problem 1
    - amphp/file dev-master conflicts with amphp/http-client[v4.2.2].
    - amphp/http-client v4.2.2 conflicts with amphp/file[dev-master].
    - amphp/file dev-master conflicts with amphp/http-client[v4.2.2].
    - Installation request for amphp/file dev-master as 1.0.1 -> satisfiable by amphp/file[dev-master].
    - Installation request for amphp/http-client (locked at v4.2.2, required as ^4.0) -> satisfiable by amphp/http-client[v4.2.2].

Now there are two ways to fix this:

  1. Add branch alias to amphp/file to let composer know that dev-master is 1.x - then I could depend on ^1.0@dev. (I'd recommend this for all repos.)
  2. Remove the conflict with amphp/file v2 here. It doesn't make sense at all since v2 doesn't even exist and the constraint blocks dev versions.

Personally I'd recommend doing both.

Please fix this ASAP.

@kelunik
Copy link
Member

kelunik commented Apr 30, 2020

2. Remove the conflict with amphp/file v2 here. It doesn't make sense at all since v2 doesn't even exist and the constraint blocks dev versions.

It makes as much sense as using "require": { "amphp/file": "^1" } instead of "require": { "amphp/file": ">=1" }. It's basically an optional "require".

@kelunik kelunik closed this Apr 30, 2020
@kelunik
Copy link
Member

kelunik commented Apr 30, 2020

I've added the branch alias to amphp/file.

@enumag
Copy link
Contributor Author

enumag commented Apr 30, 2020

@kelunik I tried again but unfortunately it seems it didn't help. Composer is still refusing to install it.

@kelunik
Copy link
Member

kelunik commented Apr 30, 2020

Works fine for me, how does your composer.json look like?

@enumag
Copy link
Contributor Author

enumag commented Apr 30, 2020

Yeah, minimal use-case works for me too. But it breaks as soon as I add anything (even totally unrelated) into require-dev:

{
    "require": {
        "amphp/file": "^1.0@dev",
        "amphp/http-client": "^4.2"
    },
    "require-dev": {
        "psr/log": "*"
    }
}
  [Composer\DependencyResolver\SolverProblemsException]                                               
  Problem 1                                                                                           
      - Installation request for amphp/file ^1.0@dev -> satisfiable by amphp/file[1.x-dev].           
      - amphp/file dev-master conflicts with amphp/http-client[v4.2.2].                               
      - remove amphp/file 1.x-dev|keep amphp/file dev-master                                          
      - Installation request for amphp/http-client ^4.2 -> satisfiable by amphp/http-client[v4.2.2].                                                                                                     

Honestly I think it's a composer bug. Can you please tell me if this happens for you too?

I tried to update composer but it didn't help.

@kelunik
Copy link
Member

kelunik commented May 1, 2020

Confirmed, this pretty much looks like a composer bug.

@enumag
Copy link
Contributor Author

enumag commented May 1, 2020

Thanks... could you make a stable release of amphp/file with amphp/file@7dc65ff? I'd like to avoid using workarounds.

@enumag
Copy link
Contributor Author

enumag commented May 1, 2020

@kelunik As you might have noticed the bug won't be fixed in Composer 1.x. Would you consider removing the >=2 conflict for now until Composer 2.0 is stable and commonly used?

@maxwagner-dev
Copy link

Got the same error as @enumag . My workaround currently is setting amphp/file strict to version v1.0.0 instead of ^v1.0.0.
Maybe you can consider implement this Pull-Request to avoid any further problems, until version 2 of amphp/file is out.

@kelunik kelunik reopened this May 6, 2020
@kelunik kelunik changed the title Fix conflict with amphp/file Make conflict with amphp/file lax May 6, 2020
@kelunik kelunik merged commit 16ed360 into amphp:master May 6, 2020
@kelunik
Copy link
Member

kelunik commented May 6, 2020

Using amphp/http-client => ^4@dev should work for now then. :-)

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

Successfully merging this pull request may close these issues.

3 participants