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

Error when tried to update to 5.0.0 alpha, conflicts with drupal/core-dev #637

Open
Eduardo-Morales-Alberti opened this issue Feb 20, 2023 · 13 comments

Comments

@Eduardo-Morales-Alberti
Copy link

Eduardo-Morales-Alberti commented Feb 20, 2023

Problem

Could not update to 5.0.0 alpha because of conflicts with drupal/core-dev. I required the 5.0.0 alpha because I need to remove the goutte-drive requirement to use Guzzle 7 fixed on commit 2ab66a7

Possible Solution

I am not sure if this is the problem, drupalextension and core-dev require the same projects different repositories:
https://github.com/jhedstrom/drupalextension/blob/v5.0.0alpha1/composer.json#L27

  "require": {
...
    "behat/mink-browserkit-driver": "^2.1.0",
...

https://github.com/drupal/core-dev/blob/9.5.3/composer.json#L15

    "require": {
...
        "friends-of-behat/mink-browserkit-driver": "^1.4",
...

Error:

[email protected]:/var/www/html $ composer require "drupal/drupal-extension:v5.0.0alpha1 as v4.3.1" drupal/core-dev:~9.5.3 friends-of-behat/mink-browserkit-driver:^1.6.1  -W --dev
./composer.json has been updated
Running composer update drupal/drupal-extension drupal/core-dev friends-of-behat/mink-browserkit-driver --with-all-dependencies
Gathering patches for root package.
Loading composer repositories with package information
Info from https://repo.packagist.org: #StandWithUkraine
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/drupal-extension v5.0.0alpha1 as v4.3.1 -> satisfiable by drupal/drupal-extension[v5.0.0alpha1].
    - Only one of these can be installed: behat/mink-browserkit-driver[v2.1.0, 2.x-dev], friends-of-behat/mink-browserkit-driver[v1.6.1]. friends-of-behat/mink-browserkit-driver replaces behat/mink-browserkit-driver and thus cannot coexist with it.
    - drupal/drupal-extension v5.0.0alpha1 requires behat/mink-browserkit-driver ^2.1.0 -> satisfiable by behat/mink-browserkit-driver[v2.1.0, 2.x-dev].
    - Root composer.json requires friends-of-behat/mink-browserkit-driver ^1.6.1 -> satisfiable by friends-of-behat/mink-browserkit-driver[v1.6.1].
@Berdir
Copy link
Contributor

Berdir commented Feb 20, 2023

Your proposed change would instead conflict with D10: https://github.com/drupal/core-dev/blob/10.0.x/composer.json.

Do you really need drupal/core-dev? Are you running phpunit browser tests in the same environment? If not, you could drop the core-dev dependency and only require what you actually need.

@jhedstrom
Copy link
Owner

Hmm, it is fairly common I think to run phpunit tests (based on core's base classes) in the same environments as Behat, so ideally we'd fix this conflict with drupal/core-dev...

@Berdir
Copy link
Contributor

Berdir commented Feb 20, 2023

We could be compatible with two different versions of the same package, but we're talking about two different packages here, I don't think that's possible.

You can still explicitly require phpunit and other dependencies, just not the drupal/core-dev wrapper.

@Eduardo-Morales-Alberti
Copy link
Author

I think friends-of-behat/mink-browserkit-driver was forked to be compatible with PHP 8 and higher versions of Symfony, it could be deprecated, and should be changed on core-dev.
Maybe this is not the place.

@Eduardo-Morales-Alberti
Copy link
Author

Created PR on core-dev https://github.com/drupal/core-dev/pull/4/files, sorry for the noise.

@jhedstrom
Copy link
Owner

It looks like from the comment on that PR you'll need to open an issue on drupal.org since the github repo is auto-generated.

@Berdir
Copy link
Contributor

Berdir commented Feb 22, 2023

Core isn't going to change this, it will not introduce possibly breaking changes in Drupal 9. The main point of drupal/core-dev is to be able to reliable run the same phpunit tests that core (and contrib) contains.

If you can't update to D10 yet then the only option is to not require drupal/core-dev but rely on the desired dependencies and versions directly. Might be worth mentioning this in the readme/release notes of 5.x

@jhedstrom
Copy link
Owner

If the friends-of-behat one is truly deprecated, wouldn't core update to the non-deprecated one? I'm having trouble finding documentation about the deprecations or preferred package though. This https://github.com/minkphp/MinkBrowserKitDriver seems more active than the friends one...

@jhedstrom jhedstrom reopened this Feb 22, 2023
@Berdir
Copy link
Contributor

Berdir commented Feb 22, 2023

if the friends-of-behat one is truly deprecated, wouldn't core update to the non-deprecated one?

That's exactly what core did, but only in D10, as it was apparently considered a BC breaking change or maybe just not important enough. I wasn't involved in the issue and don't know the exact reason. But I can guarantee you that this will not be changed in a 9.5 patch release, so we just have to live with it.

@jhedstrom
Copy link
Owner

ah, ok, I misunderstood.

@Eduardo-Morales-Alberti
Copy link
Author

Created issue on core https://www.drupal.org/project/drupal/issues/3343911

@AlexSkrypnyk
Copy link

AlexSkrypnyk commented Apr 25, 2023

I'd like to summarise the above (after gathering information from the multiple sources):

  1. Drupal Extension v5 is currently compatible with D9 and is tested to be compatible (in CI).

  2. However, due to the issue described here it is not installable if the consumer site uses drupal/core-dev metapackage

  3. Currently, CI for Drupal Extension does not use drupal/core-dev, which "masks" this problem.

  4. @Berdir and @catch have discussed this on Slack and per @Berdir's comment in Slack:

Note that the mentioned incompatibility is with behat Drupal extension 5.x alpha. Committing this would in turn then cause the opposite conflict with the stable 4.x releases.

  1. It is now not clear what the intention of Drupal Extension to support D9 - supporting only sites that do not use drupal/core-dev is not a feasible option (https://github.com/drupal-composer/drupal-project prescribes it as a best practice).

@Berdir
Can we mark friends-of-behat/mink-browserkit-driver (or whatever the conflict is) as a conflict for 9.5.x branch and action the change for 9.6.x branch (so that at least next minor D9 would support v5). The patch in https://www.drupal.org/project/drupal/issues/3343911 has passed CI, so technically it looks like it is stable.
I'm wondering if more considerations could be given by the core team.

@Berdir
Copy link
Contributor

Berdir commented Apr 26, 2023

There is no next minor Drupal 9 version, Drupal 9 is EOL in December. Either stick to using 3.x on Drupal 9 or don't use drupal/core-dev. And the medium/long-term fix that you have to do anyway this year is upgrading to Drupal 10.

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.

4 participants