Skip to main content

Command Palette

Search for a command to run...

Rust Setup

Updated
2 min readView as Markdown
Rust Setup
J

meow meow meow meowwwww....

I prefer using home-brew to manage the install package. So I'm used to searching first.

Home-brew

# check the info
brew info rustup-init 

# look good for me
==> rustup-init: stable 1.26.0 (bottled)
Rust toolchain installer
https://github.com/rust-lang/rustup
/usr/local/Cellar/rustup-init/1.26.0_1 (9 files, 7.2MB) *
  Poured from bottle using the formulae.brew.sh API on 2023-08-09 at 11:10:05
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/rustup-init.rb
License: Apache-2.0 or MIT
==> Dependencies
Build: rust ✘
==> Analytics
install: 3,091 (30 days), 12,798 (90 days), 22,169 (365 days)
install-on-request: 2,710 (30 days), 11,985 (90 days), 21,110 (365 days)
build-error: 0 (30 days)
# install and instructions
brew install rustup-init


# print host info and modify PATH setting
Current installation options:
   default host triple: x86_64-apple-darwin
     default toolchain: stable (default)
               profile: default
  modify PATH variable: yes

# used default 
1) Proceed with installation (default)
2) Customize installation
3) Cancel installation
>1

...

# Yes!
Rust is installed now. Great!

Config the current terminal env

To configure your current shell, run:
source "$HOME/.cargo/env"

Check

# check rustup command
rustup --help

# Yes!
rustup 1.26.0 (2023-04-05)
The Rust toolchain installer

USAGE:
    rustup [OPTIONS] [+toolchain] <SUBCOMMAND>

ARGS:
    <+toolchain>    release channel (e.g. +stable) or custom toolchain to set override

OPTIONS:
    -v, --verbose    Enable verbose output
    -q, --quiet      Disable progress output
    -h, --help       Print help information
    -V, --version    Print version information

SUBCOMMANDS:
    show           Show the active and installed toolchains or profiles
    update         Update Rust toolchains and rustup
    check          Check for updates to Rust toolchains and rustup
    default        Set the default toolchain
    toolchain      Modify or query the installed toolchains
    target         Modify a toolchain's supported targets
    component      Modify a toolchain's installed components
    override       Modify directory toolchain overrides
    run            Run a command with an environment configured for a given toolchain
    which          Display which binary will be run for a given command
    doc            Open the documentation for the current toolchain
    man            View the man page for a given command
    self           Modify the rustup installation
    set            Alter rustup settings
    completions    Generate tab-completion scripts for your shell
    help           Print this message or the help of the given subcommand(s)

DISCUSSION:
    Rustup installs The Rust Programming Language from the official
    release channels, enabling you to easily switch between stable,
    beta, and nightly compilers and keep them updated. It makes
    cross-compiling simpler with binary builds of the standard library
    for common platforms.

    If you are new to Rust consider running `rustup doc --book` to
    learn Rust.

More from this blog

Java 轉換 COBOL COMP-3 資料

老舊的金融系統編碼問題 客戶的系統是早期的 IBM-Z (COBOL), 用的是 EBCDIC 的編碼, 而台灣的環境會搭配 BIG5(cp-950) 的編碼. EBCDIC 是 IBM 系統專用的編碼, 跟 ASCII 差異如下. 為了讓資了可以被處理, 需要進行資料清洗與解碼, 礙於客戶的資安規範與其他因素限制下, 合作過程必須處理 EBCDIC + Binary 的格式文件, 來做資料轉移. 資料格式 文字類型的 BIG5 編碼處理 中文的欄位資料是採用 Big5 (cp950), 撇開...

Jul 18, 20255 min read
Java 轉換 COBOL COMP-3 資料

DirtyPaw

21 posts