rust-analyzer fallback recurses through Homebrew’s wrapper
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Read the issue’s Homebrew discussion #7111 and linked Homebrew PR #315977 to understand the wrapper’s settings override and proposed approaches. The issue names no rustup files or tests, and the solution is explicitly open for discussion; first determine an agreed solution shape before locating implementation entry points. Done means rustup and Homebrew can meet the settings requirement without recursive fallback.
Written by the indexing model from the issue text.
Description
Problem you are trying to solve
When rustup is installed via homebrew and the active toolchain lacks rust-analyzer, homebrew-installed rustup selects its own shell wrapper as an external fallback and repeatedly executes it:
$ rust-analyzer -help
info: `rust-analyzer` is unavailable for the active toolchain
info: falling back to "/opt/homebrew/opt/rustup/bin/rust-analyzer"
...
error: infinite recursion detected
The proximate cause is that homebrew wraps rustup’s proxies to set RUSTUP_OVERRIDE_UNIX_FALLBACK_SETTINGS. rustup's fallback search excludes executables that are the same file as rustup, but the shell wrapper is a distinct file, so it passes that check, resulting in infinite recursion.
removing homebrew's binstubs avoids this recursion but those binstubs exist to override rustup's settings file, so removing the binstubs also requires patching rustup (take a look at the linked PR).
Is there another way to meet brew's needs? Should we add one? I'd be happy to send a patch, but I'd like some input on the shape of the solution (compile time env var?).
The original report is in Homebrew discussion #7111.
Solution you'd like
Up for discussion.
Notes
No response
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 1.1k
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 45
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing 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
-
enhancement O-shell
Difficulty 1/5 Under an hour Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Verbose output for removing components on toolchain updatePossibly taken @rami3l claimed this 12 days ago. Openenhancement
rust-lang/rustup#5122 · 2 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Continuous performance tracking to avoid major regressionsPossibly taken @rami3l claimed this 20 days ago. Openmeta
rust-lang/rustup#5103 · 3 comments · 5 reactions · 1 assignee ·
Maintainers usually reply within 1 day
-
Suggest another toolchain when removing a component unavailable to the current toolchainPossibly taken @14elias claimed this 4 days ago. Openenhancement help wanted
Difficulty 3/5 1-2 days Newbie friendliness 65/100
rust-lang/rustup#5098 · 6 comments · 1 assignee ·
Maintainers usually reply within 1 day
-
Simplify toolchain type hierarchyPossibly taken @rami3l claimed this 27 days ago. Openenhancement
rust-lang/rustup#5092 · 8 comments · 1 assignee ·
Maintainers usually reply within 1 day
All issues in rust-lang/rustup
Similar issues
-
Custom hosts written as trailing-dot FQDNs (`host.local.`) aren't detected as local backendsPossibly taken @roboomp claimed this today. Openbug prio:p2 providers triaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
can1357/oh-my-pi#15798 · 3 comments ·
Maintainers usually reply within 1 day
-
requires-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
apache/datafusion-comet#7001 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
-
builtin-port enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
cmlarsen/writemorebetter#235 ·
Maintainers usually reply within 1 day
-
Add a Storybook section to CONTRIBUTING.mdPossibly taken @ChanakyaG2004 claimed this today. Opendocumentation good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
FlowwStar/FlowStar#995 · 2 comments ·
Maintainers usually reply within 1 day