Skip to content

Bazel build needs adjustments for open-source #626

Open
@aaronmondal

Description

@aaronmondal

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.
    • Add name attributes where needed.
    • 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.

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    project maintenanceRelated to workflows, maintenance, etc

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions