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
}
Found by running the full
install.shin a freshubuntu:24.04container.Problem
install_exercismchanges the working directory and never restores it:Every later step that relies on running from the repo root then breaks. In master's
main()order, the next make-based step isinstall_wasmtime, which fails becausemakecan no longer find the repoMakefile:(Confirmed it's CWD, not a Makefile bug:
make ~/.wasmtime/bin/wasmtimematches the rule fine when run from the repo directory.)Suggested fix
Don't leak the directory change — run the
cdin a subshell, orcdback afterward. Thecd ~seems intended so exercism's config lands in$HOME; scoping it avoids the side effect: