Fix spinning up local dev envs with ddev-drupal-contrib

Created on 23 April 2025, 2 months ago

Problem/Motivation

By following the setup steps defined in https://github.com/ddev/ddev-drupal-contrib the following command fails:

❯ ddev poser
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  8552  100  8552    0     0  32585      0 --:--:-- --:--:-- --:--:-- 32517
drupalConstraint=^11
core_version=11
Writing output to composer.contrib.json
No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires drupal/search_api_autocomplete 1.x-dev -> satisfiable by drupal/search_api_autocomplete[1.x-dev (alias of dev-1.x)].
    - drupal/search_api_autocomplete dev-1.x requires drupal/search_api ^1.0 -> satisfiable by drupal/search_api[dev-1.x, 1.0.0-alpha1, ..., 1.x-dev (alias of dev-1.x)] from composer repo (https://packages.drupal.org/8) but drupal/search_api dev-8.x-1.x is the root package and cannot be modified. See https://getcomposer.org/dep-on-root for details and assistance.
    - drupal/search_api_autocomplete 1.x-dev is an alias of drupal/search_api_autocomplete dev-1.x and thus requires it to be installed too.

touch: cannot touch 'web/core/.env': No such file or directory

This is caused by the recently merged change to 8.x-1.x branch: https://git.drupalcode.org/project/search_api/-/commit/998ab169e1c9f7da0...

Steps to reproduce

Proposed resolution

Remaining tasks

🐛 Bug report
Status

Active

Version

1.0

Component

General code

Created by

🇭🇺Hungary mxr576 Hungary

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

Merge Requests

Comments & Activities

  • Issue created by @mxr576
  • 🇭🇺Hungary mxr576 Hungary
  • Pipeline finished with Success
    2 months ago
    Total: 356s
    #479941
  • 🇦🇹Austria drunken monkey Vienna, Austria

    Thanks for reporting this issue and already providing an MR!
    Unfortunately hard to test whether this actually works … How confident are you in your solution? Any examples of other projects where this worked/helped?

  • 🇭🇺Hungary mxr576 Hungary

    I am quite confident, you do not need DDEV to reproduce this issue at all, just clone the project and try to run composer install inside the folder. It is going to fail the same way because Composer cannot resolve other dependency versions without the branch alias.

  • Pipeline finished with Skipped
    9 days ago
    #522813
  • 🇦🇹Austria drunken monkey Vienna, Austria

    When running composer install from inside the Git checkout of this module you’d also need to add the repositories entry for the Drupal Packagist repo, but yes, I then also had to add the branch alias for it to work.

    While I’m again not familiar enough with Ddev to confidently say whether this change works as intended or is even needed, it seems harmless enough and does fix at least something, so it should hopefully at least not cause any problems. I therefore merged it, hopefully it will help a few people.
    Thanks again!

  • Pipeline finished with Skipped
    9 days ago
    #522815
Production build 0.71.5 2024