Skip to content

Movel Bazel workspace root to project root #571

@smolkaj

Description

@smolkaj

Currently, MODULE.bazel and WORKSPACE.bazel live in proto/, making proto/ the root of the Bazel workspace, due to the following TODO:

proto_library(
    name = "p4types_proto",
    srcs = ["p4/config/v1/p4types.proto"],
    # TODO(github.com/grpc/grpc/issues/20675): strip_import_prefix breaks
    # cc_grpc_library. Make proto folder the Bazel root folder as a workaround.
    # strip_import_prefix = "proto",
)

I think the underlying issue has been fixed and we can now resolve the TODO.

While we're at it, we should also move our BUILD targets so they live in the same folders as their source files to align with Bazel best practices.

NOTE: The proposed changes will break existing users, who will have to update their build files. So im a bit unsure if this cleanup is worth all the churn this will cause downstream.

Impact

Having the Bazel workspace root not be the root of the project is very unusual and causes some extra friction: for example, it's not straightforward to tell that p4runtime is a Bazel project (due to the missing files in the root folder), and users need to set a special strip_prefix argument when depending on p4runtime:

Metadata

Metadata

Assignees

No one assigned

    Labels

    1.5Issues and PRs that we want to go into 1.5enhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions