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

Clarifying the use of data parameter in sh_binary rule #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SpangleLabs
Copy link

We keep seeing folks uncertain on the usage of the data parameter inside sh_binary targets, and unsure how to call other binaries from sh_binary targets.

I think clarifying "Runtime data" to "Runtime dependencies" will improve this.

Though it could be useful to specify also that the built binary will be in the same location as the shell script, such that you can call a data dependency, diff-checker from the shell script with something along these lines:

bashSource="$(dirname "$(readlink -f "$0")")"
"$bashSource/diff-checker"

(I'm also not sure whether that's the most effective way to get the current path and call the data dependency)

@peterebden
Copy link
Contributor

Possibly yes, although I think we should be cautious with the use of "dependencies"; it's a term we use fairly heavily in Please which generally means build-time dependencies (with some variations on it, it's not always 100% clear or consistent). data is pretty consistently used as the argument meaning "runtime data", which may not be super well named (we really matched Blaze on it and didn't think that much).

Technically it's very easy to 'rename' an argument by adding an alias; conversely I'm nervous about making the shell plugin call something runtime_deps that other plugins call data. If that's a change we want to make, I think we would want that to be consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants