Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Tried to install Commerce, got a crash, cause drupal/entity isn't installable.
It thinks that drupal/entity is the Entity module that shipped with Drupal core in the early 8.x alphas, instead of the contrib module.
Looks like the idea of exporting core modules as Composer packages won't really work, for example you have the BigPipe module as both a contrib module and a core module (from 8.1)
Full output:
Problem 1
- drupal/drupal 8.0-alpha7 requires doctrine/common dev-bmaster#99b44f52a1b844f9c4c34e618b160664d5c27daf -> no matching package found.
- Installation request for drupal/commerce 2.0.x-dev -> satisfiable by drupal/commerce[2.0.x-dev].
- Conclusion: remove drupal/drupal 8.1.9999999.9999999-dev
- Conclusion: don't install drupal/drupal 8.1.x-dev
- drupal/commerce 2.0.x-dev requires drupal/entity * -> satisfiable by drupal/entity[8.0.0-alpha14, 8.0.0-alpha13, 8.0.0-alpha12, 8.0.0-alpha11, 8.0.0-alpha10, 8.0.0-alpha9, 8.0.0-alpha8, 8.0.0-alpha7, 8.0.0-alpha6, 8.0.0-alpha5, 8.0.0-alpha4, 8.0.0-alpha3, 8.0.0-alpha2].
- drupal/entity 8.0.0-alpha14 requires drupal/drupal 8.0.0-alpha14 -> satisfiable by drupal/drupal[8.0.0-alpha14].
- drupal/entity 8.0.0-alpha13 requires drupal/drupal 8.0.0-alpha13 -> satisfiable by drupal/drupal[8.0-alpha13].
- drupal/entity 8.0.0-alpha12 requires drupal/drupal 8.0.0-alpha12 -> satisfiable by drupal/drupal[8.0-alpha12].
- drupal/entity 8.0.0-alpha11 requires drupal/drupal 8.0.0-alpha11 -> satisfiable by drupal/drupal[8.0-alpha11].
- drupal/entity 8.0.0-alpha10 requires drupal/drupal 8.0.0-alpha10 -> satisfiable by drupal/drupal[8.0-alpha10].
- drupal/entity 8.0.0-alpha9 requires drupal/drupal 8.0.0-alpha9 -> satisfiable by drupal/drupal[8.0-alpha9].
- drupal/entity 8.0.0-alpha8 requires drupal/drupal 8.0.0-alpha8 -> satisfiable by drupal/drupal[8.0-alpha8].
- drupal/entity 8.0.0-alpha7 requires drupal/drupal 8.0.0-alpha7 -> satisfiable by drupal/drupal[8.0-alpha7].
- drupal/entity 8.0.0-alpha6 requires drupal/drupal 8.0.0-alpha6 -> satisfiable by drupal/drupal[8.0-alpha6].
- drupal/entity 8.0.0-alpha5 requires drupal/drupal 8.0.0-alpha5 -> satisfiable by drupal/drupal[8.0-alpha5].
- drupal/entity 8.0.0-alpha4 requires drupal/drupal 8.0.0-alpha4 -> satisfiable by drupal/drupal[8.0-alpha4].
- drupal/entity 8.0.0-alpha3 requires drupal/drupal 8.0.0-alpha3 -> satisfiable by drupal/drupal[8.0-alpha3].
- drupal/entity 8.0.0-alpha2 requires drupal/drupal 8.0.0-alpha2 -> satisfiable by drupal/drupal[8.0-alpha2].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha14].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha13].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha12].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha11].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha10].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha9].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha8].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha7].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha6].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha5].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha4].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha3].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha2].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha10].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha11].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha12].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha13].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha2].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha3].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha4].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha5].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha6].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha8].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0-alpha9].
- Can only install one of: drupal/drupal[8.1.x-dev, 8.0.0-alpha14].
- Installation request for drupal/drupal 8.1.9999999.9999999-dev -> satisfiable by drupal/drupal[8.1.9999999.9999999-dev].
Comment | File | Size | Author |
---|---|---|---|
#7 | namespace_collisions.txt | 13.59 KB | Mixologic |
Comments
Comment #2
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedPlease share the composer.json. thanks!
Comment #3
MixologicThis is an artifact of not having namespaces for modules (vs projects which are namespaced) the workaround, which needs to be documented, is that any time a module has the exact same name as another that had already been processed, it namespaces the package name as
drupal/<projectname>_<modulename>
So, in this case, you can use
require drupal/entity_entity
and it will find the entity module from the entity project.The projects were processed in usage stat order, so that the most popular ones got the shorter name, which gave drupal core priority.
Comment #4
bojanz CreditAttribution: bojanz at Centarro for Bluespark commented@Mixologic
However, Drupal core hasn't had an entity module for years. The logic makes sense only for current core modules.
@webflo
I used core + "composer require drupal/commerce 2.0.x-dev".
Comment #5
MixologicSo additionally, a problem exists where the json generated by project_composer for commerce says drupal/entity, so project_dependency isnt able to accurately determine *which* entity module commerce is dependent upon.
The largest conflict we're going to likely run into with dependencies that have conflicting module names are most likely drupal core modules like bigpipe and entity. So perhaps drupal core modules should be namespaced as core_entity and core_bigpipe.
I'll make this change and see if that helps.
Comment #6
webflo CreditAttribution: webflo at UEBERBIT GmbH commentedWe have project namespaces for modules, Drupal Commerce could define entity:entity in its info file.
composer info drupal/entity --all
should list the versions from the contrib module as well. But it works only if a contrib module does not release version 8. Zen is already at 7 :/I have to think more about it. It wasn't an issue on Drupal-Packagist because we used replace instead of metapackages, and everything had a dependency to drupal/core (or drupal/drupal).
Comment #7
MixologicOkay, so we have fixed this issue by building a package namespace lookup table as the first step to creating the facade. This ensures that if a project has a dependency on a module, that dependency gets translated to the correct namespace.
Additionally, we are not storing package metadata for drupal core modules (drupal/) as any require for those, or dependency on those should already be fulfilled by drupal/core or drupal/drupal.
For the most part, this is fixed such that module migration either into or out of core itself shouldn't be as big of an issue.
There are still some module namespace collisions, mostly when a big project was split into smaller projects, but the impact is less severe.
Attached is a file of all the known namespace collisions in the map - this info should someday appear on project pages, but its not there yet.
Comment #8
MixologicNote that almost all of those namespace collisions are for d7 modules. there's only about 7 on there that are d8.
Comment #9
MixologicComment #10
MixologicOkay, so I see one other issue here.
There's two ways to specify dependencies, and ideally, they are in sync. Right now, I am relying on whatever is specified in the info.yml file as being a requirement of the module, and ignoring any dependencies specified in the composer.json if they are in the drupal/* namespace - this was to avoid the potential versioning collisions between drupal-packagist and the new in composer.json files (I wouldnt have any way of knowing if you are specifying semver versions or drupal-packagist).
So therefore commerce needs to expand the dependencies it has in the info.yml file to include its other dependencies as well as their constraints in order to allow it to work simultaneously with the drupal-packagist and the composer-facade.Comment #11
MixologicTurns out commerce was doing things a little bit differently, which also turns out to be a pretty fair use case to support.
We're no longer ignoring the composer.json as of #2746737: Modules with invalid composer.json versions and documentation of this usage is started here: #2754747: Document root composer.json details but should be moved to the docs page.
Comment #12
MixologicOnce I get everything deployed, we'll doublecheck that this works, and closed/fixed it then.
Comment #13
MixologicThis is all deployed now.
Comment #14
Mixologic