Virtual-environments: Use rustup's minimal profile and remove rust-docs component

Created on 22 Mar 2020  路  6Comments  路  Source: actions/virtual-environments

Tool information

  • Tool name: rustup
  • Add or update? use rustup set profile minimal and remove rust-docs component
  • Desired version: None
  • Approximate size: None
  • Rationale:
    rust-docs component is rarely used on most Rust project CI, except some Rust linter
    or spelling checker.
    Compare size with/without installing rust-docs:
400M    /home/lzutao/.rustup/toolchains/nightly-2020-03-19-x86_64-unknown-linux-gnu
733M    /home/lzutao/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu

Also, the Rust stable toolchain on Windows is not always up-to-date.
So many users may want to manually run rustup update stable on CI.
But rust-docs is large and contains of many files, which is slow for removing
and reinstalling.
Travis uses minimal profile and doesn't install rust-docs component with no problem.

Area for Triage: Rust

Question, Bug, or Feature?: Feature

Virtual environments affected

  • [x] macOS 10.15
  • [x] Ubuntu 16.04 LTS
  • [x] Ubuntu 18.04 LTS
  • [x] Windows Server 2016 R2
  • [x] Windows Server 2019

Can this tool be installed during the build?

Are you willing to submit a PR?

If I could figure out how to do that.

Rust Ubuntu Windows macOS enhancement

All 6 comments

Hello @lzutao , thank you for contribution. I have run validation builds in your PR.
As for the macOS, it is not open-sourced for now so we will take care about macOS changes by ourselves after Windows / Ubuntu PR is merged.

On macOS, we use the following code to install Rust:

brew install rustup-init
rustup-init -y --no-modify-path

So it looks like we should just add --default-toolchain=stable --profile=minimal parameters to rustup-init line. Please confirm since you have more context with Rust.

Yes, that's it.
If you run rustup-init --help, you will have the help menu:

The installer for rustup

USAGE:
    rustup [FLAGS] [OPTIONS]

FLAGS:
    -v, --verbose           Enable verbose output
    -q, --quiet             Disable progress output
    -y                      Disable confirmation prompt.
        --no-modify-path    Don't configure the PATH environment variable
    -h, --help              Prints help information
    -V, --version           Prints version information

OPTIONS:
        --default-host <default-host>              Choose a default host triple
        --default-toolchain <default-toolchain>    Choose a default toolchain to install
        --profile <profile>                         [default: default]  [possible values: minimal, default, complete]
    -c, --component <components>...                Component name to also install
    -t, --target <targets>...                      Target name to also install

Windows / Ubuntu changes will be deployed in a few days.
@lzutao , I have done the same changes for macOS, they will be deployed next week

Thanks for letting me know about that!

Changes should be delivered to all images. Thank you for contribution.
Please let me know if something works incorrectly

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adamsiembida picture adamsiembida  路  3Comments

ethomson picture ethomson  路  4Comments

Tnze picture Tnze  路  4Comments

mxschmitt picture mxschmitt  路  3Comments

orj picture orj  路  4Comments