Composer unpack plugin runs into issue when requiring a dev-release of a module

Created on 27 June 2025, 9 days ago

Problem/Motivation

When you require a dev release of something, e.g. with composer require drupal/modulename:1.0.x-dev then the unpack plugin fails with an error message "drupal/modulename does not resolve to a package." and quits.

When requiring with a proper constraint, e.g. composer require drupal/modulename:^1.0, then there is no error, even if only the dev release is available and gets downloaded.

πŸ› Bug report
Status

Active

Version

11.0 πŸ”₯

Component

composer

Created by

πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @jurgenhaas
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Can you add your actual steps to reproduce this issue. I cannot reproduce this. Here's the output of composer --version for me...

    Composer version 2.7.7 2024-06-10 22:11:12
    PHP version 8.3.21 (/opt/homebrew/Cellar/php@8.3/8.3.21/bin/php)
    

    Here's what I'm doing:

    composer create-project drupal/recommended-project:^11 recipe-test
    composer require drupal/events:1.0.x-dev
    composer require drupal/inline_translation:1.x-dev
    composer require drupal/eca:3.0.x-dev drupal/modeler_api:1.0.x-dev
    

    The events recipe is successfully unpacked and the modules are installed. No messages from the recipe plugin.

    I've also updated to composer 2.7.7 and it does not happen for that version either.

  • πŸ‡©πŸ‡ͺGermany rkoller NΓΌrnberg, Germany
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    Steps to reproduce from @rkoller

    composer create-project drupal/recommended-project:^11 recipe-test
    composer require drupal/eca drupal/bpmn_io
    composer require drupal/eca:3.0.x-dev drupal/bpmn_io:3.0.x-dev drupal/modeler_api:1.0.x-dev
    

    On the second require you will see drupal/eca does not resolve to a package. in the output.

  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ
  • Merge request !12531Use the interface doh β†’ (Closed) created by alexpott
  • Pipeline finished with Success
    8 days ago
    Total: 502s
    #533792
  • πŸ‡¬πŸ‡§United Kingdom alexpott πŸ‡ͺπŸ‡ΊπŸŒ

    I've tried to write a test for this but it is hard - I can;t get composer to use an alias for our path repositories used in testing.

    I've now got even less steps to cause the problem

    composer create-project drupal/recommended-project:^11 recipe-test
    cd recipe-test
    composer require "drupal/inline_translation:1.x-dev as 1.0.0"
    

    But doing $this->runComposer('require "fixtures/module-b:2.0.1 as 3.0.0"') in a \Drupal\Tests\Composer\Plugin\Unpack\Functional\UnpackRecipeTest does not cause the problem :(

  • πŸ‡©πŸ‡ͺGermany jurgenhaas Gottmadingen

    I've tested this successfully. With the commands from #7 I wasn't able to reproduce the issue, but the following showed the error:

    composer create-project drupal/recommended-project:^11 recipe-test
    cd recipe-test
    composer require drupal/eca # <= This installs version 2.0
    composer require drupal/eca:3.0.x-dev drupal/modeler_api:1.0.x-dev # <= This shows the expected error
    

    Then I tried again and patched with this MR first. Then the error was gone.

    • catch β†’ committed 50cbe65c on 11.2.x
      Issue #3532796 by alexpott, jurgenhaas, rkoller: Composer unpack plugin...
    • catch β†’ committed a38e8d0f on 11.x
      Issue #3532796 by alexpott, jurgenhaas, rkoller: Composer unpack plugin...
  • πŸ‡¬πŸ‡§United Kingdom catch

    Committed/pushed to 11.x and cherry-picked to 11.2.x, thanks!

Production build 0.71.5 2024