Generate build, git, and rustc related 'cargo:rustc-env' instructions via 'build.rs' for use in your code via the env! macro
See the documentation at docs.rs for example usage
generate_cargo_keys
to vergen
build
, cargo
, git
, and rustc
).
build
feature enables the VERGEN_BUILD_*
instructions.git
feature enables the VERGEN_GIT_*
instructions and the cargo:rerun-if-changed
instructions.rustc
feature enables the VERGEN_RUSTC_*
instructions.cargo
feature enables the VERGEN_CARGO_*
instructions.vergen
function a no-op.ConstantsFlags
with the gen
function to toggle individual cargo instructions, but it has been deprecated.text, no_run
cargo:rustc-env=VERGEN_BUILD_TIMESTAMP=2021-02-25T23:28:39.493201+00:00
cargo:rustc-env=VERGEN_BUILD_SEMVER=4.1.0
cargo:rustc-env=VERGEN_GIT_BRANCH=feature/datetime-toggles
cargo:rustc-env=VERGEN_GIT_COMMIT_TIMESTAMP=2021-02-24T20:55:21+00:00
cargo:rustc-env=VERGEN_GIT_SEMVER=4.1.0-2-gf49246c
cargo:rustc-env=VERGEN_GIT_SHA=f49246ce334567bff9f950bfd0f3078184a2738a
cargo:rustc-env=VERGEN_RUSTC_CHANNEL=nightly
cargo:rustc-env=VERGEN_RUSTC_COMMIT_DATE=2021-02-24
cargo:rustc-env=VERGEN_RUSTC_COMMIT_HASH=a8486b64b0c87dabd045453b6c81500015d122d6
cargo:rustc-env=VERGEN_RUSTC_HOST_TRIPLE=x86_64-apple-darwin
cargo:rustc-env=VERGEN_RUSTC_LLVM_VERSION=11.0
cargo:rustc-env=VERGEN_RUSTC_SEMVER=1.52.0-nightly
cargo:rustc-env=VERGEN_CARGO_TARGET_TRIPLE=x86_64-unknown-linux-gnu
cargo:rustc-env=VERGEN_CARGO_PROFILE=debug
cargo:rustc-env=VERGEN_CARGO_FEATURES=git,build
cargo:rerun-if-changed=/Users/kon8116/projects/rust-lang/vergen/.git/HEAD
cargo:rerun-if-changed=/Users/kon8116/projects/rust-lang/vergen/.git/refs/heads/feature/datetime-toggles
Command
s used for git have been removed in lieu of using the git2
library directly.git2
is also used to determine the HEAD
path and the path that it refers to for the cargo:rerun-if-changed
instructions. This is more reliable then the manual method that was in place before.See the documentation at CONTRIBUTING.md
Licensed under either of * Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) * MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT) at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.