#最新版本 #组件 #自动 #查找 #已安装 #rustup #二进制

应用 rustup-find

使用 rustup 自动查找并/或安装支持当前已安装所有组件的最新 Rust 版本

2 个版本

使用旧的 Rust 2015

0.1.2 2018 年 8 月 26 日
0.1.0 2018 年 8 月 17 日

#45#已安装

MIT 许可证

21KB
332

rustup-find

一个 Rust 二进制程序,可以自动查找具有所有当前已安装组件的最新 Rust 版本。

用法

rustup-find 0.1.2
Grégoire Geis <git@gregoirege.is>
  Use rustup to automatically find and/or install the latest Rust version that
  supports all the currently installed components.

USAGE:
    rustup-find.exe [FLAGS] [OPTIONS] [SUBCOMMAND]

FLAGS:
    -h, --help              Prints help information
    -n, --no-colors         Whether colors should be disabled.
    -q, --quiet             Whether nothing should be logged.
    -s, --skip-installed    Do not try to install already installed components.
    -V, --version           Prints version information
    -v, --verbose           Whether we should log more informations than needed.

OPTIONS:
    -c, --components <components>...
            Space-separated list of components that must be available for a
            release to be considered valid.
    -d, --days <days>
            Number of days to check starting at the given offset. [default: 30]

    -o, --offset <offset>
            Number of days before today at which to start checking. [default: 0]

    -b, --rustup-bin <rustup_bin>
            Path to the Rustup binary. [default: rustup]

    -r, --rustup-dir <rustup_dir>
            Path to the Rustup config directory. [default: ~/.rustup]

    -t, --toolchain <toolchain>         Target toolchain.

SUBCOMMANDS:
    find       Find the latest available release that matches the current
               components.
    install    Find, download and install the latest available release that
               matches the current components.
    replace    Find and download the latest available release that matches
               the current components, and replace the given toolchain by
               the newly downloaded one.

如果没有提供 toolchain,它将使用 rustup toolchain list | grep default 来解析。

示例

作为一个 x86_64-pc-windows-gnu 用户,rls-preview 的版本很少,这就是我创建这个应用程序的原因。

以下是此二进制文件的不同用法示例。

安装与当前默认工具链及其组件匹配的最新版本

# This command will:
#  - Find the correct release.
#  - Install it using `rustup toolchain install`.
#  - Move the newly installed toolchain from `channel-date-target` to `channel-target`,
#    overriding the previous one.
$ rustup-find --verbose --offset 25 replace

[i] Channel: nightly.
[i] Target: x86_64-pc-windows-gnu.
[i] Required components: cargo, rls-preview, rust-analysis, rust-docs, rust-mingw, rust-std, rustc.
[i] The following component was missing in 2018-07-21: rls-preview.
[i] The following component was missing in 2018-07-20: rls-preview.
[+] Found valid toolchain: nightly-2018-07-19-x86_64-pc-windows-gnu.
[i] Installing toolchain...
[+] Installed toolchain nightly-2018-07-19-x86_64-pc-windows-gnu.
[i] Replacing previous toolchain nightly-pc-windows-gnu...
[+] Replaced previous toolchain nightly-pc-windows-gnu by nightly-2018-07-19-x86_64-pc-windows-gnu.

安装与当前默认工具链及其组件匹配的最新版本

# This command will:
#  - Find the correct release.
#  - Install it using `rustup toolchain install`.
$ rustup-find install

[+] Found valid toolchain: nightly-2018-07-19-x86_64-pc-windows-gnu.
[+] Installed toolchain nightly-2018-07-19-x86_64-pc-windows-gnu.

查找与给定工具链及其组件匹配的最新版本

# This command will:
#  - Find the correct release, and return it.
$ rustup-find --toolchain nightly-x86_64-pc-windows-msvc

nightly-2018-08-17-x86_64-pc-windows-msvc

示例失败

$ rustup-find --days 5 --verbose

[i] Channel: nightly.
[i] Target: x86_64-pc-windows-gnu.
[i] Required components: cargo, rls-preview, rust-analysis, rust-docs, rust-mingw, rust-std, rustc.
[i] The following component was missing in 2018-08-26: rls-preview.
[i] The following component was missing in 2018-08-25: rls-preview.
[i] The following component was missing in 2018-08-24: rls-preview.
[i] No components were available in 2018-08-23.
[i] No components were available in 2018-08-22.
[-] Could not find a match in the last 5 days.

依赖关系

~18–28MB
~492K SLoC