docs.rs
docs.rs copied to clipboard
Environment variable from `.cargo/config.toml` not defined at compile time
Crate name
kconfq
Build failure link
https://docs.rs/crate/kconfq/latest/builds/2828035
Additional details
My project has an optional build option that can be set via an env var (is that how you are actually supposed to do build options in cargo?). To give this env variable a default value to use it via env! macro, I have this inside the .cargo/config.toml file:
[env]
# Compile-time default config path for kconfq. Will be tried first before
# falling back to dynamic resolution
DEFAULT_CONFIG_PATH = ""
Locally cargo doc --all-features works fine, but docs.rs fail with a build error.
Nvm, fixed by using option_env! 🙂