#cargo #build #tool #instructions

build vergen

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

52 releases (stable)

new 5.1.9 Jun 17, 2021
5.1.5 Apr 26, 2021
5.1.0 Mar 27, 2021
4.2.0 Mar 1, 2021
0.0.6 Mar 26, 2015

#2 in Development tools

Download history 18176/week @ 2021-02-24 17467/week @ 2021-03-03 17372/week @ 2021-03-10 16635/week @ 2021-03-17 16201/week @ 2021-03-24 14893/week @ 2021-03-31 16614/week @ 2021-04-07 17940/week @ 2021-04-14 17722/week @ 2021-04-21 17663/week @ 2021-04-28 17045/week @ 2021-05-05 19370/week @ 2021-05-12 18842/week @ 2021-05-19 19341/week @ 2021-05-26 18851/week @ 2021-06-02 17487/week @ 2021-06-09

76,352 downloads per month
Used in 95 crates (45 directly)

MIT/Apache

125KB
2.5K SLoC

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.

Variable Sample
VERGEN_BUILD_DATE 2021-02-25
VERGEN_BUILD_TIME 23:28:39.493201
VERGEN_BUILD_TIMESTAMP 2021-02-25T23:28:39.493201+00:00
VERGEN_BUILD_SEMVER 5.0.0
VERGEN_GIT_BRANCH feature/fun
VERGEN_GIT_COMMIT_DATE 2021-02-24
VERGEN_GIT_COMMIT_TIME 20:55:21
VERGEN_GIT_COMMIT_TIMESTAMP 2021-02-24T20:55:21+00:00
VERGEN_GIT_SEMVER 5.0.0-2-gf49246c
VERGEN_GIT_SHA f49246ce334567bff9f950bfd0f3078184a2738a
VERGEN_RUSTC_CHANNEL nightly
VERGEN_RUSTC_COMMIT_DATE 2021-02-24
VERGEN_RUSTC_COMMIT_HASH a8486b64b0c87dabd045453b6c81500015d122d6
VERGEN_RUSTC_HOST_TRIPLE x86_64-apple-darwin
VERGEN_RUSTC_LLVM_VERSION 11.0
VERGEN_RUSTC_SEMVER 1.52.0-nightly
VERGEN_CARGO_FEATURES git,build
VERGEN_CARGO_PROFILE debug
VERGEN_CARGO_TARGET_TRIPLE x86_64-unknown-linux-gnu
VERGEN_SYSINFO_NAME Manjaro Linux
VERGEN_SYSINFO_OS_VERSION Linux Manjaro Linux
VERGEN_SYSINFO_USER Yoda
VERGEN_SYSINFO_TOTAL_MEMORY 33 GB
VERGEN_SYSINFO_CPU_VENDOR Authentic AMD
VERGEN_SYSINFO_CPU_CORE_COUNT 8
VERGEN_SYSINFO_CPU_NAME cpu0,cpu1,cpu2,cpu3,cpu4,cpu5,cpu6,cpu7
VERGEN_SYSINFO_CPU_BRAND AMD Ryzen Threadripper 1900X 8-Core Processor
VERGEN_SYSINFO_CPU_FREQUENCY 3792

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.

Dependencies

~1.2–3.5MB
~80K SLoC