MCPcopy Create free account
hub / github.com/CodSpeedHQ/codspeed / get_codspeed_valgrind_target

Function get_codspeed_valgrind_target

src/executor/valgrind/setup.rs:13–44  ·  view source on GitHub ↗
(system_info: &SystemInfo)

Source from the content-addressed store, hash-verified

11use std::{env, path::Path, process::Command};
12
13fn get_codspeed_valgrind_target(system_info: &SystemInfo) -> Result<ValgrindTarget> {
14 let SupportedOs::Linux(distro) = &system_info.os else {
15 bail!("Unsupported system");
16 };
17
18 let (distro_version, arch) = match (distro, system_info.arch.as_str()) {
19 (LinuxDistribution::Ubuntu { version }, "x86_64")
20 | (LinuxDistribution::Debian { version }, "x86_64")
21 if version == "22.04" || version == "12" =>
22 {
23 (DistroVersion::Ubuntu2204, Arch::Amd64)
24 }
25 (LinuxDistribution::Ubuntu { version }, "x86_64") if version == "24.04" => {
26 (DistroVersion::Ubuntu2404, Arch::Amd64)
27 }
28 (LinuxDistribution::Ubuntu { version }, "aarch64")
29 | (LinuxDistribution::Debian { version }, "aarch64")
30 if version == "22.04" || version == "12" =>
31 {
32 (DistroVersion::Ubuntu2204, Arch::Arm64)
33 }
34 (LinuxDistribution::Ubuntu { version }, "aarch64") if version == "24.04" => {
35 (DistroVersion::Ubuntu2404, Arch::Arm64)
36 }
37 _ => bail!("Unsupported system"),
38 };
39
40 Ok(ValgrindTarget {
41 distro_version,
42 arch,
43 })
44}
45
46fn get_codspeed_valgrind_binary(system_info: &SystemInfo) -> Result<PinnedBinary> {
47 Ok(PinnedBinary::ValgrindDeb(get_codspeed_valgrind_target(

Calls 1

as_strMethod · 0.80

Tested by

no test coverage detected