Open kornelski opened 6 years ago
A quick fix is brew uninstall rust
or brew unlink rust
.
rustup and rustup-init formulas are mutually-exclusive, and should mutually conflicts
or whatever with each other. The latter seems to be a brew package of rustup.
Files issues about Homebrew there, because rustup properly detects an existing rust and exits.
To clarify, the situation I'm talking about has nothing to do with conflicts of Homebrew's packages.
Consider this scenario:
rustup default
to change rustc (doesn't appear to work)I would like 3. to warn that it's been affected by another rustc in PATH
, and it no longer works as usual.
While I mention Homebrew specifically, the problem is not unique to Homebrew. Identical problem can happen when you install another copy of rustc from any package manager.
@rustbot label: +O-macos
On macOS if you install anything with Homebrew that has Rust as a dependency (including any program that has to be built from Rust source), Homebrew will install Rust system-wide and it will take precedence over rustup.
I've ran into this — it looked like if
rustup default
command didn't work properly. I took me a while to realize that binaries in/usr/local/bin
are not from rustup.Homebrew dislikes using any binaries and update mechanisms they don't control (including rustup), so I think it's up to Rustup to improve this situation.
As a solution I suggest emitting a warning when
rustup default
command is used if thePATH
contains both Rustup rustc and non-Rustup rustc, and non-Rustup rustc is first. That will catch this error, but won't get in the way of using Rustup without thePATH
modified for Rustup.