From 9e54290581cd69b0919a456c9ea0f0304fae5ad0 Mon Sep 17 00:00:00 2001 From: Randy Fay Date: Mon, 16 Nov 2026 11:20:45 -0700 Subject: [PATCH] fix: pin Drush below 15 so Drupal 12 workspaces finish setup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Short Summary (TL;DR) Drupal 12 workspaces hang after "✓ Drush installed", because Drush 15.x-dev now ships a `drush` stub that calls itself forever. The templates now require `drush/drush:<15`, which gives Drupal 12 Drush 14.x and leaves Drupal 11 on Drush 13. ## The Issue Since the 2026-11-16 nightly run, every Drupal 12 job in the Drupal and Drupal Contrib integration tests fails. The workspace setup logs `✓ Drush installed`, prints nothing for about 20 minutes, then the job fails with `agent is shutting down`. Drupal 11 jobs still pass. On 2026-11-16 at 02:31 UTC, Drush's `15.x` branch landed drush-ops/drush#6673, "Remove most of Drush. Most commands remain callable via Drupal core's `dr`". It replaced `vendor/drush/drush/drush` with: ```sh #!/usr/bin/env sh echo "Instead of calling `drush`, call `dr`" >&2 exit 1 ``` The backticks inside double quotes run `drush` as a command substitution, so every `drush` call starts another `drush`, and none of them ever returns. The setup's next step, `ddev drush status`, never finishes. `ddev composer require drush/drush` has no version constraint. Drush 15.x-dev conflicts with `drupal/core` < 12.0, so Drupal 12 gets 15.x-dev and Drupal 11 gets 13.x. ## How This PR Solves The Issue Every place that adds Drush now requires `drush/drush:<15`: | File | Change | | --- | --- | | `drupal-core/template.tf` | `ddev composer require "drush/drush:<15"` | | `drupal-core/scripts/test-issue-branches.sh` | Same | | `drupal-contrib/template.tf` | `require-dev` value `"<15"` instead of `"*"` | | `drupal-contrib/scripts/test-issue-branches.sh` | `composer require --dev "drush/drush:<15"` | | `drupal-core/README.md` | Same command in the manual instructions | Drush 14.x-dev only conflicts with `drupal/core` < 11.3, so it supports Drupal 12. Drupal 11 still resolves to Drush 13.8.x, the newest stable release. Moving Drupal 12 to Drupal core's `dr` command is a separate, larger change. ## Manual Testing Instructions Create a Drupal 12 workspace from this branch's template on staging: ```bash coder create d12-drush-test --template drupal-core --use-parameter-defaults \ --parameter "vscode_extensions=[]" --parameter drupal_version=12 \ --parameter issue_fork= --parameter issue_branch= --parameter install_profile=minimal \ --parameter drupal_site_public=false --yes coder ssh d12-drush-test -- tail -5 /tmp/drupal-setup.log # Expect the setup to continue past "✓ Drush installed" and finish the site install coder ssh d12-drush-test -- 'cd ~/drupal-core && ddev composer show drush/drush | grep versions' # Expect "versions : * 14.x-dev" coder delete d12-drush-test --yes ``` ## Automated Testing Overview - Claude Code reproduced the hang on staging-coder.ddev.com with a Drupal 12 workspace from `main`. Composer installed `15.x-dev` at commit 942cf6c, and `ps` showed `sh .../vendor/drush/drush/drush` processes starting again and again. - Claude Code ran `terraform fmt -recursive -check`, `make validate` and `make test-templates`, which passed with 22 tests. - This PR's Drupal and Drupal Contrib integration runs exercise the fix on Drupal 12. Co-Authored-By: Claude Opus 5.5 --- drupal-contrib/scripts/test-issue-branches.sh | 2 +- drupal-contrib/template.tf | 2 +- drupal-core/README.md | 2 +- drupal-core/scripts/test-issue-branches.sh | 2 +- drupal-core/template.tf | 4 +++- 5 files changed, 7 insertions(+), 5 deletions(-) diff --git a/drupal-contrib/scripts/test-issue-branches.sh b/drupal-contrib/scripts/test-issue-branches.sh index 2fb2b19..a1190c9 100755 --- a/drupal-contrib/scripts/test-issue-branches.sh +++ b/drupal-contrib/scripts/test-issue-branches.sh @@ -132,7 +132,7 @@ for SPEC in "${TESTS[@]}"; do # --- Add drush as require-dev and run ddev poser --- if [ ! -f web/index.php ]; then log "Adding drush as require-dev..." - ddev exec composer require --dev drush/drush --no-update --no-interaction 2>&1 | tail -5 + ddev exec composer require --dev "drush/drush:<15" --no-update --no-interaction 2>&1 | tail -5 log "Running ddev poser..." if ! ddev poser 2>&1 | tail -10; then diff --git a/drupal-contrib/template.tf b/drupal-contrib/template.tf index 128bbb4..f5ddacf 100644 --- a/drupal-contrib/template.tf +++ b/drupal-contrib/template.tf @@ -745,7 +745,7 @@ COMPOSE_EOF # Direct JSON edit (not `composer require`) per ddev-drupal-contrib README. log_setup "Adding drush to require-dev..." update_status "⏳ drush: Adding to composer.json..." - jq '.["require-dev"]["drush/drush"] = "*"' composer.json > composer.json.tmp && mv composer.json.tmp composer.json + jq '.["require-dev"]["drush/drush"] = "<15"' composer.json > composer.json.tmp && mv composer.json.tmp composer.json # Allow all Composer plugins in this dev environment. Composer 2.2+ blocks # unknown plugins by default; modules can pull in arbitrary plugins (e.g. diff --git a/drupal-core/README.md b/drupal-core/README.md index 7733d0b..81a3593 100644 --- a/drupal-core/README.md +++ b/drupal-core/README.md @@ -125,7 +125,7 @@ ddev start ddev add-on get amateescu/ddev-drupal-dev ddev restart ddev composer install -ddev composer require drush/drush +ddev composer require "drush/drush:<15" ddev drush si -y demo_umami --account-pass=admin ``` diff --git a/drupal-core/scripts/test-issue-branches.sh b/drupal-core/scripts/test-issue-branches.sh index c98f613..117af4b 100755 --- a/drupal-core/scripts/test-issue-branches.sh +++ b/drupal-core/scripts/test-issue-branches.sh @@ -148,7 +148,7 @@ for PAIR in "${TESTS[@]}"; do ddev composer install 2>&1 || COMPOSER_EXIT=$? if [ "$COMPOSER_EXIT" = "0" ]; then - ddev composer require drush/drush 2>&1 | tail -5 + ddev composer require "drush/drush:<15" 2>&1 | tail -5 fi # --- Record result --- diff --git a/drupal-core/template.tf b/drupal-core/template.tf index 63b5ab2..aee38b1 100644 --- a/drupal-core/template.tf +++ b/drupal-core/template.tf @@ -997,7 +997,9 @@ TESTENV_EOF if [ "$SETUP_FAILED" != "true" ]; then log_setup "Adding Drush to composer.local.json..." update_status "⏳ Drush install: In progress..." - if ddev composer require drush/drush >> "$SETUP_LOG" 2>&1; then + # Drush 15 (Drupal 12+) replaced the drush command with a stub that recurses + # forever; 14.x still supports Drupal 12. See drush-ops/drush#6673. + if ddev composer require "drush/drush:<15" >> "$SETUP_LOG" 2>&1; then log_setup "✓ Drush installed" update_status "✓ Drush install: Success" else