@@ -148,57 +148,6 @@ jobs:
148148 ls .lake/build/bin/check-yaml
149149 ls .lake/packages/importGraph/.lake/build/bin/graph
150150
151- # TEMPORARY: remove everything below this after #27691 is merged
152- cat << 'EOF' > scripts/lake-build-with-retry.sh
153- #!/bin/bash
154- # Script to run lake build on a target until --no-build succeeds
155- # Usage: ./lake-build-with-retry.sh <target_name> [max_tries, default: 5]
156-
157- # Make this script robust against unintentional errors.
158- # See e.g. http://redsymbol.net/articles/unofficial-bash-strict-mode/ for explanation.
159- set -euo pipefail
160- IFS=$'\n\t'
161-
162- TARGET_NAME="$1"
163- MAX_TRIES="${2:-5}"
164-
165- if [ -z "$TARGET_NAME" ]; then
166- echo "Usage: $0 <target_name> [max_tries, default: 5]"
167- echo "Example: $0 Mathlib 5"
168- exit 1
169- fi
170-
171- echo "Building $TARGET_NAME with up to $MAX_TRIES attempts..."
172-
173- counter=0
174- while true; do
175- counter=$((counter + 1))
176-
177- echo "::group::{lake build: attempt $counter}"
178- bash -o pipefail -c "env LEAN_ABORT_ON_PANIC=1 lake build --wfail -KCI $TARGET_NAME"
179- echo "::endgroup::"
180-
181- echo "::group::{lake build --no-build: attempt $counter}"
182- set +e
183- lake build --no-build -v "$TARGET_NAME"
184- result=$?
185- set -e
186- echo "::endgroup::"
187-
188- if [ $result -eq 0 ]; then
189- echo "lake build --no-build succeeded!"
190- exit 0
191- fi
192-
193- if [ $counter -ge $MAX_TRIES ]; then
194- echo "Failed to build good oleans for $TARGET_NAME after $MAX_TRIES attempts!"
195- exit 1
196- fi
197- done
198- EOF
199-
200- chmod 755 scripts/lake-build-with-retry.sh
201-
202151 - name : cleanup .cache/mathlib
203152 # This needs write access to .cache/mathlib, so can't be run inside landrun.
204153 # However it is only using the `master` version of `cache`, so is safe to run outside landrun.
@@ -313,6 +262,13 @@ jobs:
313262 cd pr-branch
314263 du .lake/build/lib/lean/Mathlib || echo "This code should be unreachable"
315264
265+ - name : upload artifact containing contents of pr-branch
266+ # temporary measure for debugging no-build failures
267+ uses : actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
268+ with :
269+ name : mathlib4_artifact
270+ path : pr-branch/
271+
316272 # The cache secrets are available here, so we must not run any untrusted code.
317273 - name : upload cache
318274 # We only upload the cache if the build started (whether succeeding, failing, or cancelled)
@@ -365,7 +321,14 @@ jobs:
365321
366322 - name : Check if building Archive or Counterexamples failed
367323 if : steps.archive.outcome == 'failure' || steps.counterexamples.outcome == 'failure'
368- run : exit 1
324+ run : |
325+ if [ "${{ steps.archive.outcome }}" == "failure" ]; then
326+ echo "❌ The \"build archive\" step above failed; please check its logs."
327+ fi
328+ if [ "${{ steps.counterexamples.outcome }}" == "failure" ]; then
329+ echo "❌ The \"build counterexamples\" step above failed; please check its logs."
330+ fi
331+ exit 1
369332
370333 # The cache secrets are available here, so we must not run any untrusted code.
371334 - name : put archive and counterexamples cache
0 commit comments