Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rustup is not available after 'brew install rustup-init' on Appls Silicon #3458

Closed
kuncevic opened this issue Aug 21, 2023 · 3 comments
Closed
Labels

Comments

@kuncevic
Copy link

Problem

Description:

When installing rustup via Homebrew on an Apple Silicon Mac, the main rustup binary is not being installed in /opt/homebrew/bin.

Expected behavior:

The rustup installation should place the main rustup binary in /opt/homebrew/bin.

Steps

Steps to reproduce:

  1. Install Rust via Homebrew

brew install rust

  1. Install rustup

brew install rustup-init

  1. Check for rustup binary

ls /opt/homebrew/bin

The rustup binary is not present, only the rustup-init executable.

Possible Solution(s)

No response

Notes

No response

Rustup version

rustup-init version: 

1.26.0

Installed toolchains

Environment:
-
    OS: macOS Ventura 13..4.1 (Apple Silicon)
    Install method: Homebrew
@kuncevic kuncevic added the bug label Aug 21, 2023
@rami3l
Copy link
Member

rami3l commented Aug 21, 2023

@kuncevic Hi! You are on the right path so far! Please try to run rustup-init once to set everything up.

TLDR (originally from #3426 (comment)):

My personal recommendation for setting up a rust environment on macOS would be:

  1. Install rustup-init with brew install rustup-init;
  2. Proceed with that rustup-init installation;
  3. If you also wish to have brew-installed rust, make sure your rustup-installed rust comes first in the PATH, and optionally configure the system toolchain via rustup toolchain link system <path>.

Here's what a correctly-configured brew-managed rustup installation should look like:

> ls -lah $(which rustup)
... ~/.cargo/bin/rustup -> /opt/homebrew/bin/rustup-init

You can see that after running rustup-init and putting ~/.cargo/bin in your $PATH, you have a rustup link that points to your homebrew rustup-init installation.

In fact, rustup-init is rustup, but with a different file name:

//! The main Rustup command-line interface
//!
//! The rustup binary is a chimera, changing its behavior based on the
//! name of the binary. This is used most prominently to enable
//! Rustup's tool 'proxies' - that is, rustup itself and the rustup
//! proxies are the same binary: when the binary is called 'rustup' or
//! 'rustup.exe' it offers the Rustup command-line interface, and
//! when it is called 'rustc' it behaves as a proxy to 'rustc'.
//!
//! This scheme is further used to distinguish the Rustup installer,
//! called 'rustup-init', which is again just the rustup binary under a
//! different name.

@kuncevic
Copy link
Author

kuncevic commented Aug 23, 2023

Right I c, I believe there is a bit of gap in documentation. Initially I've read desc onhttps://formulae.brew.sh/formula/rustup-init saying that Also known as: rustup however that was confusing...

All fixed through by brew uninstall rust, brew unlink rust, brew install rustup-init and then, as I am using fish shell, this #478 (comment).

Thank you for following up @rami3l

@rami3l
Copy link
Member

rami3l commented Aug 23, 2023

@kuncevic Glad to hear that! Please feel free to follow up doc issues in #3460 :)

BTW could you please close this issue as resolved? Sadly I don't currently have the permission to do so. Many thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants