Problem/Motivation
Currently, some of core's require-dev constraints constrain those packages to non-latest major versions. This prevents an application from installing both drupal/core-dev and other packages that might require later versions of the same dependencies. For example, core currently constrains symfony/filesystem to ^4.4, but Drush would like to be able to use symfony/filesystem v5 (see https://github.com/drush-ops/drush/pull/5264 which broke compatibility with drupal/core-dev and is about to be reverted until this issue is fixed).
Steps to reproduce
Proposed resolution
Broaden our require-dev constraints (e.g., change the symfony/filesystem one to ^4.4 || ^5.4 or maybe even ^4.4 || ^5.4 || ^6.1) where doing so still passes all of our tests (on the "updated deps" DrupalCI job).
| Comment | File | Size | Author |
|---|---|---|---|
| #11 | 3315217-11.patch | 3.13 KB | effulgentsia |
Issue fork drupal-3315217
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mikemadison commentedComment #4
gábor hojtsySent for a retest as the fails seems to be unrelated JS fails.
Also as we verbally discussed Drupal 9.5 is also affected. I find it strange that Drush 11 would not be compatibe anymore with Drupal 9 as per https://www.drush.org/latest/install/ that is the ONLY version of Drush that is even supposed to be compatible with Drupal 9 at this point. So I think this is a drush bug?
Comment #5
mikemadison commentedI've cross posted the issue on Github for the drush team as well, https://github.com/drush-ops/drush/issues/5277
Comment #6
moshe weitzman commented@Gabor Drush is compatible with drupal/core:9. We have many many tests that confirm that. It is the variant drupal/core-dev that is the issue. It would be better to adjust Drupal as the patch here proposes, but I'm adjusting Drush now to stop inconvenience for core-dev users.
Comment #7
gábor hojtsyIs it possible to set up Drush testing for core-dev as well?
Comment #8
effulgentsia commentedGiven #6, I'm recategorizing this as a feature request. I'm +1 to the feature request, and not just for symfony/filesystem, so retitling to be broader.
Since #3225966-46: Consider loosening our constraint to allow sites to install Guzzle 6 or 7, or otherwise handle PHP 8.1 deprecations for Guzzle 6, we already have the DrupalCI jobs running that would ensure we're testing both the composer.lock version and the maximum allowed, so I don't see much, if any, downside to a more permissive range.
Comment #9
alexpottOne thing that this makes a bit trickier is updating dependencies. What should we be keeping them on? The highest possible minor and bug in lowest possible possible major I think. Composer doesn't make this that simple - it's better now because the --with option will allow us to do this but it's still not that simple - we might need to add our own composer command to do this reliably for us.
Comment #10
alexpott#9 should have also said that I'm +1 to relaxing our constraints to be compatible with as many versions as possible.
Comment #11
effulgentsia commentedGood point on #9. In addition to a composer command that facilitates the update, we can also add a precommit check that ensures that the lock file is pinned to the lowest allowed major.
This patch does not add either. All it does is relax all the require-dev constraints in order to see if tests pass.
Comment #12
effulgentsia commentedCool that tests passed! However, the update wasn't able to get to the latest major versions. According to https://dispatcher.drupalci.org/job/drupal_patches/152736/consoleFull, at 8:28:15:
symfony/phpunit-bridgewas updated to 6.1.symfony/browser-kit,symfony/css-selector,symfony/dom-crawler,symfony/filesystem,symfony/finder, andsymfony/lockwere all updated from 4.4 to 5.4, but not to 6.1.symfony/var-dumperwas already constrained to a minimum of 5.4, and was not updated to 6.1.symfony/error-handlerstayed on 4.4.phpspec/prophecystayed on 1.12.So other constraints prevented these from upgrading to their latest majors. That might be okay, but it's something to keep in mind when reading the composer.json changes and remembering that the "updated deps" test isn't necessarily able to update to the highest listed majors, and is therefore not testing them.
Meanwhile, Needs work for #9.
Comment #13
effulgentsia commentedThat other constraint is the config.platform.php setting in Drupal's root composer.json. Since that's an artifact of drupal/drupal and not of what Drupal applications (e.g., ones installed from drupal/recommended-project) would have, I opened #3316100: Unset the config.platform.php constraint from DrupalCI's "updated deps" jobs.
Comment #14
ioanmar commentedThe patch didn't apply to my 9.5.2 build, but I was able to resolve the dependency issue.
Running
composer require drupal/core-dev:9.5.2 --dev --update-with-all-dependenciesreturnedWhile researching online, I stumbled upon this comment and I tried to first uninstall drush, then install version 9.5.2 of drupal/core-dev (10 not an option, composer still complains) and finally reinstall drush/drush. This worked!
composer remove drush/drushcomposer require drupal/core-dev:9.5.2 --dev --update-with-all-dependenciescomposer require drush/drush