symfony / recipes-contrib

Symfony Contrib Recipes Repositories

Home Page:https://github.com/symfony/recipes-contrib/blob/flex/main/RECIPES.md

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Travis build fails for packages with virtual dependency

lgeorget opened this issue · comments

Hello!

I've created a bundle (https://github.com/Meteo-Concept/hcaptcha-bundle) which depends on PSR-17 psr/http-factory-implementation and PSR-18 psr/http-client-implementation virtual packages, so that it doesn't require the user to install another HTTP client if said user already has a compliant one. For instance, it works with symfony/http-client on Symfony 4.4 and 5.x, and guzzlehttp/guzzle on Symfony 3.4.

The problem is that Travis is not aware of that and fails to install the bundle in the skeleton application because composer screams "meteo-concept/hcaptcha-bundle v1.0.1 requires psr/http-client-implementation ^1.0 -> no matching package found.".

Is there a way to get Travis to install a real implementation of the virtual packages?

Yeah... I've seen that.

There is a composer issue for this: composer/composer#6758
But is is unlikely that this will be fixed in the near future.

One thing that always would fix things is to install symfony/http-client and nyholm/psr7 on every job. That would practically fix all these issues. (But technically only for psr/http-client-implementation ^1.0).

I see.

Well, yes, I guess the easiest solution would be a "composer require ..." on every job with a proper choice for every existing virtual packages for every supported Symfony version. Virtual packages are not that common nowadays so it would not be that difficult. That might change though, so a composer solution would be nicer.

Thank you!