Skip to content

fix: keep Homebrew last on PATH, drop unused zellij - #264

Open
rfay wants to merge 2 commits into
mainfrom
20261118_rfay_homebrew_path_last
Open

rfay wants to merge 2 commits into
mainfrom
20261118_rfay_homebrew_path_last

Conversation

@rfay

@rfay rfay commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Short Summary (TL;DR)

Claude Code runner sessions and ~/.coder-startup.sh put Homebrew ahead of the system PATH, so they used Homebrew's curl, which doesn't trust the mkcert CA. This change puts Homebrew last, as the image already does, so curl https://<project>.ddev.site works there without extra steps. It also drops the unused zellij formula, the only reason Homebrew's curl was installed.

The Issue

In a Claude Code self-hosted runner session, curl https://<project>.ddev.site fails:

curl: (60) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)

mkcert -install doesn't help, although the workspace startup already runs it.

The image puts Homebrew last on PATH, so its formulas never shadow system tools. Two places reverse that order:

  • claude-runner-loop.sh.tftpl, which starts every runner session
  • The ~/.coder-startup.sh user hook in all three templates

Nobody installs Homebrew's curl on purpose. It comes in as a dependency of zellij. It uses Homebrew's own CA bundle, which Homebrew copies from the system store once, when the image is built. The mkcert CA only reaches the system store at workspace start, so that copy never has it. The system curl reads /etc/ssl/certs and trusts the CA.

How This PR Solves The Issue

The four PATH lines now put Homebrew after $PATH instead of before it, as the image and ~/.bashrc already do. The system curl, openssl, util-linux, xz, zstd, and ncurses tools then win over Homebrew's copies. Tools that only Homebrew provides, such as go, bats, golangci-lint, and claude, still resolve from Homebrew.

The image also stops installing zellij. It came in with #172 without explanation, and nothing in the repository uses it. It was the only formula that depended on Homebrew's curl, openssl@4, and ca-certificates, so new images no longer install them.

Manual Testing Instructions

  1. Push the freeform template and restart a workspace that has the self-hosted runner enabled.
  2. Start a Claude Code session on that runner, and start a DDEV project in it.
  3. In the session, run command -v curl. Expect /usr/bin/curl.
  4. Run curl -sSI https://<project>.ddev.site. Expect an HTTP status line and no certificate error.
  5. Run command -v go bats claude. Expect paths under /home/linuxbrew/.linuxbrew/bin.

For the startup hook, put command -v curl > /tmp/hook-curl.txt in ~/.coder-startup.sh, restart the workspace, and expect /usr/bin/curl in that file.

Automated Testing Overview

There are no new tests, because the change is in shell text that the Terraform tests don't run. Claude Code ran both PATH orders in an existing workspace with a running DDEV project. With Homebrew first, curl was Homebrew's and failed with the error above. With Homebrew last, curl was /usr/bin/curl and returned HTTP 200, and go, bats, claude, and golangci-lint still came from Homebrew. Terraform was not available locally, so make validate and make test-templates run only in CI.

Release/Deployment Notes

Push all three templates. Running workspaces get the PATH change at their next restart.

The zellij removal takes effect in the next image build. Existing workspaces keep zellij and Homebrew's curl in their persistent /home/linuxbrew volume. To remove them, run brew uninstall zellij && brew autoremove. The PATH change keeps Homebrew's curl from shadowing the system one in the meantime.

https://claude.ai/code/session_01UrTUMyUJqyV4ePwb7PKcWo


Generated by Claude Code

## Short Summary (TL;DR)

Claude Code runner sessions and `~/.coder-startup.sh` put Homebrew ahead of the system PATH, so they used Homebrew's `curl`, which doesn't trust the mkcert CA. This change puts Homebrew last, as the image already does, so `curl https://<project>.ddev.site` works there without extra steps.

## The Issue

In a Claude Code self-hosted runner session, `curl https://<project>.ddev.site` fails:

```text
curl: (60) SSL certificate OpenSSL verify result: unable to get local issuer certificate (20)
```

`mkcert -install` doesn't help, although the workspace startup already runs it.

The image puts Homebrew last on PATH, so its formulas never shadow system tools. Two places reverse that order:

- `claude-runner-loop.sh.tftpl`, which starts every runner session
- The `~/.coder-startup.sh` user hook in all three templates

Nobody installs Homebrew's `curl` on purpose. It comes in as a dependency of `zellij`. It uses Homebrew's own CA bundle, which Homebrew copies from the system store once, when the image is built. The mkcert CA only reaches the system store at workspace start, so that copy never has it. The system `curl` reads `/etc/ssl/certs` and trusts the CA.

## How This PR Solves The Issue

The four PATH lines now put Homebrew after `$PATH` instead of before it, as the image and `~/.bashrc` already do. The system `curl`, `openssl`, util-linux, `xz`, `zstd`, and ncurses tools then win over Homebrew's copies. Tools that only Homebrew provides, such as `go`, `bats`, `golangci-lint`, and `claude`, still resolve from Homebrew.

Removing Homebrew's `curl` was not possible, because `zellij` depends on it.

## Manual Testing Instructions

1. Push the `freeform` template and restart a workspace that has the self-hosted runner enabled.
2. Start a Claude Code session on that runner, and start a DDEV project in it.
3. In the session, run `command -v curl`. Expect `/usr/bin/curl`.
4. Run `curl -sSI https://<project>.ddev.site`. Expect an HTTP status line and no certificate error.
5. Run `command -v go bats claude`. Expect paths under `/home/linuxbrew/.linuxbrew/bin`.

For the startup hook, put `command -v curl > /tmp/hook-curl.txt` in `~/.coder-startup.sh`, restart the workspace, and expect `/usr/bin/curl` in that file.

## Automated Testing Overview

There are no new tests, because the change is in shell text that the Terraform tests don't run. Claude Code ran both PATH orders in an existing workspace with a running DDEV project. With Homebrew first, `curl` was Homebrew's and failed with the error above. With Homebrew last, `curl` was `/usr/bin/curl` and returned HTTP 200, and `go`, `bats`, `claude`, and `golangci-lint` still came from Homebrew. Terraform was not available locally, so `make validate` and `make test-templates` run only in CI.

## Release/Deployment Notes

Push all three templates. Running workspaces get the change at their next restart.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrTUMyUJqyV4ePwb7PKcWo
@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Previews

Site Preview
docs.coder.ddev.com (docs/content, built by Read the Docs) https://coder-ddev--264.org.readthedocs.build/
start.coder.ddev.com (docs/*.html, deployed to gh-pages) https://start.coder.ddev.com/pr-preview/pr-264/

The landing-page preview creates workspaces on staging-coder.ddev.com, and its Documentation links open the docs preview. Read the Docs posts its build status and changed pages in its own comment; the docs preview may take a minute or two after a push to update.

Updated for dcd82ca

zellij came in with #172 without explanation, and nothing in the repository uses it. It was the only formula that depended on Homebrew's curl, openssl@4, and ca-certificates, so new images no longer install them.

Existing workspaces keep zellij and its dependencies in their persistent /home/linuxbrew volume. To remove them, run `brew uninstall zellij && brew autoremove`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UrTUMyUJqyV4ePwb7PKcWo
@rfay rfay changed the title fix: keep Homebrew last on PATH for runner sessions and the startup hook fix: keep Homebrew last on PATH, drop unused zellij Nov 18, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants