feat: add script/count-blocked-by-build-error#13471
Open
kim-em wants to merge 1 commit intoleanprover:masterfrom
Open
feat: add script/count-blocked-by-build-error#13471kim-em wants to merge 1 commit intoleanprover:masterfrom
script/count-blocked-by-build-error#13471kim-em wants to merge 1 commit intoleanprover:masterfrom
Conversation
|
Mathlib CI status (docs):
|
Collaborator
|
Reference manual CI status:
|
This PR adds a standalone Python script that wraps `lake build`, captures its output, and for each failed module reports how many modules in the selected `lean_lib`s transitively import it. The count is an upper bound on how many downstream modules were blocked by the failure in the workspace. The script enumerates modules via `lake query <lib>:modules`, builds the forward import graph using batched `lake query +M:imports --json` calls, and inverts it locally. A batched query that fails (e.g. because one module has an unparsable header) is bisected down to singletons so one bad file doesn't drop the whole report. This is a follow-up to leanprover#13454 (which added `lake build --summary`). The original issue leanprover#13316 asked for blocked-downstream counts inside Lake itself; moving that computation to a standalone script keeps Lake's build-reporting path minimal and avoids re-parsing every workspace module from within the build runner. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
9730091 to
b8636c4
Compare
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.
This PR adds a standalone Python script that wraps
lake build, captures its output, and for each failed module reports how many modules in the selectedlean_libs transitively import it. The count is an upper bound on how many downstream modules were blocked by the failure in the workspace.The script enumerates modules via
lake query <lib>:modules, builds the forward import graph using batchedlake query +M:imports --jsoncalls, and inverts it locally. A batched query that fails (e.g. because one module has an unparsable header) is bisected down to singletons so one bad file doesn't drop the whole report.Example output:
This is a follow-up to #13454 (which added
lake build --summary). The original issue #13316 asked for blocked-downstream counts inside Lake itself; moving that computation to a standalone script keeps Lake's build-reporting path minimal and avoids re-parsing every workspace module from within the build runner.🤖 Prepared with Claude Code