Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

don't emit rerun-if-changed unless the path exists and is readable #2187

Merged
merged 2 commits into from
Feb 22, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions openssl-sys/build/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ fn main() {
// rerun-if-changed causes openssl-sys to rebuild if the openssl include
// dir has changed since the last build. However, this causes a rebuild
// every time when vendoring so we disable it.
#[cfg(not(feature = "vendored"))]
if let Some(printable_include) = include_dir.join("openssl").to_str() {
println!("cargo:rerun-if-changed={}", printable_include);
let potential_path = include_dir.join("openssl");
if potential_path.exists() && !cfg!(feature = "vendored") {
if let Some(printable_include) = potential_path.to_str() {
println!("cargo:rerun-if-changed={}", printable_include);
}
}

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