The Paketo Buildpack for Rustup is a Cloud Native Buildpack that installs and executes rustup to install Rust.
If all of these conditions are met:
- Another buildpack requires
rust $BP_RUSTUP_ENABLEDistrue
The buildpack will do the following:
- Contributes
rustup-initto a layer markedcachewith command on$PATH - Executes
rustup-initwith the output written to a layer markedbuildandcachewith installed commands on$PATH - Executes
rustupto install a Rust toolchain to a layer markedbuildandcachewith installed commands on$PATH- If
rust-toolchainorrust-toolchain.tomlexists,rustupwill install as configured in the file. If$BP_RUST_TOOLCHAIN/$BP_RUST_PROFILEare also set to non-default values, they will also be installed. - If
rust-toolchainorrust-toolchain.tomldo not exist,rustupwill install$BP_RUST_TOOLCHAIN/$BP_RUST_PROFILE.
- If
- If
$BP_RUST_TARGETis set, executesrustup target addto install an additional Rust target. - If
$BP_RUST_TARGETis not set and the build is running on the Paketo Tiny or Static stacks, then the Rust Linux musl target will be automatically added.
| Environment Variable | Description |
|---|---|
$BP_RUSTUP_ENABLED |
Configure rustup to be enabled. This means that rustup will be used to install Rust. Default value is true. Set to false to use another Rust toolchain provider like rust-dist. |
$BP_RUST_TOOLCHAIN |
Rust toolchain to install. Default stable. Other common values: beta, nightly or a specific versin number. Any acceptable value for a toolchain can be used here. |
$BP_RUST_PROFILE |
Rust profile to install. Default minimum. Other acceptable values: default, complete. See Rustup docs for profile. |
$BP_RUST_TARGET |
Additional Rust target to install. Default ``, so nothing additional is installed. If there is no user-specified target and the build is running on the Paketo Tiny or Static stack, then the Linux musl target is automatically added. Run rustup target list to see what valid targets exist. |
$BP_RUSTUP_INIT_VERSION |
Configure the version of rustup-init to install. It can be a specific version or a wildcard like 1.*. It defaults to the latest 1.* version. |
$BP_RUSTUP_INIT_LIBC |
Configure the libc implementation used by the installed toolchain. Available options: gnu or musl. Defaults to gnu for compatiblity. You do not need to set this option with the Paketo full/base/tiny/static stacks. It can be used for compatibility with more exotic or custom stacks. |
This buildpack is released under version 2.0 of the Apache License.