Defined Type: rustup::target

Defined in:
manifests/target.pp

Summary

Install a target for a toolchain

Overview

You can name this two ways to automatically set the parameters:

* `"$rustup: $target $toolchain"`: install `$target` for `$toolchain` for
  the `rustup` resource named `$rustup` (normally the username). For
  example, `'daniel: x86_64-unknown-linux-gnu nightly'`.
* `"$rustup: $target"`: install `$target` for the default toolchain for
  the `rustup` resource named `$rustup` (normally the username). For
  example: `'daniel: stable'`.

You may use the string ‘’default’‘ as the target to indicate the target that corresponds to the current host.

Parameters:

  • ensure (Enum[present, absent]) (defaults to: present)

    Whether the target should be present or absent.

  • rustup (String[1]) (defaults to: $name.split(': ')[0])

    The name of the ‘rustup` installation (normally the username). Automatically set if the `$name` of the resource follows the rules above.

  • target (String[1]) (defaults to: $name.split(': ')[1].split(' ')[0])

    The name of the target to install, e.g. “sparcv9-sun-solaris”. Automatically set if the ‘$name` of the resource follows the rules above.

  • toolchain (Optional[String[1]]) (defaults to: $name.split(': ')[1].split(' ')[1])

    The name of the toolchain in which to install the target, e.g. “stable”. ‘undef` means the default toolchain. Automatically set if the `$name` of the resource follows the rules above.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
# File 'manifests/target.pp', line 27

define rustup::target (
  Enum[present, absent] $ensure    = present,
  String[1]             $rustup    = $name.split(': ')[0],
  String[1]             $target    = $name.split(': ')[1].split(' ')[0],
  Optional[String[1]]   $toolchain = $name.split(': ')[1].split(' ')[1],
) {
  Rustup_internal <| title == $rustup |> {
    targets +> [{
        ensure    => $ensure,
        name      => $target,
        toolchain => $toolchain,
    }],
  }
}