Skip to content

Commit 120dd6e

Browse files
committed
Run extracted binary in integration tests (qemu wrapped)
1 parent 3f787a4 commit 120dd6e

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

integration/test/Testlib/ModService.hs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,17 @@ withProcess resource overrides service = do
508508
_ -> do
509509
config <- getConfig
510510
tempFile <- writeTempFile "/tmp" (execName <> "-" <> domain <> "-" <> ".yaml") (cs $ Yaml.encode config)
511-
(_, Just stdoutHdl, Just stderrHdl, ph) <- createProcess (proc exe ["-c", tempFile]) {cwd = cwd, std_out = CreatePipe, std_err = CreatePipe}
511+
-- Use extracted production binary for brig (debugging hack)
512+
let brigBinary = case service of
513+
Brig -> case cwd of
514+
Nothing -> "./brig-5.25.0"
515+
Just _ -> "../../brig-5.25.0"
516+
_ -> exe
517+
-- Wrap brig with qemu to enforce x86-64-v3 compatibility (explicitly disable AVX-512)
518+
let (exePath, args) = case (service, execName) of
519+
(Brig, "brig") -> ("qemu-x86_64", ["-cpu", "EPYC,-xsavec,-misalignsse,-topoext,-avx512f,-avx512dq,-avx512cd,-avx512bw,-avx512vl", brigBinary, "-c", tempFile])
520+
_ -> (brigBinary, ["-c", tempFile])
521+
(_, Just stdoutHdl, Just stderrHdl, ph) <- createProcess (proc exePath args) {cwd = cwd, std_out = CreatePipe, std_err = CreatePipe}
512522
let colorize = fromMaybe id (lookup execName processColors)
513523
void $ forkIO $ logToConsoleDebug (Just stdOut) colorize prefix stdoutHdl
514524
void $ forkIO $ logToConsoleDebug (Just stdErr) colorize prefix stderrHdl

0 commit comments

Comments
 (0)