I'm working on issue #552 (
https://github.com/bazelbuild/bazel/issues/552), "Allow customizing "BUILD" as a package-specification file". After some testing and profiling, I have the approach in hand, except for one problem... what is the new filename?
The basic approach will be to update PackageLookupFunction to first check for a file with the new name, then look for a file named "BUILD" for those using that. Only looking for one filename, or having a per-workspace customization, would break the case of referring to external repositories (what if they are using a different build file name than you?), so the two-file solution is the best.
Options, ranked from my favorite to my least favorite:
1. BUILD.bzl
Pros: Simple, unambiguous. We already are naming files with the .bzl extension, so it's well-known.
Con: Someone might try and load() a BUILD.bzl file, so we'd need a check to prevent that. Tools that perform file analysis or syntax highlighting will need to be aware of the rule to distinguish them.
2. BUILD.bazel
Pros: unambiguous. Different from the .bzl we use to denote loadable extensions.
Con: Longer to type. Still need to update tools and syntax highlighters.
3. Buildfile
Pros: Similar to Makefile, Gemfile, etc
Cons: Different from the existing BUILD, so possibly confusing.
Are there any pros or cons I have missed? What do people think?
Thanks,
John C