diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b4641d..e821e0a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +### Fixed + +- pass `--no-modify-path` to `elan-init` so installing elan no longer edits the + runner's persistent environment (`HKCU\Environment\PATH` on Windows, + `~/.profile` and friends elsewhere). `lean-action` already puts + `$HOME/.elan/bin` on `$GITHUB_PATH`, so this is a no-op on GitHub-hosted + runners; on self-hosted runners it stops every job from accumulating PATH + entries that outlive it ## v1.6.2 - 2026-10-12 ### Fixed diff --git a/scripts/install_elan.sh b/scripts/install_elan.sh index ad678c4..f8167ca 100755 --- a/scripts/install_elan.sh +++ b/scripts/install_elan.sh @@ -5,8 +5,13 @@ set -e echo "::group::Elan Installation Output" set -o pipefail +# `--no-modify-path` because this script puts `$HOME/.elan/bin` on `$GITHUB_PATH` +# itself, two lines below. Without the flag elan additionally edits the user's +# persistent environment -- `HKCU\Environment\PATH` on Windows, `~/.profile` and +# friends elsewhere -- which is redundant on GitHub-hosted runners and outlives +# the job on self-hosted ones. curl https://raw.githubusercontent.com/leanprover/elan/master/elan-init.sh -sSf | - sh -s -- -y --default-toolchain none + sh -s -- -y --default-toolchain none --no-modify-path rm -f elan-init echo "$HOME/.elan/bin" >>"$GITHUB_PATH"