Debug build.rs issues by running cargo build -vv to see the exact command line arguments and environment variables passed to your build script.
cargo build -vv
If the script fails due to missing dependencies or environment variables, check the RUSTC and OUT_DIR variables printed in the verbose output, then add println!("cargo:warning={}", "Your debug message"); to your build.rs to confirm execution order.