Closed williamdes closed 8 months ago
Need more information (rustc -Vv
and cargo -Vv
output would be a good start). Both variables are set (and compile) in my environments with your same configuration:
Sorry for the delay
$ rustc -Vv
rustc 1.73.0 (cc66ad468 2023-10-03)
binary: rustc
commit-hash: cc66ad468955717ab92600c770da8c1601a4ff33
commit-date: 2023-10-03
host: x86_64-unknown-linux-gnu
release: 1.73.0
LLVM version: 17.0.2
$ cargo -Vv
cargo 1.73.0 (9c4383fb5 2023-08-26)
release: 1.73.0
commit-hash: 9c4383fb55986096b414d98125421ab87b5fd642
commit-date: 2023-08-26
host: x86_64-unknown-linux-gnu
libgit2: 1.6.4 (sys:0.17.2 vendored)
libcurl: 8.2.1-DEV (sys:0.4.65+curl-8.2.1 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Debian 12 (bookworm) [64-bit]
error: environment variable `VERGEN_BUILD_DATE` not defined at compile time
[build-dependencies]
vergen = { version = "*", features = ["build", "git", "cargo"] }
➜ ~ rustc -Vv
rustc 1.76.0-nightly (a1a37735c 2023-11-23)
binary: rustc
commit-hash: a1a37735cbc3db359d0b24ba9085c9fcbe1bc274
commit-date: 2023-11-23
host: x86_64-unknown-linux-gnu
release: 1.76.0-nightly
LLVM version: 17.0.5
➜ ~ cargo -Vv
cargo 1.76.0-nightly (71cd3a926 2023-11-20)
release: 1.76.0-nightly
commit-hash: 71cd3a926f0cf41eeaf9f2a7f2194b2aff85b0f6
commit-date: 2023-11-20
host: x86_64-unknown-linux-gnu
libgit2: 1.7.1 (sys:0.18.1 vendored)
libcurl: 8.4.0-DEV (sys:0.4.68+curl-8.4.0 vendored ssl:OpenSSL/1.1.1u)
ssl: OpenSSL 1.1.1u 30 May 2023
os: Ubuntu 22.04 (jammy) [64-bit]
Environment variables CARGO_PKG_*
work well.
Are you using EmitBuilder::builder().emit()
, without anything between .builder()
and .emit()
?
There needs to be additional methods in there to select which environment variables to emit - https://docs.rs/vergen/8.2.6/vergen/struct.EmitBuilder.html
e.g.
EmitBuilder::builder()
.all_rustc()
.all_build()
.emit()
or
EmitBuilder::builder()
.rustc_semver()
.build_timestamp()
.emit()
This caught me out too (#282)
This should be resolved with the 8.2.8 release. Please feel free to re-open if it isn't
I am currently using