Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Fix output=locations display source file location #12329

Conversation

zhengwei143
Copy link
Contributor

This PR is a patch to fix this commit after being brought up here.

The goal of this PR is to align the output of --output=location with its current definition in the documentation. 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 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

@zhengwei143 zhengwei143 self-assigned this Oct 22, 2020
@google-cla google-cla bot added the cla: yes label Oct 22, 2020
Copy link
Collaborator

@benjaminp benjaminp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm—thank you

@meisterT
Copy link
Member

Benjamin, thank you for calling this out!

@bazel-io bazel-io closed this in ac8b749 Oct 23, 2020
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants