fix: improve error handling in build script and CI workflow#1
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
fix: improve error handling in build script and CI workflow#1devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
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>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes silently-swallowed errors in
build.ps1and improves error propagation in CI.build.ps1— Steps 1 & 2 usedtry/catcharound native commands (elan), but PowerShell 5.1 does not throw terminating errors for non-zero exit codes from native executables. This meant failures fromelan --versionorelan toolchain installwere silently ignored and execution continued. Fixed by replacing try/catch with explicit$LASTEXITCODEchecks (matching the pattern already used in Steps 3 & 4) and capturing stderr via2>&1so actual error output is surfaced to the user.CI workflow — Two issues:
lake exe cache getfailure killed the entire build. Cache unavailability is not fatal (the build succeeds without it, just slower), so it now emits a::warning::and continues.sorrycheck only scannedHuangzhongLaw72.lean, missingHuangzhongLaw72_core.lean. Now iterates all*.leanfiles.Link to Devin session: https://app.devin.ai/sessions/9a47ad4308d64b9e869e9bf180823b26
Requested by: @jackyfan01