Flaky has_local in rustup-init.sh
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
Research direction
Open rustup-init.sh and locate has_local; first reproduce the case with a shell lacking builtin local and an executable named local on PATH. Verify the fix makes has_local test the shell builtin rather than the PATH command, then run the relevant shell checks if available.
Written by the indexing model from the issue text.
Description
Verification
- I searched for recent similar issues at https://github.com/rust-lang/rustup/issues?q=is%3Aissue and found no duplicates.
- I am on the latest version of Rustup according to https://github.com/rust-lang/rustup/tags and am still able to reproduce my issue.
Problem
On a system without local, it would continue searching in $PATH. If a such a command were found, that would wrongly be used throughout.
Steps
- Login to where
/bin/shhas no builtinlocal - Create an executable
localin$PATH
Possible Solution(s)
I don’t know how portable an empty path is, nor whether prepending it will affect searching for the following command on such a Shell. This should probably work anywhere:
has_local() {
# shellcheck disable=SC2034 # deliberately unused
PATH= local _has_local
}
Notes
No response
Rustup version
Reading latest script on GitHub.
Installed toolchains
Irrelevant, since I don’t have a Shell with no builtin `local`
OS version
Irrelevant, since I don’t have a Shell with no builtin `local`
- Dominant language
- Rust
- Stars
- 7k
- Forks
- 1.1k
- Avg merge
- 22h 40m
- Merged PRs (30d)
- 46
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/rustup
-
E-easy enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
enhancement O-shell
Difficulty 1/5 Under an hour Newbie friendliness 72/100
-
enhancement
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
-
enhancement
rust-lang/rustup#5069 · 2 comments · 1 reaction · 1 assignee ·
All issues in rust-lang/rustup
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100