Repository navigation
Conversation
The `stamp` attribute of `py_binary` and `py_test` transitions the `--stamp` flag for the whole target. `py_test` defaults to `stamp = 0`, so under `--stamp` every test builds its entire dependency tree in a second configuration, apart from the binaries that share those dependencies. The transition exists so that the `_uncachable_version_file` dependency is conditional on stamping. Move it onto that attribute edge. The edge sets `--stamp` only for `stamp = 1`. With `stamp = 0` the file is never read, and `stamp = -1` follows the flag, so neither changes the configuration. `is_stamping_enabled()` already reads the attribute directly, so the build data contents are unchanged. In a downstream repo that builds with `--stamp`, analyzing one `py_binary` and its `py_test` dropped from 633 to 448 configured targets. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Author
|
This PR was prepared with Claude Code, an AI coding agent, on behalf of the author. Claude Code may draft replies to review comments and follow-up commits. The author reviews and approves each one before it is posted or pushed. Agent-generated comment (Claude Code, Claude Opus 5.5), reviewed and approved by the author. |
This branch has not been deployed
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.
The
stampattribute ofpy_binaryandpy_testtransitions the--stampflag for the whole target.py_testdefaults tostamp = 0, so under--stampevery test builds its entire dependency tree in a second configuration, apart from the binaries that share those dependencies.The transition exists so that the
_uncachable_version_filedependency is conditional on stamping. Move it onto that attribute edge. The edge sets--stamponly forstamp = 1. Withstamp = 0the file is never read, andstamp = -1follows the flag, so neither changes the configuration.is_stamping_enabled()already reads the attribute directly, so the build data contents are unchanged.