security: only print friendly env vars
People often store secrets in the environment, and likely would
prefer to avoid exposing them in CI logs and the like.
dump those behind a gated env var named `PGX_BUILD_VERBOSE`
@@ -47,10 +47,12 @@ impl bindgen::callbacks::ParseCallbacks for IgnoredMacros {
}
fn main() -> Result<(), std::io::Error> {
- // dump our environment
+ // dump the environment for debugging if asked
+ if std::env::var("PGX_BUILD_VERBOSE").unwrap_or("false".to_string()) == "true" {
for (k, v) in std::env::vars() {
eprintln!("{}={}", k, v);
}
+ }
let manifest_dir = PathBuf::from(std::env::var("CARGO_MANIFEST_DIR").unwrap());
let out_dir = PathBuf::from(format!(
