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

Unable to install DBAL on a fresh Laravel application due to type package #2905

Closed
timacdonald opened this issue Dec 20, 2023 · 6 comments
Closed
Milestone

Comments

@timacdonald
Copy link

timacdonald commented Dec 20, 2023

Hello,

Tim here from the Laravel core team 👋

I encountered an issue with the following code:

composer create-project laravel/laravel dbal-test
cd dbal-test
composer require doctrine/dbal

Carbon version: 2.72.1

PHP version: 8.2.11

I expected to get:

A successful installation of DBAL

But I actually get:

Your requirements could not be resolved to an installable set of packages.

We are currently trying to work out how to resolve this for our users. I've opened a PR on Laravel to conflict with the ^3.0 version of types package (laravel/framework#49438), however this causes existing application to no longer be able to update their version of the framework without running special composer commands.

Is there any way we can remove this package from the "require" and possibly add it to "suggest" or document that it should be installed if you are using Doctrine?

Thanks!

@taylorotwell
Copy link

taylorotwell commented Dec 20, 2023

Can we please get this fixed? 🫣

It’s a pretty big headache for us and I’m not sure why it needed to be added to a stable package like Carbon.

@kylekatarnls
Copy link
Collaborator

kylekatarnls commented Dec 20, 2023

Use:

composer require doctrine/dbal -W

(normally it's suggested by composer as the solution to install in the feedback message)

So it will update https://github.com/CarbonPHP/carbon-doctrine-types which makes the link between carbon dans dbal and avoid carbon to stretch with a range of compatibility.

@timacdonald
Copy link
Author

timacdonald commented Dec 20, 2023

Unfortunately that doesn’t allow the package to be installed. You must also specify the types package explicitly for composer to be able to install dbal.

composer create-project laravel/laravel dbal-test
cd dbal-test
composer require doctrine/dbal ❌
composer require doctrine/dbal -w ❌
composer require doctrine/dbal -W ❌
composer require doctrine/dbal:\* ❌
composer require doctrine/dbal carbonphp/carbon-doctrine-types ✅

@kylekatarnls
Copy link
Collaborator

Thanks for the feedback, for people having dbal conflict in non-Laravel app, -W worked fine, so I guess composer might hit some limit to resolve the dependency. But the fact that composer require doctrine/dbal carbonphp/carbon-doctrine-types works is the proof that the constraint is actually not blocking.

@kylekatarnls
Copy link
Collaborator

Thanks @timacdonald and @taylorotwell 🙏

Regarding pros and cons I could fine while investigating I think https://github.com/laravel/framework/pull/49438/files is the right move.

I'd close #2907 if it gets merged.

@kylekatarnls
Copy link
Collaborator

Fixed by laravel/framework#49438

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

Successfully merging a pull request may close this issue.

3 participants