Skip to content

fix: improve error handling in build script and CI workflow#1

Open
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1780493469-improve-error-handling
Open

fix: improve error handling in build script and CI workflow#1
devin-ai-integration[bot] wants to merge 1 commit into
mainfrom
devin/1780493469-improve-error-handling

Conversation

@devin-ai-integration

Copy link
Copy Markdown

Summary

Fixes silently-swallowed errors in build.ps1 and improves error propagation in CI.

build.ps1 — Steps 1 & 2 used try/catch around native commands (elan), but PowerShell 5.1 does not throw terminating errors for non-zero exit codes from native executables. This meant failures from elan --version or elan toolchain install were silently ignored and execution continued. Fixed by replacing try/catch with explicit $LASTEXITCODE checks (matching the pattern already used in Steps 3 & 4) and capturing stderr via 2>&1 so actual error output is surfaced to the user.

CI workflow — Two issues:

  1. lake exe cache get failure killed the entire build. Cache unavailability is not fatal (the build succeeds without it, just slower), so it now emits a ::warning:: and continues.
  2. The sorry check only scanned HuangzhongLaw72.lean, missing HuangzhongLaw72_core.lean. Now iterates all *.lean files.

Link to Devin session: https://app.devin.ai/sessions/9a47ad4308d64b9e869e9bf180823b26
Requested by: @jackyfan01

build.ps1:
- Replace unreliable try/catch for native commands with  checks
  (PowerShell 5.1 does not throw on non-zero exit codes from native commands,
  so errors from elan/lake were silently swallowed)
- Capture and display actual error output from failed commands (2>&1)
- Use Tee-Object for lake commands to show output in real-time while
  also capturing it for error reporting
- Include exit codes in error messages for easier debugging

CI workflow (.github/workflows/lean-build.yml):
- Make 'lake exe cache get' non-fatal: emit a warning instead of failing
  the entire build when prebuilt cache is unavailable
- Expand sorry check to all .lean files (was only checking
  HuangzhongLaw72.lean, missing HuangzhongLaw72_core.lean)

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration

Copy link
Copy Markdown
Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant