crate2nix
crate2nix copied to clipboard
environment variable `CARGO_CRATE_NAME` not defined with dep opentelemetry-surf
[dependencies]
opentelemetry-surf = { git = "https://github.com/asaaki/opentelemetry-surf", branch = "main" }
builder for '/nix/store/601g5y6hd9wkz84csgp5915walkgv7ng-rust_opentelemetry-surf-0.1.1.drv' failed with exit code 1; last 10 log lines:
error: environment variable `CARGO_CRATE_NAME` not defined
--> src/lib.rs:51:26
|
51 | const CRATE_NAME: &str = env!("CARGO_CRATE_NAME");
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
Any ideas?
I am surprised this isn't set. But if you set this variable on the derivation in question, then also an env var with that name should be set.
I think I was able to workaround it by setting CARGO_CRATE_NAME
in Cargo.nix
.
You should be able to reproduce the problem with just:
[dependencies]
opentelemetry-tide = "0.6"
Hitting this problem for CARGO_PKG_LICENSE
as required by built, fwiw.