Allow installing modules on next major that have a drupal/core dependency in their composer.json

Migrated issue

Reported by: berdir

Related to !167 (merged)

Problem/Motivation

See https://git.drupalcode.org/project/redirect/-/jobs/1196104

redirect composer.json currently require drupal/core 9 or 10 explicitly. That causes the current next major composer build step to fail as it results in an invalid combination of drupal/core dependencies.

It tries to fix that by removing drupal/core-recommended if drupal/core exists in require-dev, but I think that's the wrong approach and a leftover of the drupalspoons script which didn't support anything like next/previous major.

CI should define and enforce the used core version depending on the job, so I think a better fix would be to ignore any drupal/core requirement

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Related issue: Issue #3414505

Edited by drupalbot