summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Sima <ben@bensima.com>2025-12-23 08:57:36 -0500
committerBen Sima <ben@bensima.com>2025-12-23 08:57:36 -0500
commitbb94aa3572706f8af13ace6356acd0f8a8307866 (patch)
treeda1a5cd0b3cda54b8135252d121458eadad15a59
parent644781efd6ed705eeb6f1048ed9b07769aa85d63 (diff)
Omni/Ci: fix timeout and carriage return issues
- Add explicit --time 0 argument to bild test command - Add debug logging for BILD_ARGS environment variable - Strip ANSI escape sequences and carriage returns from error messages - Fixes ^M characters appearing in git notes - Ensures timeout is properly disabled for CI runs 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
-rwxr-xr-xOmni/Ci.hs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Omni/Ci.hs b/Omni/Ci.hs
index 04dba06..bc84aae 100755
--- a/Omni/Ci.hs
+++ b/Omni/Ci.hs
@@ -60,6 +60,7 @@ move args = do
currentBildArgs <- Environment.lookupEnv "BILD_ARGS"
let bildArgs = "--time 0 " <> fromMaybe "" currentBildArgs
Environment.setEnv "BILD_ARGS" bildArgs
+ Log.info ["ci", "set BILD_ARGS=" <> Text.pack bildArgs]
-- 3. Get user info
at <- readProcess "date" ["-u", "-R"] "" |> fmap chomp
@@ -146,7 +147,7 @@ move args = do
-- We can pass namespaces.
-- Let's try passing all files again.
-- bild handles namespaces.
- (exitCodeTest, _, testStderr) <- Process.readProcessWithExitCode "bild" ("--test" : allFiles) ""
+ (exitCodeTest, _, testStderr) <- Process.readProcessWithExitCode "bild" ("--test" : "--time" : "0" : allFiles) ""
pure <| case exitCodeTest of
Exit.ExitSuccess -> ("good", "")
_ -> ("fail", extractErrorMessage (Text.pack testStderr))
@@ -209,6 +210,7 @@ extractErrorMessage :: Text -> Text
extractErrorMessage output =
let errorLines =
Text.lines output
+ |> map stripAnsiEscapes -- Remove ANSI escape sequences
|> filter isErrorLine
|> take 5 -- Limit to first 5 error lines
cleaned =
@@ -230,3 +232,10 @@ extractErrorMessage output =
`Text.isInfixOf` stripped
)
&& not ("warning:" `Text.isInfixOf` stripped) -- Exclude warnings
+
+ -- Remove ANSI escape sequences including carriage returns
+ stripAnsiEscapes line =
+ line
+ |> Text.replace "\r" "" -- Remove carriage returns
+ |> Text.replace "\ESC[" "" -- Remove ANSI escape start
+ |> Text.filter (\c -> c >= ' ' || c == '\t') -- Keep only printable chars and tabs