Skip to content

Commit d6b498f

Browse files
authored
fix: fix valgrind version checks (#65)
Avoid using the deb package version since --version only outputs our version
1 parent 5a62a43 commit d6b498f

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/main.rs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,13 @@ use log::log_enabled;
1717

1818
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
1919
pub const MONGODB_TRACER_VERSION: &str = "cs-mongo-tracer-v0.2.0";
20-
pub const VALGRIND_CODSPEED_VERSION: &str = "3.24.0-0codspeed";
21-
const VALGRIND_CODSPEED_VERSION_DEB_POST_REV: u32 = 1;
20+
21+
const VALGRIND_CODSPEED_BASE_VERSION: &str = "3.24.0";
2222
lazy_static! {
23-
pub static ref VALGRIND_CODSPEED_DEB_VERSION: String = format!(
24-
"{}{}",
25-
VALGRIND_CODSPEED_VERSION, VALGRIND_CODSPEED_VERSION_DEB_POST_REV
26-
);
23+
pub static ref VALGRIND_CODSPEED_VERSION: String =
24+
format!("{VALGRIND_CODSPEED_BASE_VERSION}.codspeed");
25+
pub static ref VALGRIND_CODSPEED_DEB_VERSION: String =
26+
format!("{VALGRIND_CODSPEED_BASE_VERSION}-0codspeed1");
2727
}
2828

2929
#[tokio::main(flavor = "current_thread")]
@@ -43,7 +43,6 @@ async fn main() {
4343
}
4444
}
4545
clean_logger();
46-
4746
std::process::exit(1);
4847
}
4948
}

src/run/runner/valgrind/setup.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ fn is_valgrind_installed() -> bool {
7777
}
7878

7979
let version = String::from_utf8_lossy(&version_output.stdout);
80-
version.contains(VALGRIND_CODSPEED_VERSION)
80+
version.contains(VALGRIND_CODSPEED_VERSION.as_str())
8181
} else {
8282
false
8383
}

0 commit comments

Comments
 (0)