vergen

Generate build, git, and rustc related ‘cargo:rustc-env’ instructions via ‘build.rs’ for use in your code via the env! macro

Current Release

docs.rs Crates.io Crates.io Crates.io codecov CI

Example Usage

See the documentation at docs.rs for example usage

Release 5 Breaking Changes

  • The main entry point for use has changed from gen to vergen
  • The old ConstantsFlags has been removed in lieu of Config.

Environment Variables

A full list of environment variables that can be generated are listed in the following table.

VariableSample
VERGEN_BUILD_DATE2021-02-25
VERGEN_BUILD_TIME23:28:39.493201
VERGEN_BUILD_TIMESTAMP2021-02-25T23:28:39.493201+00:00
VERGEN_BUILD_SEMVER5.0.0
VERGEN_GIT_BRANCHfeature/fun
VERGEN_GIT_COMMIT_DATE2021-02-24
VERGEN_GIT_COMMIT_TIME20:55:21
VERGEN_GIT_COMMIT_TIMESTAMP2021-02-24T20:55:21+00:00
VERGEN_GIT_SEMVER5.0.0-2-gf49246c
VERGEN_GIT_SHAf49246ce334567bff9f950bfd0f3078184a2738a
VERGEN_RUSTC_CHANNELnightly
VERGEN_RUSTC_COMMIT_DATE2021-02-24
VERGEN_RUSTC_COMMIT_HASHa8486b64b0c87dabd045453b6c81500015d122d6
VERGEN_RUSTC_HOST_TRIPLEx86_64-apple-darwin
VERGEN_RUSTC_LLVM_VERSION11.0
VERGEN_RUSTC_SEMVER1.52.0-nightly
VERGEN_CARGO_FEATURESgit,build
VERGEN_CARGO_PROFILEdebug
VERGEN_CARGO_TARGET_TRIPLEx86_64-unknown-linux-gnu
VERGEN_SYSINFO_NAMEDarwin
VERGEN_SYSINFO_OS_VERSIONMacOS 10.15.7 Catalina
VERGEN_SYSINFO_USERYoda
VERGEN_SYSINFO_TOTAL_MEMORY16 GB
VERGEN_SYSINFO_CPU_VENDORIntel(R) Core(TM) i7-7820HQ CPU @ 2.90GHz
VERGEN_SYSINFO_CPU_CORE_COUNT4

Contributing

See the documentation at CONTRIBUTING.md

License

Licensed under either of

Contribution

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.