Rustup: Homebrew conflicts with rustup (detect and warn about it?)

Created on 14 Aug 2017  Â·  3Comments  Â·  Source: rust-lang/rustup

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 the PATH 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 the PATH modified for Rustup.

O-macos

Most helpful comment

To clarify, the situation I'm talking about has nothing to do with conflicts of Homebrew's packages.

Consider this scenario:

  1. Install rustup and use rustc from rustup (there's no Homebrew rustc, no conflict)
  2. Install rustc from Homebrew (Homebrew doesn't care rustup is there, and does not report any problem)
  3. Try to use 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.

All 3 comments

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:

  1. Install rustup and use rustc from rustup (there's no Homebrew rustc, no conflict)
  2. Install rustc from Homebrew (Homebrew doesn't care rustup is there, and does not report any problem)
  3. Try to use 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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Stargateur picture Stargateur  Â·  3Comments

fenhl picture fenhl  Â·  4Comments

KasMA1990 picture KasMA1990  Â·  3Comments

daboross picture daboross  Â·  4Comments

matthiaskrgr picture matthiaskrgr  Â·  3Comments