read_log_tail
Read the tail of a build log to identify termination errors, then page upward using the before_line parameter for context. Diagnose build failures by inspecting the end of the log.
Instructions
Read a page of a build log from the end, and page upward from there.
Good for how the build terminated (RPM build errors:, the mock
exception). To FIND a compile error, use search_log — the end of a
make -j log holds only the wrapper error.
One call returns as many lines as fit in max_chars (~10k tokens), up to
lines lines. That budget is what sizes the page: the same budget is about
165 lines of a mock_build log or 350 of a mock_root, so a fixed line count
would be wrong for one of them. The result ends with the exact call for the
page above it — before_line=<first line shown> — so walking a log bottom
to top needs no arithmetic and skips nothing.
before_line=N reads the page ending at line N-1. Each line is clipped to
max_line_chars (0 = verbatim); keep the clip on, mock_build lines can be
several KB of gcc flags. The log is downloaded automatically if not already
on disk — no need to call download_log first.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lines | No | ||
| build_id | Yes | ||
| filename | Yes | ||
| max_chars | No | ||
| before_line | No | ||
| max_line_chars | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |