-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix output=locations display source file location
This PR is a patch to fix this [commit](f00f911) after being brought up [here](#12322 (comment)). This aims to provide a fix for #8900. The goal of this PR is to align the output of `--output=location` with its current definition in the [documentation](https://docs.bazel.build/versions/master/query.html#output-location). With the flag `--output=location`, source files are supposed to output "the location of line 1 of the actual file" but only displayed its location in the BUILD file prior to the commit. **Expected behavior by definition:** ``` bazel query bazeltest:main.py --output=location /home/tanzhengwei/bazeltest/main.py:1:1: source file //bazeltest:main.py ``` The previous [commit](f00f911) wrongly modified the output to the following (with the `--incompatible_display_source_file_location` flag): ``` bazel query bazeltest:main.py --output=location --incompatible_display_source_file_location /home/tanzhengwei/bazeltest/BUILD:1:10: source file /home/tanzhengwei/bazeltest/main.py:1:1 ``` This PR fixes it to output to the correct implementation (with the `--incompatible_display_source_file_location` flag): ``` bazel query bazeltest:main.py --output=location --incompatible_display_source_file_location /home/tanzhengwei/bazeltest/main.py:1:1: source file //bazeltest:main.py ``` Closes #12329. PiperOrigin-RevId: 338620611
- Loading branch information
1 parent
f421934
commit ac8b749
Showing
3 changed files
with
41 additions
and
43 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