@@ -6,6 +6,7 @@ use std::path::{Path, PathBuf};
66use std:: process:: { Child , Command , Stdio } ;
77use std:: thread;
88use std:: time:: Duration ;
9+ use std:: ffi:: OsStr ;
910
1011use log:: { info, warn, error} ;
1112use 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 ( ) ?;
0 commit comments