-
Notifications
You must be signed in to change notification settings - Fork 22
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
Keep build_info.json up to date and in sync with bazel build #172
Comments
I think this could be tricky because of Bazel's hermetic guarantees, for instance:
So I don't think this can be done solely as a part of a Bazel build. However, there may be some invocation of |
Actually, it may be possible to use Bazel aspects for this, I'll have to look into/experiment with this |
My though was some variant of approach 4 should work even with the restrictions you listed. With a lot of hand waving, my thought is there are essentially two steps. The first is to generate the build info into an output file. Bazel aspects sounds like it could be great for this. Or perhaps an python action that takes the source files and generates the output file. For the latter the source files could be in a variable so the same list is used for normal usage and for generating the output file. Then a python or C++ test that takes the build_info.json and generated output file as deps and then compares their contents. |
Yep yep, the generating the build graph part was the part I was hung up on, but it looks like it is likely doable from aspects |
We do something similar to option 4 for I think that option 1 is out for the reasons Jason listed, option 2 is possible, but requires manual work, and option 3 is not directly possible because Bazel won't generate files into the source tree. There is an option 5: have something parse the BUILD files outside of Bazel, and option 6: have a new top-level source of truth, from which the BUILD files are generated (with a test to ensure that the checked-in BUILD files match the new files). |
|
#171 introduces a build_info.json file that lists build info for downstream, non-bazel projects.
We should implement a way to ensure build_info.json stays in sync with emboss repo changes.
A few possible approaches to consider (there are probably others):
The text was updated successfully, but these errors were encountered: