You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Right now, if you add a dependency to a protobuf, then you have to go and
update all the dependents and:
- Make an env var exposing that dependency
- Update the build script to pick it up
The latter is a bit unavoidable (because we neeed to define the `extern_path`
anyway), but the former is a bit overly verbose and pointless.
This diff fixes that by introducing a UDR that represents a set of proto source
files, and then you pass that as input when adding your rule.
There was a previous attempt at doing this with `export_file_with`, but that
only works if the files are next to each other (in which case we add the parent
dir of one the files to the search path, and now we can find both, but it does
not work if the files aren't next to each other).
UX-wise, this would all work a lot better if instead a macro this was a UDR,
but for now this gets a bit closer by forcing you to define a dependency tree
of your .proto files.
Note: I did keep the old way of passing individual .proto files because it
turns out a bunch of things that are not Buck use this (oops):
https://www.internalfb.com/code/search?q=-filepath%3Afbcode%2Fbuck2%20repo%3Aall%20fbcode%2F%2Fbuck2%3Aproto_defs.bzl
Reviewed By: IanChilds
Differential Revision: D73581679
fbshipit-source-id: ed1f97058a111a29cb9eba3eb3f690053d138fd4
0 commit comments