Fix dotfiles install (#45) and upgrade to PHP 8.4#48
Merged
Conversation
Anchor lifecycle scripts to $WORKSPACE_FOLDER at entry and exit so the shellServer's cwd stays valid for subsequent steps — including the devcontainer CLI's own dotfiles install, which previously failed with "Unable to read current working directory" after onCreate work invalidated the inode the shellServer had cd'd into. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This was referenced Jun 9, 2026
kurowski
added a commit
that referenced
this pull request
Jun 9, 2026
The cd "$WORKSPACE_FOLDER" appended to devcontainer_on_create and devcontainer_post_create in #48 was meant to leave the devcontainer CLI's persistent shellServer in a valid cwd before the dotfiles clone. It can't: each lifecycle command runs in its own `/bin/sh -c` exec that exits as soon as the function returns, so the cd never touches the shellServer. The real fix is anchoring the image WORKDIR (prior commit). Kept _cwd_workspace at the top of each script — on_create's docroot symlink (ln -s "$(pwd)/web" ...) depends on a deterministic cwd, so that call is load-bearing, not part of the broken cwd-restore theory. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
kurowski
added a commit
that referenced
this pull request
Jun 9, 2026
The php base image leaves WORKDIR at /var/www/html, which
devcontainer_on_create.sh deletes and replaces with a symlink to the
mounted docroot. The devcontainer CLI starts its persistent setup shell
("shellServer") in WORKDIR with no -w flag, so that rm -rf orphans the
shell's cwd. The later dotfiles `git clone` runs in the same shellServer
and fails its getcwd() with "Unable to read current working directory".
The lifecycle commands run as separate execs (-w workspaceFolder), so
the cd "$WORKSPACE_FOLDER" added in #48 can't repair the shellServer.
Anchoring WORKDIR to /home/vscode keeps the shellServer's cwd valid
through the docroot swap.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Summary
$WORKSPACE_FOLDERon entry and exit, so the shellServer's cwd stays valid for the devcontainer CLI's dotfiles install step.mcr.microsoft.com/devcontainers/php:8.3to:8.4.Test plan
dck && dcewith--dotfiles-repositoryset against a fresh container — dotfiles clone succeeds, no exit 128.~/.devcontainer/.dotfilesMarkerand~/dotfiles/both populated after firstdevcontainer up.🤖 Generated with Claude Code