Skip to content

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

Description

@bushidocodes

Found by running the full install.sh in a fresh ubuntu:24.04 container.

Problem

install_exercism changes the working directory and never restores it:

install_exercism() {
    ${options["verbose"]} && banner "Installing Exercism"
    cd ~ || exit            # <-- leaves CWD at $HOME for everything after
    make ~/.local/bin/exercism
    ...
}

Every later step that relies on running from the repo root then breaks. In master's main() order, the next make-based step is install_wasmtime, which fails because make can no longer find the repo Makefile:

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

(Confirmed it's CWD, not a Makefile bug: make ~/.wasmtime/bin/wasmtime matches the rule fine when run from the repo directory.)

Suggested fix

Don't leak the directory change — run the cd in a subshell, or cd back afterward. The cd ~ seems intended so exercism's config lands in $HOME; scoping it avoids the side effect:

install_exercism() {
    ${options["verbose"]} && banner "Installing Exercism"
    make ~/.local/bin/exercism
    (cd ~ && exercism upgrade)
    make ~/.local/bin/configlet
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions