6. Toolchain Management

This chapter describes how to manage toolchains using CriticalUp.

The examples in this chapter assume the following directory structure:

.
└── project
   └── criticalup.toml

Where the criticalup.toml contains the following content:

manifest-version = 1

[products.ferrocene]
release = "stable-24.05.0"
packages = [
   "rustc-${rustc-host}",
   "cargo-${rustc-host}",
   "rust-std-${rustc-host}"
]

CriticalUp understands ${rustc-host} to mean the target triple of the host operating system. These triple values are listed in Platforms.

Note

Options for criticalup.toml are detailed in the reference.

Caution

The stable-24.05.0 release only supports Linux. If you are using Windows or an Apple Silicon macOS device, pick the latest version in the nightly channel displayed in releases.ferrocene.dev.

6.1. Installing Toolchains

After installing CriticalUp and authenticating CriticalUp is ready to manage toolchains.

You can can change directory into the project and install the required toolchain.

cd project
criticalup install

To change the installed products, edit the criticalup.toml as desired. For example:

manifest-version = 1

[products.ferrocene]
release = "stable-24.05.0"
packages = [
   "rustc-${rustc-host}",
   "cargo-${rustc-host}",
   "rust-std-${rustc-host}",
   "rust-std-aarch64-unknown-none", # Line added
]

Then run the install command again:

criticalup install

When an internet connection is not available, a previously fetched package can be installed without using the network by passing the --offline flag.

6.2. Removing Toolchains

An installation can be removed by running the criticalup remove command from the directory containing the criticalup.toml:

criticalup remove

6.3. Cleaning Unused Toolchains

Over time CriticalUp’s stored installations or cache may accumulate artifacts that are no longer used. If CriticalUp’s state directory begins to consume too much disk space the clean command can help by deleting unused toolchains.

criticalup clean

6.4. Verifying Toolchains

If a toolchain is suspected to be corrupted or tampered with, the verification step performed during installation can be repeated.

From the direcory containing the relevant criticalup.toml:

criticalup verify

6.5. Creating Archives of Toolchains

CriticalUp can produce uncompressed tarballs of toolchains which can then be placed in backups.

criticalup archive out.tar

If an output path is omitted, criticalup archive emits the archive to stdout.

When an internet connection is not available, a previously fetched package can be tarballed without using the network by passing the --offline flag.