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

Change Bazel BUILD file names post-Gradle #1532

Open
miaboloix opened this issue Jul 27, 2020 · 1 comment · May be fixed by #5652
Open

Change Bazel BUILD file names post-Gradle #1532

miaboloix opened this issue Jul 27, 2020 · 1 comment · May be fixed by #5652
Assignees
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Low Low perceived user impact (e.g. edge cases). Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. Z-ibt Temporary label for Ben to keep track of issues he's triaged.

Comments

@miaboloix
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Bazel convention suggests that all Bazel BUILD files should be named BUILD. However, as we gradually move to Bazel while still building with Gradle, using this convention cause naming conflicts with existing Gradle files. Thus, all Bazel BUILD files are named BUILD.bazel. Although this is still acceptable to Bazel, it is not proper convention and should not be used post-Gradle in Oppia Android.

Describe the solution you'd like
Once Oppia Android has been moved off of Gradle and is building completely with Bazel, we should refactor all Bazel build files to be named BUILD instead of BUILD.bazel

@miaboloix miaboloix self-assigned this Jul 28, 2020
@miaboloix miaboloix added this to the Stage 2 of Bazel Migration milestone Aug 10, 2020
@BenHenning BenHenning assigned fsharpasharp and unassigned miaboloix Feb 19, 2021
@Broppia Broppia added dev_team Impact: Low Low perceived user impact (e.g. edge cases). labels Jul 29, 2022
@BenHenning BenHenning added Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. issue_user_developer labels Sep 15, 2022
@BenHenning BenHenning added the Z-ibt Temporary label for Ben to keep track of issues he's triaged. label Sep 15, 2022
@BenHenning BenHenning removed this from the Stage 2 of Bazel Migration milestone Sep 16, 2022
@seanlip seanlip added bug End user-perceivable behaviors which are not desirable. and removed issue_type_infrastructure labels Mar 28, 2023
@BenHenning
Copy link
Member

BenHenning commented Jan 23, 2025

I've decided to start questioning whether we actually want this. bazelbuild/bazel#4517 has some excellent discussion on the matter. While it doesn't result in an actual decision, it seems that there are more pros to keeping the '.bazel' extension than to remove it:

  • Less likely to run into conflicts with system-level artifacts.
  • Less likely to run into conflicts with other build systems (not that we plan to incorporate another build system in the future, though I certainly don't mind if someone tries to do this on their own).
  • Most importantly, it's extremely explicit. In the same way that a 'build.gradle' file is clearly tied to Gradle, 'BUILD.bazel' is unambiguous.

While I did make the effort to rename BUILD files in #5652, I actually think I'm going to undo that change and instead remove the TODOs (with an explanation as to why). It seems better to keep the .bazel extension moving forward.

Edit: I would like to document the only cons I can think of, as well, to be thorough in this discussion:

  • .bazel extensions violate the "three letter extension" rule, but so do Gradle files as well as many more. It's not really an important convention to follow anymore, I think.
  • It may introduce some confusion when referencing other codebases or dependencies that use BUILD files, but that's going to be a problem regardless of our conventional choice (since lots of codebases now use BUILD.bazel files, too).

@BenHenning BenHenning linked a pull request Jan 23, 2025 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug End user-perceivable behaviors which are not desirable. Impact: Low Low perceived user impact (e.g. edge cases). Issue: Needs Clarification Indicates that an issue needs more detail in order to be able to be acted upon. Z-ibt Temporary label for Ben to keep track of issues he's triaged.
Projects
Development

Successfully merging a pull request may close this issue.

5 participants