Expand description
shadow-rs mod
Constants§
- BRANCH
- The name of the Git branch that this project was built from. This constant will be empty if the branch cannot be determined.
- BUILD_OS 
- Operating system and architecture on which the project was build.
The format of this variable is always os-arch, whereosis the operating system name as returned bystd::env::consts::OS, andarchis the computer architecture as returned bystd::env::consts::ARCH.
- BUILD_RUST_ CHANNEL 
- The debug configuration with which the project was built.
Note that this is not the Rust channel, but either debugorrelease, depending on whether debug assertions were enabled in the build or not.
- BUILD_TARGET 
- The target for this build. This is possibly distinct from the host target during build, in which case this project build was created via cross-compilation.
- BUILD_TARGET_ ARCH 
- The architecture of the target for this build. This is the “architecture” part of the BUILD_TARGETconstant.
- BUILD_TIME 
- The project build time, formatted in modified ISO 8601 format (YYYY-MM-DD HH-MM ±hh-mmwhere hh-mm is the offset from UTC).
- BUILD_TIME_ 2822 
- The project build time, formatted according to RFC 2822 (e.g. HTTP Headers).
- BUILD_TIME_ 3339 
- The project build time, formatted according to RFC 3339 and ISO 8601.
- CARGO_VERSION 
- The cargo version which which the project was built, as output by cargo --version.
- CLAP_LONG_ VERSION 
- A long version string describing the project. The version string contains the package version, current Git tag, commit hash, build time, and build environment on separate lines. This constant is intended to be used by clap or other CLI tools as a long version string.
- COMMITS_SINCE_ TAG 
- The number of commits since the last Git tag on the branch that this project was built from. This value indicates how many commits have been made after the last tag and before the current commit.
- COMMIT_DATE 
- The time of the Git commit that this project was built from.
The time is formatted in modified ISO 8601 format (YYYY-MM-DD HH-MM ±hh-mmwhere hh-mm is the offset from UTC).
- COMMIT_DATE_ 2822 
- The name of the Git branch that this project was built from. The time is formatted according to RFC 2822 (e.g. HTTP Headers).
- COMMIT_DATE_ 3339 
- The name of the Git branch that this project was built from. The time is formatted according to RFC 3339 and ISO 8601.
- COMMIT_HASH 
- The full commit hash of the Git commit that this project was built from.
An abbreviated, but not necessarily unique, version of this is SHORT_COMMIT.
- GIT_CLEAN 
- Whether the Git working tree was clean at the time of project build (true), or not (false).
- GIT_STATUS_ FILE 
- The Git working tree status as a list of files with their status, similar to git status. Each line of the list is preceded with*, followed by the file name. Files marked(dirty)have unstaged changes. Files marked(staged)have staged changes.
- LAST_TAG 
- The name of the last Git tag on the branch that this project was built from.
As opposed to TAG, this does not require the current commit to be tagged, just one of its parents.
- PKG_DESCRIPTION 
- The project’s description, as determined by the Cargo.toml manifest.
- PKG_VERSION 
- The project’s full version string, as determined by the Cargo.toml manifest.
- PKG_VERSION_ MAJOR 
- The project’s semver major version, as determined by the Cargo.toml manifest.
- PKG_VERSION_ MINOR 
- The project’s semver minor version, as determined by the Cargo.toml manifest.
- PKG_VERSION_ PATCH 
- The project’s semver patch version, as determined by the Cargo.toml manifest.
- PKG_VERSION_ PRE 
- The project’s semver pre-release version, as determined by the Cargo.toml manifest.
- PROJECT_NAME 
- The project name, as determined by the Cargo.toml manifest.
- RUST_CHANNEL 
- The Rustup toolchain with which the project was built. Note that as per Rustup toolchain format, this variable may or may not contain host and date information, but it will always contain channel information (stable, beta or nightly).
- RUST_VERSION 
- Rust version with which the project was built.
The version always uses the canonical Rust version format,
and is therefore identical to the output of the build toolchain’s rustc --version.
- SHORT_COMMIT 
- The short hash of the Git commit that this project was built from.
Note that this will always truncate COMMIT_HASHto 8 characters if necessary. Depending on the amount of commits in your project, this may not yield a unique Git identifier (see here for more details on hash abbreviation).
- TAG
- The name of the Git tag that this project was built from. Note that this will be empty if there is no tag for the HEAD at the time of build.
- VERSION
- A long version string describing the project. The version string contains the package version, current Git tag, commit hash, build time, and build environment on separate lines. This constant is suitable for printing to the user.
Functions§
- print_build_ in 
- Prints all built-in shadow-rsbuild constants to standard output.