launchWorker :: TestConfig -> Int -> IO Process
launchWorker c pid = do
    -- (hin,hout,herr,phandle) <- runInteractiveProcess workerPath [] Nothing (Just [("CCI_CONFIG","cci.ini"),("LD_LIBRARY_PATH","cci/built/lib")])
    herr <- openBinaryFile (workerStderr pid) WriteMode
    (Just hin,Just hout,_herr,phandle) <- createProcess CreateProcess 
                                  { cmdspec = if withValgrind c then RawCommand "valgrind" ["--suppressions=cci.supp","--quiet", workerPath]
                                                else RawCommand workerPath []
                                  , cwd = Nothing
                                  , env = Nothing
                                  , std_in = CreatePipe
                                  , std_out = CreatePipe
                                  , std_err = UseHandle herr
                                  , close_fds = False
                                  , create_group = False
                                  }

    -- (hin,hout,herr,phandle) <- runInteractiveCommand$ "CCI_CONFIG=cci.ini "++workerPath++" 2> worker-stderr"++show pid++".txt"
    -- void$ forkIO$ hGetContents herr >>= writeFile ("worker-stderr"++show pid++".txt") >> putStrLn ("wrote "++show pid)
    puri <- hGetLine hout
    return Process 
        { h_in = hin
        , h_out = hout
        , ph = phandle
        , uri = puri
        }
launchWorker :: TestConfig -> Int -> IO Process
launchWorker c pid = do
    -- (hin,hout,herr,phandle) <- runInteractiveProcess workerPath [] Nothing (Just [("CCI_CONFIG","cci.ini"),("LD_LIBRARY_PATH","cci/built/lib")])
    herr <- openBinaryFile (workerStderr pid) WriteMode
    (Just hin,Just hout,_herr,phandle) <- createProcess CreateProcess 
                                  { cmdspec = if withValgrind c then RawCommand "valgrind" ["--suppressions=cci.supp","--quiet", workerPath]
                                                else RawCommand workerPath []
                                  , cwd = Nothing
                                  , env = Nothing
                                  , std_in = CreatePipe
                                  , std_out = CreatePipe
                                  , std_err = UseHandle herr
                                  , close_fds = False
                                  , create_group = False
                                  }

    -- (hin,hout,herr,phandle) <- runInteractiveCommand$ "CCI_CONFIG=cci.ini "++workerPath++" 2> worker-stderr"++show pid++".txt"
    -- void$ forkIO$ hGetContents herr >>= writeFile ("worker-stderr"++show pid++".txt") >> putStrLn ("wrote "++show pid)
    puri <- hGetLine hout
    return Process 
        { h_in = hin
        , h_out = hout
        , ph = phandle
        , uri = puri
        }
launchWorker c pid = do
    -- (hin,hout,herr,phandle) <- runInteractiveProcess workerPath [] Nothing (Just [("CCI_CONFIG","cci.ini"),("LD_LIBRARY_PATH","cci/built/lib")])
    herr <- openBinaryFile (workerStderr pid) WriteMode
    (Just hin,Just hout,_herr,phandle) <- createProcess CreateProcess 
                                  { cmdspec = if withValgrind c then RawCommand "valgrind" ["--suppressions=cci.supp","--quiet", workerPath]
                                                else RawCommand workerPath []
                                  , cwd = Nothing
                                  , env = Nothing
                                  , std_in = CreatePipe
                                  , std_out = CreatePipe
                                  , std_err = UseHandle herr
                                  , close_fds = False
                                  , create_group = False
                                  }

    -- (hin,hout,herr,phandle) <- runInteractiveCommand$ "CCI_CONFIG=cci.ini "++workerPath++" 2> worker-stderr"++show pid++".txt"
    -- void$ forkIO$ hGetContents herr >>= writeFile ("worker-stderr"++show pid++".txt") >> putStrLn ("wrote "++show pid)
    puri <- hGetLine hout
    return Process 
        { h_in = hin
        , h_out = hout
        , ph = phandle
        , uri = puri
        }