Skip to content

Commit

Permalink
Make sure that build scripts use rerun-if-changed in a correct way
Browse files Browse the repository at this point in the history
For lana, this script is self contained so it should explicitly depend
only on itself. For toplevel, we don't need to check changes in crates
and src if the bypass is in place.
  • Loading branch information
tomaszklak committed Dec 20, 2024
1 parent 0d420fc commit 003ddbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ fn check_git_hooks() -> Result<()> {
}

fn verify_llt_secrets() {
println!("cargo:rerun-if-changed=./crates");
println!("cargo:rerun-if-changed=./src");

if !env::var("GITLAB_CI")
.or(env::var("GITHUB_ACTIONS"))
.is_ok_and(|value| value == "true")
Expand All @@ -85,6 +82,9 @@ fn verify_llt_secrets() {
return;
}

println!("cargo:rerun-if-changed=./crates");
println!("cargo:rerun-if-changed=./src");

#[allow(clippy::panic)]
match check_git_secrets().and_then(|_| check_git_hooks()) {
Ok(_) => {}
Expand Down
1 change: 1 addition & 0 deletions crates/telio-lana/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use anyhow::Result;
#[allow(unwrap_check)]
fn main() -> Result<()> {
println!("cargo:rerun-if-changed=build.rs");
let target_os = std::env::var("CARGO_CFG_TARGET_OS")?;
if target_os == "windows" {
if let Some(path) = std::option_env!("OUT_DIR") {
Expand Down

0 comments on commit 003ddbb

Please sign in to comment.