(mut bench_cmd: CommandBuilder)
| 55 | /// spawned scope inherit it. |
| 56 | #[cfg(target_os = "linux")] |
| 57 | pub fn wrap_isolation_scope(mut bench_cmd: CommandBuilder) -> Result<CommandBuilder> { |
| 58 | use crate::executor::helpers::env::is_codspeed_debug_enabled; |
| 59 | |
| 60 | let mut cmd_builder = CommandBuilder::new("systemd-run"); |
| 61 | if !is_codspeed_debug_enabled() { |
| 62 | cmd_builder.arg("--quiet"); |
| 63 | } |
| 64 | cmd_builder.arg("--slice=codspeed.slice"); |
| 65 | cmd_builder.arg("--scope"); |
| 66 | cmd_builder.arg("--same-dir"); |
| 67 | cmd_builder.arg(format!("--uid={}", nix::unistd::Uid::current().as_raw())); |
| 68 | cmd_builder.arg(format!("--gid={}", nix::unistd::Gid::current().as_raw())); |
| 69 | cmd_builder.args(["--"]); |
| 70 | |
| 71 | bench_cmd.wrap_with(cmd_builder); |
| 72 | Ok(bench_cmd) |
| 73 | } |
| 74 | |
| 75 | /// Dummy implementation on non-Linux platforms: the benchmark command is returned as-is. |
| 76 | // TODO(COD-2513): implement an equivalent process-isolation mechanism on macOS |
no test coverage detected