forked from twitter/pants
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make "./pants changed" output correct results when BUILD files are mo…
…dified (pantsbuild#4282) ### Problem pantsbuild#3933 Currently with v2 engine, if a dir has more than 1 BUILD file, changing only 1 of them will cause "./pants changed" output all targets in that dir, even though some targets are not defined in the changed BUILD file. The reason is here: https://github.com/pantsbuild/pants/blob/master/src/python/pants/engine/legacy/address_mapper.py#L53. In is_declaring_file method, since Address object does not have information about declaring BUILD file, the result is not accurate. ### Solution With pantsbuild@257a622, Now addresses passed to that method are BuildFileAddress objects, whose "rel_path" field is the path to its declaring BUILD file. I still kept the old logic in case an Address object is passed to this method. After pantsbuild#3925 is fixed, BuildFileAddress and Address will become 1 class, thus we can eliminate the extra logic.
- Loading branch information
Showing
3 changed files
with
31 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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