Repository navigation
Put mise shims and Go/Cargo bins on PATH in login shells - #40
Merged
Merged
Conversation
Debian's /etc/profile resets PATH for login shells and the base image's
00-restore-env.sh only restores the PATH it saw at base-image build time, so
the ENV PATH added by this Dockerfile disappeared in `coder ssh`, VS Code
terminals and tmux windows ("tmux: command not found", "go: command not
found") even though CI's non-login init script saw everything.
Install /etc/profile.d/10-devcontainer-tools.sh (exports the mise variables and
prepends the tool dirs idempotently) and source it from /etc/bash.bashrc and
/etc/zsh/zshrc, as the devcontainer features used to do. The verify script now
also checks tool visibility from bash -l and zsh -l so this cannot regress
silently.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AihTX41wWUjfBk3c2A9h2Z
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
After #39, a fresh Coder workspace reported
tmux: command not foundandgo: command not foundovercoder ssh.Debian's
/etc/profileresetsPATHfor login shells, and the base image's/etc/profile.d/00-restore-env.shonly restores the PATH that existed when the base image was built. TheENV PATHadded by our Dockerfile therefore vanished in every login shell (coder ssh, VS Code terminals, new tmux windows). CI didn't catch it because envbuilder's init script is a non-login shell that inherits the image ENV directly. The old devcontainer features avoided the problem by patching the shell rc files.Fix
/etc/profile.d/10-devcontainer-tools.sh(shipped as.devcontainer/10-devcontainer-tools.sh), which exports the mise variables and prepends the cargo, Go and mise shims directories idempotently, and source it from/etc/bash.bashrcand/etc/zsh/zshrc.verify-devcontainer.shnow also checks thattmux,goandmiseresolve frombash -landzsh -l, so the envbuilder CI job fails if this regresses.Workaround for an already-running workspace
🤖 Generated with Claude Code
https://claude.ai/code/session_01AihTX41wWUjfBk3c2A9h2Z