drupal-composer / drupal-packagist

:package: Drupal Packagist server to automatically build package information from projects on drupal.org
http://packagist.drupal-composer.org
28 stars 4 forks source link

Requirement recursion broken #55

Closed geek-merlin closed 8 years ago

geek-merlin commented 8 years ago

How to reproduce:

What is verrry strange: This succeeds: composer require "drupal/entity_view_mode:7.*.*@dev"

geek-merlin commented 8 years ago

A finding that might or might not be connected:

Debugging shows that package info contains wrong package name, (and i guess this confuses one code path but not the other): This packagist json taken from that and that list for entity_view_mode erroneously has "easy_booking" package keys. Or is this intended?

geek-merlin commented 8 years ago

An explicit way how to run into this: composer require drupal/ableorganizer:@dev ... drupal/ableorganizer 7.1.x-dev requires drupal/views_data_export 7.* -> no matching package found.

But there is.

webflo commented 8 years ago

The stability-flags don't work recursive if you require a package. You should add minimum-stability and prefer-stable to your composer.json. We do this by default in D8 but not in D7.

"minimum-stability": "dev",
"prefer-stable": true

I think everything works as intended.

geek-merlin commented 8 years ago

Thanks flo. Of course i added those lines in the root composer.json, so that should not be the problem

webflo commented 8 years ago

Sorry, i don't understand the issue completely. Lets use a concrete example e.g. drupal/easy_booking.

composer require drupal/easy_booking fails with the following message.

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

  Problem 1
    - drupal/easy_booking 7.2.x-dev requires drupal/fe_block 7.* -> no matching package found.
    - drupal/easy_booking 7.2.1 requires drupal/fe_block 7.* -> no matching package found.
    - drupal/easy_booking 7.2.0-beta1 requires drupal/fe_block 7.* -> no matching package found.
    - drupal/easy_booking 7.2.0-beta requires drupal/fe_block 7.* -> no matching package found.
    - Installation request for drupal/easy_booking ^7.2 -> satisfiable by drupal/easy_booking[7.2.0-beta, 7.2.0-beta1, 7.2.1, 7.2.x-dev].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

Composer could not install easy_booking because of the dependency on fe_block. fe_block is part of Features Extra. Submodules are not directly available on Drupal Packagist. There are two workarounds i am aware of.

  1. Explicitly require drupal/features_extra before drupal/easy_booking in your composer.json (drupal/features_extra contains a replace link and will fulfill the dependency on fe_block)
  2. Submit a patch to easy_bookings info file and replace dependencies[] = fe_block with dependencies[] = features_extra:fe_block. ("features_extra:" is a Project namespace. This is supported by D7 and Drupal-Packagist. see https://www.drupal.org/node/2299747, https://github.com/drupal-composer/drupal-parse-composer/commit/93cc017a9d8f1c9a54af15da0a349a2eb46df9cd)
geek-merlin commented 8 years ago

Yes i understand the problem about infering a project dependency from a module dependency and i'm aware of your #15 as a possible solution. That's not the issue.

So look at the example from my 3rd comment: composer create-project drupal/drupal-project:7.x@dev test (now go to test dir and add minimum-stability and prefer-stable) composer require drupal/ableorganizer:@dev ... drupal/ableorganizer 7.1.x-dev requires drupal/views_data_export 7.* -> no matching package found.

and note that views_data_export is a project of its own and has a package.

I'm really getting mad at this.

webflo commented 8 years ago

Ok, lets see. https://travis-ci.org/drupal-composer/drupal-project/builds/117525069

Added the two flags by default in https://github.com/drupal-composer/drupal-project/commit/9b60927038e9df97db11f2a1980102a9e76457c6

geek-merlin commented 8 years ago

Urps... when i tried to investigate that further i could not reproduce it in such a simple way. (Typo? Too tired?...) Closing for now, i'll open a cleaner ticket if it comes back. Thanks alas!!