Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

tools/runfiles: use $TEST_SRCDIR when available #1035

Merged
merged 1 commit into from
Nov 25, 2021

Conversation

TimNN
Copy link
Contributor

@TimNN TimNN commented Nov 25, 2021

Bazel sets the $TEST_SRCDIR environment variable telling tests the "absolute path to the base of the runfiles tree", see the test encyclopedia.

That should in general be the more reliable way to determine the runfiles directory (when available), I think, but the current logic also does not always work when running tests internally at Google.

@UebelAndre
Copy link
Collaborator

This change seems good to me but wanna make sure we're not missing anything else while focus is on this section of the rules 😄. @TimNN Are you able to talk about the specifics of what doesn't work with the current implementation? I requested @hlopko join the review (as, to my knowledge, the only Googler actively maintaining these rules) in case there's some sensitive details here.

@TimNN
Copy link
Contributor Author

TimNN commented Nov 25, 2021

I don't think the details are particularly sensitive. The issue is that the directory structure used by our CI system does not follow the <binary name>.runfiles pattern that the current implementation expects, so it cannot find the runfiles directory.

Copy link
Member

@hlopko hlopko left a comment

Choose a reason for hiding this comment

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

Thanks for this! LGTM.

@hlopko hlopko merged commit a712e8a into bazelbuild:main Nov 25, 2021
@TimNN TimNN deleted the test-srcdir branch November 26, 2021 07:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants