(mut bench_cmd: CommandBuilder)
| 166 | /// its working directory, which `--same-dir` propagates into the scope. |
| 167 | #[cfg(target_os = "linux")] |
| 168 | fn wrap_isolation_scope(mut bench_cmd: CommandBuilder) -> Result<CommandBuilder> { |
| 169 | use crate::executor::helpers::env::is_codspeed_debug_enabled; |
| 170 | |
| 171 | let mut cmd_builder = CommandBuilder::new("systemd-run"); |
| 172 | if !is_codspeed_debug_enabled() { |
| 173 | cmd_builder.arg("--quiet"); |
| 174 | } |
| 175 | cmd_builder.arg("--slice=codspeed.slice"); |
| 176 | cmd_builder.arg("--scope"); |
| 177 | cmd_builder.arg("--same-dir"); |
| 178 | cmd_builder.arg(format!("--uid={}", nix::unistd::Uid::current().as_raw())); |
| 179 | cmd_builder.arg(format!("--gid={}", nix::unistd::Gid::current().as_raw())); |
| 180 | cmd_builder.args(["--"]); |
| 181 | |
| 182 | bench_cmd.wrap_with(cmd_builder); |
| 183 | Ok(bench_cmd) |
| 184 | } |
| 185 | |
| 186 | /// Dummy implementation on non-Linux platforms: the benchmark command is returned as-is. |
| 187 | // TODO(COD-2513): implement an equivalent process-isolation mechanism on macOS |
no test coverage detected