-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Allow private attributes as outputs template placeholders #4366
Comments
This happens because private attributes are internally name-mangled to make them (almost) inaccessible to users in BUILD files. Perversely, you can actually use them in templates if you access them as %{$version} instead of %{_version}. I don't recommend relying on that behavior as we'll surely want to break it (eventually) and use %{_version} instead. |
Recommendation is to avoid |
cc @c-parsons |
Interesting, where is this recommendation documented? I didn’t know that
…On Wed, 21 Nov 2018 at 17:45 Laurent Le Brun ***@***.***> wrote:
cc @c-parsons <https://github.com/c-parsons>
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4366 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABUIFxpm1QepkVrDd2FJUGPoBpsYTnNQks5uxXUpgaJpZM4RO-Ys>
.
|
Description of the feature request:
Consider the following rule:
This definition doesn't work. It fails with:
The reason is that
_version
is a private attribute. But citing private attributes in outputs sounds legit to me, since the spec of the outputs is a property of rule that itself has a private attribute. I could work around this problem usingdeclare_file
etc, so it sounds to me like an arbitrary limitation that private variables can't be cited in the outputs template.Environment info
bazel info release
): release 0.9.0- (@non-git)Have you found anything relevant by searching the web?
No relevant GitHub issues that I could find, except possibly #2467.
The text was updated successfully, but these errors were encountered: