Skip to content

fix: don't leak cwd from install_exercism#45

Merged
bushidocodes merged 1 commit into
masterfrom
fix/exercism-cd-leak
Jun 16, 2026
Merged

fix: don't leak cwd from install_exercism#45
bushidocodes merged 1 commit into
masterfrom
fix/exercism-cd-leak

Conversation

@bushidocodes

Copy link
Copy Markdown
Owner

Problem

install_exercism changed the working directory and never restored it:

install_exercism() {
    cd ~ || exit            # leaks $HOME as cwd for everything after
    make ~/.local/bin/exercism
    exercism upgrade
    make ~/.local/bin/configlet
}

Every later step that runs make from the repo root then breaks. In master's main() order the next make-based step, install_wasmtime, failed:

make: *** No rule to make target '/root/.wasmtime/bin/wasmtime'.  Stop.

(Confirmed it's cwd, not a Makefile bug — the rule matches fine when make runs from the repo directory.)

Fix

Run both make targets from the repo dir, and scope the cd ~ to a subshell for exercism upgrade:

install_exercism() {
    make ~/.local/bin/exercism
    (cd ~ && exercism upgrade)
    make ~/.local/bin/configlet
}

Found by running the full install.sh in a fresh ubuntu:24.04 container (#41).

Fixes #41

🤖 Generated with Claude Code

install_exercism ran `cd ~ || exit` and never returned, so every later
step that runs `make` from the repo dir broke. In master's main() the
next step, install_wasmtime, failed:

    make: *** No rule to make target '/root/.wasmtime/bin/wasmtime'.  Stop.

Run both make targets from the repo directory and scope the `cd ~` to a
subshell for `exercism upgrade`. Found by running install.sh in a fresh
ubuntu:24.04 container.

Fixes #41

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@bushidocodes bushidocodes merged commit a2f1641 into master Jun 16, 2026
2 checks passed
@bushidocodes bushidocodes deleted the fix/exercism-cd-leak branch June 16, 2026 01:08
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.

install_exercism does 'cd ~' without returning, breaking subsequent steps (install_wasmtime)

1 participant