Skip to content
This repository has been archived by the owner on Mar 3, 2021. It is now read-only.

multirun(), command(): export RUNFILES_* envvars #56

Merged
merged 2 commits into from
Apr 12, 2019

Conversation

laszlocsomor
Copy link
Contributor

@laszlocsomor laszlocsomor commented Apr 10, 2019

When binary (or test) "A" data-depends on binary
"B", Bazel merges B's runfiles into A's and only
generates a runfiles manifest/directory for "A"
but not "B". To let "B" find its runfiles, "A"
must export the "RUNFILES_*" envvars first. This
is common for tests (A) that run binaries (B) with
data-dependencies.

The multirun() and command() rules fall prey to
this runfiles-merging. To run *_binary targets,
they must discover and export the runfiles
envvars.

Fixes the bug in bazelbuild/bazel#7774

@laszlocsomor
Copy link
Contributor Author

/cc @Globegitter

@ash2k
Copy link
Contributor

ash2k commented Apr 10, 2019

@laszlocsomor
Hey, thanks for the PR! Could you sign the CLA please https://github.com/atlassian/bazel-tools#contributing ?

Would be great to have the mechanism fully documented somewhere i.e. how could I have written this myself without trial and error and reverse engineering how runfiles work?

@laszlocsomor
Copy link
Contributor Author

@ash2k : Where can I read the text of the CLA?

Runfiles are documented poorly. I plan to improve the docs when I have some time: bazelbuild/bazel#6402

I don't know how you could've written it yourself. I'm a domain expert and it took me hours to figure out the problem.

@ash2k
Copy link
Contributor

ash2k commented Apr 11, 2019

@laszlocsomor the CLA text is shown after the email verification step on the docusign website. Sorry for the inconvenience, but that's the process. If you work for Google, a corporate CLA may have been signed already (e.g. we have a CLA signed with Google for our contributions), but I cannot check right now.

@ash2k
Copy link
Contributor

ash2k commented Apr 11, 2019

Improving documentation around runfiles would be great. All the fields in the runfiles object need more explanation and examples. Also see bazelbuild/bazel#3015

@laszlocsomor
Copy link
Contributor Author

@ash2k : Thanks for the approval! I don't yet know if I'm allowed to sign the CLA, so I need to put this PR on hold. I'll ping the thread when I know more.

@laszlocsomor
Copy link
Contributor Author

I signed it!

@ash2k ash2k merged commit e31d79d into atlassian:master Apr 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants