dropbox / dbx_build_tools

Dropbox's Bazel rules and tools
Other
209 stars 37 forks source link

If RUNFILES_DIR is set externally use that for finding runfiles path #43

Closed jsharpe closed 3 years ago

jsharpe commented 3 years ago

If a dbx_py_binary is set as a data member of e.g. a sh_binary and called from that script then it fails to correctly find the runfile directory. This change picks up any existing RUNFILES_DIR set by a parent script e.g. via bash runfiles so that the correct runfiles directory is found.

jhance commented 3 years ago

Do you reproduce the need for this if using dbx_sh_binary to call?

We certainly execute dbx_py_binary from shell scripts internally without this, and I imagine this will lead to quirky bugs if we merge it, when shelling out from one binary to another that has a separate runfiles tree.