Skip to content

Commit 6aa371e

Browse files
committed
chore: bump valgrind-codspeed version to 3.24.0-0codspeed1 and change supported systems
- drop support for ubuntu 20.04 x86 - drop support for debian 11 - add ubuntu 24.04 arm64 support - add support for debian 12 aarch64
1 parent f3fefb7 commit 6aa371e

5 files changed

Lines changed: 30 additions & 20 deletions

File tree

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "codspeed-runner"
3-
version = "3.2.2"
3+
version = "3.3.0-beta.4"
44
edition = "2021"
55
repository = "https://github.com/CodSpeedHQ/runner"
66
publish = false

src/main.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,22 @@ mod request_client;
99
mod run;
1010

1111
use console::style;
12+
use lazy_static::lazy_static;
1213
use local_logger::clean_logger;
1314
use prelude::*;
1415

1516
use log::log_enabled;
1617

1718
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
1819
pub const MONGODB_TRACER_VERSION: &str = "cs-mongo-tracer-v0.2.0";
19-
pub const VALGRIND_CODSPEED_VERSION: &str = "3.21.0-0codspeed3";
20+
pub const VALGRIND_CODSPEED_VERSION: &str = "3.24.0-0codspeed";
21+
const VALGRIND_CODSPEED_VERSION_DEB_POST_REV: u32 = 1;
22+
lazy_static! {
23+
pub static ref VALGRIND_CODSPEED_DEB_VERSION: String = format!(
24+
"{}{}",
25+
VALGRIND_CODSPEED_VERSION, VALGRIND_CODSPEED_VERSION_DEB_POST_REV
26+
);
27+
}
2028

2129
#[tokio::main(flavor = "current_thread")]
2230
async fn main() {

src/run/check_system.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,12 @@ impl SystemInfo {
9898
lazy_static! {
9999
static ref SUPPORTED_SYSTEMS: HashSet<(&'static str, &'static str, &'static str)> = {
100100
HashSet::from([
101-
("ubuntu", "20.04", "x86_64"),
102101
("ubuntu", "22.04", "x86_64"),
103102
("ubuntu", "24.04", "x86_64"),
104103
("ubuntu", "22.04", "aarch64"),
105-
("debian", "11", "x86_64"),
104+
("ubuntu", "24.04", "aarch64"),
106105
("debian", "12", "x86_64"),
106+
("debian", "12", "aarch64"),
107107
])
108108
};
109109
}

src/run/runner/valgrind/setup.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@ use std::{
66
use url::Url;
77

88
use super::helpers::download_file::download_file;
9-
use crate::run::{check_system::SystemInfo, config::Config};
109
use crate::{prelude::*, MONGODB_TRACER_VERSION, VALGRIND_CODSPEED_VERSION};
10+
use crate::{
11+
run::{check_system::SystemInfo, config::Config},
12+
VALGRIND_CODSPEED_DEB_VERSION,
13+
};
1114

1215
/// Run a command with sudo if available
1316
fn run_with_sudo(command_args: &[&str]) -> Result<()> {
@@ -44,18 +47,18 @@ fn get_codspeed_valgrind_filename(system_info: &SystemInfo) -> Result<String> {
4447
system_info.os_version.as_str(),
4548
system_info.arch.as_str(),
4649
) {
47-
("ubuntu", "20.04", "x86_64") | ("debian", "11", "x86_64") | ("debian", "12", "x86_64") => {
48-
("20.04", "amd64")
49-
}
50-
("ubuntu", "22.04", "x86_64") => ("22.04", "amd64"),
50+
("ubuntu", "22.04", "x86_64") | ("debian", "12", "x86_64") => ("22.04", "amd64"),
5151
("ubuntu", "24.04", "x86_64") => ("24.04", "amd64"),
52-
("ubuntu", "22.04", "aarch64") => ("22.04", "arm64"),
52+
("ubuntu", "22.04", "aarch64") | ("debian", "12", "aarch64") => ("22.04", "arm64"),
53+
("ubuntu", "24.04", "aarch64") => ("24.04", "arm64"),
5354
_ => bail!("Unsupported system"),
5455
};
5556

5657
Ok(format!(
5758
"valgrind_{}_ubuntu-{}_{}.deb",
58-
VALGRIND_CODSPEED_VERSION, version, architecture
59+
VALGRIND_CODSPEED_DEB_VERSION.as_str(),
60+
version,
61+
architecture
5962
))
6063
}
6164

@@ -74,8 +77,7 @@ fn is_valgrind_installed() -> bool {
7477
}
7578

7679
let version = String::from_utf8_lossy(&version_output.stdout);
77-
// TODO: use only VALGRIND_CODSPEED_VERSION here, the other value is when valgrind has been built locally
78-
version.contains("valgrind-3.21.0.codspeed") || version.contains(VALGRIND_CODSPEED_VERSION)
80+
version.contains(VALGRIND_CODSPEED_VERSION)
7981
} else {
8082
false
8183
}
@@ -89,7 +91,7 @@ async fn install_valgrind(system_info: &SystemInfo) -> Result<()> {
8991
debug!("Installing valgrind");
9092
let valgrind_deb_url = format!(
9193
"https://github.com/CodSpeedHQ/valgrind-codspeed/releases/download/{}/{}",
92-
VALGRIND_CODSPEED_VERSION,
94+
VALGRIND_CODSPEED_DEB_VERSION.as_str(),
9395
get_codspeed_valgrind_filename(system_info)?
9496
);
9597
let deb_path = env::temp_dir().join("valgrind-codspeed.deb");
@@ -155,7 +157,7 @@ mod tests {
155157
};
156158
assert_snapshot!(
157159
get_codspeed_valgrind_filename(&system_info).unwrap(),
158-
@"valgrind_3.21.0-0codspeed3_ubuntu-22.04_amd64.deb"
160+
@"valgrind_3.24.0-0codspeed1_ubuntu-22.04_amd64.deb"
159161
);
160162
}
161163

@@ -169,21 +171,21 @@ mod tests {
169171
};
170172
assert_snapshot!(
171173
get_codspeed_valgrind_filename(&system_info).unwrap(),
172-
@"valgrind_3.21.0-0codspeed3_ubuntu-24.04_amd64.deb"
174+
@"valgrind_3.24.0-0codspeed1_ubuntu-24.04_amd64.deb"
173175
);
174176
}
175177

176178
#[test]
177179
fn test_system_info_to_codspeed_valgrind_version_debian() {
178180
let system_info = SystemInfo {
179181
os: "debian".to_string(),
180-
os_version: "11".to_string(),
182+
os_version: "12".to_string(),
181183
arch: "x86_64".to_string(),
182184
..SystemInfo::test()
183185
};
184186
assert_snapshot!(
185187
get_codspeed_valgrind_filename(&system_info).unwrap(),
186-
@"valgrind_3.21.0-0codspeed3_ubuntu-20.04_amd64.deb"
188+
@"valgrind_3.24.0-0codspeed1_ubuntu-22.04_amd64.deb"
187189
);
188190
}
189191

@@ -197,7 +199,7 @@ mod tests {
197199
};
198200
assert_snapshot!(
199201
get_codspeed_valgrind_filename(&system_info).unwrap(),
200-
@"valgrind_3.21.0-0codspeed3_ubuntu-22.04_arm64.deb"
202+
@"valgrind_3.24.0-0codspeed1_ubuntu-22.04_arm64.deb"
201203
);
202204
}
203205
}

0 commit comments

Comments
 (0)