Skip to content

Commit 67a6ec0

Browse files
committed
fix: try to support appimages in rr_dispatcher: still problems
try with upstream `rr` in PATH and ct rr worker trying to use it: but hanging; the test seems to be ok with the dev worker
1 parent 4b83ed7 commit 67a6ec0

File tree

2 files changed

+31
-11
lines changed

2 files changed

+31
-11
lines changed

src/db-backend/src/rr_dispatcher.rs

Lines changed: 30 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ use std::path::{Path, PathBuf};
66
use std::process::{Child, Command, Stdio};
77
use std::thread;
88
use std::time::Duration;
9+
use std::ffi::OsStr;
910

1011
use log::{info, warn, error};
1112
use runtime_tracing::StepId;
@@ -58,23 +59,41 @@ impl CtRRWorker {
5859
}
5960

6061
pub fn start(&mut self) -> Result<(), Box<dyn Error>> {
62+
let is_appimage = self.ct_rr_worker_exe.extension() == Some(OsStr::new("AppImage"));
6163
info!(
62-
"start: {} --name {} --index {} replay {}",
64+
"start: {}{} replay --name {} --index {} {}",
65+
if !is_appimage { "" } else { "appimage-run " },
6366
self.ct_rr_worker_exe.display(),
6467
self.name,
6568
self.index,
6669
self.rr_trace_folder.display()
6770
);
68-
let ct_worker = Command::new(&self.ct_rr_worker_exe)
69-
.arg("replay")
70-
.arg("--name")
71-
.arg(&self.name)
72-
.arg("--index")
73-
.arg(self.index.to_string())
74-
.arg(&self.rr_trace_folder)
75-
.stdin(Stdio::piped())
76-
.stdout(Stdio::piped())
77-
.spawn()?;
71+
72+
let ct_worker = if !is_appimage {
73+
Command::new(&self.ct_rr_worker_exe)
74+
.arg("replay")
75+
.arg("--name")
76+
.arg(&self.name)
77+
.arg("--index")
78+
.arg(self.index.to_string())
79+
.arg(&self.rr_trace_folder)
80+
.stdin(Stdio::piped())
81+
.stdout(Stdio::piped())
82+
.spawn()?
83+
84+
} else {
85+
Command::new("appimage-run")
86+
.arg(&self.ct_rr_worker_exe)
87+
.arg("replay")
88+
.arg("--name")
89+
.arg(&self.name)
90+
.arg("--index")
91+
.arg(self.index.to_string())
92+
.arg(&self.rr_trace_folder)
93+
.stdin(Stdio::piped())
94+
.stdout(Stdio::piped())
95+
.spawn()?
96+
};
7897

7998
self.process = Some(ct_worker);
8099
self.setup_worker_sockets()?;

src/db-backend/tests/rr_test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ fn test_rr() {
4848
request: None,
4949
typ: None,
5050
session_id: None,
51+
// TODO: env var, or taking from $PATH, or from local or test config?
5152
ct_rr_worker_exe: Some(PathBuf::from("/home/alexander92/codetracer-rr-backend/src/build-debug/bin/ct-rr-worker")),
5253
};
5354
let launch = client.launch(launch_args).unwrap();

0 commit comments

Comments
 (0)