Skip to content

Commit 95b16a2

Browse files
ci: wrap linting with stdbuf -oL so log output appears immediately (leanprover-community#33783)
leanprover-community#33696 changed the linting step so that it pipes its output into `tee`; this causes `lake exe runLinter` to block buffer its output, which means that if the linters freeze (cf. [#mathlib4 > slow linting step CI?](https://leanprover.zulipchat.com/#narrow/channel/287929-mathlib4/topic/slow.20linting.20step.20CI.3F/with/567049377)), we may not see all of the log output. This PR uses [`stdbuf -oL`](https://www.gnu.org/software/coreutils/manual/html_node/stdbuf-invocation.html) to make the output line buffered instead, which should solve this.
1 parent ee6d0f1 commit 95b16a2

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

.github/build.in.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,7 +503,7 @@ jobs:
503503
cd pr-branch
504504
# Try running with --trace; if it fails due to argument parsing, the PR needs to merge master
505505
# We use .lake/ for the output file because landrun restricts /tmp access
506-
if ! env LEAN_ABORT_ON_PANIC=1 lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
506+
if ! env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
507507
if grep -q "cannot parse arguments" .lake/lint_output.txt; then
508508
echo ""
509509
echo "=============================================================================="

.github/workflows/bors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ jobs:
513513
cd pr-branch
514514
# Try running with --trace; if it fails due to argument parsing, the PR needs to merge master
515515
# We use .lake/ for the output file because landrun restricts /tmp access
516-
if ! env LEAN_ABORT_ON_PANIC=1 lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
516+
if ! env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
517517
if grep -q "cannot parse arguments" .lake/lint_output.txt; then
518518
echo ""
519519
echo "=============================================================================="

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -519,7 +519,7 @@ jobs:
519519
cd pr-branch
520520
# Try running with --trace; if it fails due to argument parsing, the PR needs to merge master
521521
# We use .lake/ for the output file because landrun restricts /tmp access
522-
if ! env LEAN_ABORT_ON_PANIC=1 lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
522+
if ! env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
523523
if grep -q "cannot parse arguments" .lake/lint_output.txt; then
524524
echo ""
525525
echo "=============================================================================="

.github/workflows/build_fork.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ jobs:
517517
cd pr-branch
518518
# Try running with --trace; if it fails due to argument parsing, the PR needs to merge master
519519
# We use .lake/ for the output file because landrun restricts /tmp access
520-
if ! env LEAN_ABORT_ON_PANIC=1 lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
520+
if ! env LEAN_ABORT_ON_PANIC=1 stdbuf -oL lake exe runLinter --trace Mathlib 2>&1 | tee .lake/lint_output.txt; then
521521
if grep -q "cannot parse arguments" .lake/lint_output.txt; then
522522
echo ""
523523
echo "=============================================================================="

0 commit comments

Comments
 (0)