Description
Describe the bug
The current Bazel build files are inconsistent and appear to rely on an internal wrapper and internal rulesets which cannot be found in an open-source context. At the moment it is not possible to build the project with Bazel.
To Reproduce
Add WORKSPACE.bazel
and BUILD.bazel
files with a rules_scala
setup and attempt to build the repository:
bazel build ...
Expected behavior
The build to pass.
Environment
I'm testing this from the Nix flake proposed in #441. A regular bazel installation will yield the same results.
Additional context
This actually seems not too hard to fix, but the starlark files will need to be globally refactored before a fix becomes viable in terms of commit reviewability. I think something like this could work:
-
- Unify all build files with buildifier.
-
- Use buildozer to globally add
load
statements where needed.
- Use buildozer to globally add
-
- Add
name
attributes where needed.
- Add
-
- Change absolute paths to proper labels.
-
- Migrate custom rules (
hadoop_binary
,jvm_binary
etc) to open-source equivalents or upstream them to open-source repos or provide their implementation as part of this repository.
- Migrate custom rules (
Much of this can be automated with buildozer. For instance, to add loads
:
buildozer 'new_load @io_bazel_rules_scala//scala:scala.bzl scala_library' //...:*
buildozer 'fix unusedLoads'