Skip to content

Commit d3249c0

Browse files
committed
chore: revert fifo env base dir
1 parent 08752a0 commit d3249c0

File tree

2 files changed

+6
-24
lines changed

2 files changed

+6
-24
lines changed

crates/codspeed/src/fifo.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ pub struct BenchGuard {
1414
}
1515

1616
impl BenchGuard {
17-
pub fn new<P: Into<PathBuf>>(ctl_fifo: P, ack_fifo: P) -> anyhow::Result<Self> {
17+
pub fn new(ctl_fifo: &str, ack_fifo: &str) -> anyhow::Result<Self> {
1818
let mut instance = Self {
1919
ctl_fifo: FifoIpc::connect(ctl_fifo)?.with_writer()?,
2020
ack_fifo: FifoIpc::connect(ack_fifo)?.with_reader()?,
@@ -24,7 +24,7 @@ impl BenchGuard {
2424
}
2525

2626
pub fn new_with_runner_fifo() -> anyhow::Result<Self> {
27-
Self::new(runner_ctl_fifo_path()?, runner_ack_fifo_path()?)
27+
Self::new(RUNNER_CTL_FIFO, RUNNER_ACK_FIFO)
2828
}
2929

3030
fn send_cmd(&mut self, cmd: Command) -> anyhow::Result<()> {
@@ -43,10 +43,10 @@ impl Drop for BenchGuard {
4343
}
4444

4545
pub fn send_cmd(cmd: Command) -> anyhow::Result<()> {
46-
let mut writer = FifoIpc::connect(runner_ctl_fifo_path()?)?.with_writer()?;
46+
let mut writer = FifoIpc::connect(RUNNER_CTL_FIFO)?.with_writer()?;
4747
writer.send_cmd(cmd).unwrap();
4848

49-
let mut reader = FifoIpc::connect(runner_ack_fifo_path()?)?.with_reader()?;
49+
let mut reader = FifoIpc::connect(RUNNER_ACK_FIFO)?.with_reader()?;
5050
reader.wait_for_ack();
5151

5252
Ok(())

crates/codspeed/src/shared.rs

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,10 @@
1-
use std::path::PathBuf;
2-
3-
use anyhow::Context;
4-
51
// !!!!!!!!!!!!!!!!!!!!!!!!
62
// !! DO NOT TOUCH BELOW !!
73
// !!!!!!!!!!!!!!!!!!!!!!!!
84
// Has to be in sync with `runner`.
95
//
10-
const RUNNER_CTL_FIFO_NAME: &str = "runner.ctl.fifo";
11-
const RUNNER_ACK_FIFO_NAME: &str = "runner.ack.fifo";
12-
13-
pub fn runner_fifo_dir() -> anyhow::Result<PathBuf> {
14-
let raw_path = std::env::var("CODSPEED_FIFO_DIR")
15-
.context("CODSPEED_FIFO_DIR environment variable not set")?;
16-
Ok(PathBuf::from(raw_path))
17-
}
18-
19-
pub fn runner_ctl_fifo_path() -> anyhow::Result<PathBuf> {
20-
runner_fifo_dir().map(|p| p.join(RUNNER_CTL_FIFO_NAME))
21-
}
22-
23-
pub fn runner_ack_fifo_path() -> anyhow::Result<PathBuf> {
24-
runner_fifo_dir().map(|p| p.join(RUNNER_ACK_FIFO_NAME))
25-
}
6+
pub const RUNNER_CTL_FIFO: &str = "/tmp/runner.ctl.fifo";
7+
pub const RUNNER_ACK_FIFO: &str = "/tmp/runner.ack.fifo";
268

279
#[derive(serde::Serialize, serde::Deserialize, Debug, PartialEq)]
2810
pub enum Command {

0 commit comments

Comments
 (0)