Skip to content

Commit 9f29412

Browse files
authored
Merge pull request #2187 from reaperhulk/fix-again
don't emit rerun-if-changed unless the path exists and is readable
2 parents 3439059 + d5e6fb5 commit 9f29412

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

openssl-sys/build/main.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,11 @@ fn main() {
8282
// rerun-if-changed causes openssl-sys to rebuild if the openssl include
8383
// dir has changed since the last build. However, this causes a rebuild
8484
// every time when vendoring so we disable it.
85-
#[cfg(not(feature = "vendored"))]
86-
if let Some(printable_include) = include_dir.join("openssl").to_str() {
87-
println!("cargo:rerun-if-changed={}", printable_include);
85+
let potential_path = include_dir.join("openssl");
86+
if potential_path.exists() && !cfg!(feature = "vendored") {
87+
if let Some(printable_include) = potential_path.to_str() {
88+
println!("cargo:rerun-if-changed={}", printable_include);
89+
}
8890
}
8991

9092
if !lib_dirs.iter().all(|p| p.exists()) {

0 commit comments

Comments
 (0)