diff options
| author | Ben Sima <ben@bensima.com> | 2025-12-23 08:57:36 -0500 |
|---|---|---|
| committer | Ben Sima <ben@bensima.com> | 2025-12-23 08:57:36 -0500 |
| commit | bb94aa3572706f8af13ace6356acd0f8a8307866 (patch) | |
| tree | da1a5cd0b3cda54b8135252d121458eadad15a59 /Omni/Ci.hs | |
| parent | 644781efd6ed705eeb6f1048ed9b07769aa85d63 (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>
Diffstat (limited to 'Omni/Ci.hs')
| -rwxr-xr-x | Omni/Ci.hs | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 |
