Module input

Source
Expand description

Inputs from the build system to the build script.

This crate does not do any caching or interpreting of the values provided by Cargo beyond the communication protocol itself. It is up to the build script to interpret the string values and decide what to do with them.

Reference: https://doc.rust-lang.org/stable/cargo/reference/environment-variables.html#environment-variables-cargo-sets-for-build-scripts

Functions§

cargo
Path to the cargo binary performing the build.
cargo_cfg
For each configuration option of the package being built, this will contain the value of the configuration.
cargo_cfg_feature
Each activated feature of the package being built
cargo_cfg_panic
The panic strategy.
cargo_cfg_proc_macro
If the crate is being compiled as a procedural macro.
cargo_cfg_target_abi
Disambiguation of the target ABI when the target env isn’t sufficient.
cargo_cfg_target_arch
The CPU target architecture. This is similar to the first element of the platform’s target triple, but not identical.
cargo_cfg_target_endian
The CPU target endianness.
cargo_cfg_target_env
The target environment ABI. This value is similar to the fourth element of the platform’s target triple.
cargo_cfg_target_feature
List of CPU target features enabled.
cargo_cfg_target_has_atomic
List of CPU supported atomic widths.
cargo_cfg_target_os
The target operating system. This value is similar to the second and third element of the platform’s target triple.
cargo_cfg_target_pointer_width
The CPU pointer width.
cargo_cfg_target_vendor
The target vendor.
cargo_cfg_unix
Set on unix-like platforms.
cargo_cfg_windows
Set on windows-like platforms.
cargo_encoded_rustflags
Extra flags that Cargo invokes rustc with. See build.rustflags.
cargo_feature
For each activated feature of the package being built, this will be true.
cargo_makeflags
Contains parameters needed for Cargo’s jobserver implementation to parallelize subprocesses.
cargo_manifest_dir
The directory containing the manifest for the package being built (the package containing the build script).
cargo_manifest_links
The manifest links value.
cargo_manifest_path
The path to the manifest of your package.
cargo_pkg_authors
The authors from the manifest of your package.
cargo_pkg_description
The description from the manifest of your package.
cargo_pkg_homepage
The home page from the manifest of your package.
cargo_pkg_license
The license from the manifest of your package.
cargo_pkg_license_file
The license file from the manifest of your package.
cargo_pkg_name
The name of your package.
cargo_pkg_readme
Path to the README file of your package.
cargo_pkg_repository
The repository from the manifest of your package.
cargo_pkg_rust_version
The Rust version from the manifest of your package. Note that this is the minimum Rust version supported by the package, not the current Rust version.
cargo_pkg_version
The full version of your package.
cargo_pkg_version_major
The major version of your package.
cargo_pkg_version_minor
The minor version of your package.
cargo_pkg_version_patch
The patch version of your package.
cargo_pkg_version_pre
The pre-release version of your package.
cargo_target_family
The target family.
debug
The amount of debug information included.
dep_metadata
Metadata set by dependencies. For more information, see build script documentation about the links manifest key.
host
The host triple of the Rust compiler.
num_jobs
The parallelism specified as the top-level parallelism.
opt_level
The level of optimization.
out_dir
The folder in which all output and intermediate artifacts should be placed.
profile
release for release builds, debug for other builds.
rustc
The compiler that Cargo has resolved to use.
rustc_linker
The linker that Cargo has resolved to use for the current target, if specified.
rustc_workspace_wrapper
The rustc wrapper, if any, that Cargo is using for workspace members. See build.rustc-workspace-wrapper.
rustc_wrapper
The rustc wrapper, if any, that Cargo is using. See build.rustc-wrapper.
rustdoc
The documentation generator that Cargo has resolved to use.
target
The target triple that is being compiled for. Native code should be compiled for this triple.