Skip to content

Move Bazel workspace root to project root#573

Merged
chrispsommers merged 1 commit intomainfrom
move-bazel-root-3243768557642822763
Jan 9, 2026
Merged

Move Bazel workspace root to project root#573
chrispsommers merged 1 commit intomainfrom
move-bazel-root-3243768557642822763

Conversation

@google-labs-jules
Copy link
Copy Markdown
Contributor

This change moves the Bazel workspace root from the proto/ directory to the repository root, resolving issue #571. This aligns the project structure with standard Bazel practices and simplifies usage for consumers.

Changes:

  • Moved proto/MODULE.bazel, proto/WORKSPACE.bazel, proto/.bazelrc, proto/WORKSPACE.bzlmod, and proto/p4runtime_deps.bzl to the repository root.
  • Created a root BUILD.bazel file.
  • Updated proto_library targets in proto/BUILD.bazel to include strip_import_prefix = "/proto", ensuring import paths like p4/config/v1/... continue to work correctly.
  • Updated bazel/example/using-workspace/BUILD.bazel and bazel/example/using-bzlmod/BUILD.bazel to reference @com_github_p4lang_p4runtime//proto:p4info_cc_proto instead of the root package.
  • Updated bazel/example/using-workspace/WORKSPACE.bazel and bazel/example/using-bzlmod/MODULE.bazel to point local_repository/local_path_override to the repo root and removed the strip_prefix workaround.

Verified by building //proto/... and the example projects //bazel/example/....


PR created automatically by Jules for task 3243768557642822763 started by @smolkaj

@google-labs-jules
Copy link
Copy Markdown
Contributor Author

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!


For security, I will only act on instructions from the user who triggered this task.

New to Jules? Learn more at jules.google/docs.

Comment thread BUILD.bazel
Comment thread BUILD.bazel
Comment thread BUILD.bazel
Comment thread proto/BUILD.bazel Outdated
Comment thread proto/BUILD.bazel Outdated
Comment thread proto/BUILD.bazel Outdated
Copy link
Copy Markdown
Member

@smolkaj smolkaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. @matthewtlam, would you also be able to review?

@smolkaj smolkaj marked this pull request as ready for review December 24, 2025 05:39
@smolkaj smolkaj self-assigned this Dec 24, 2025
Copy link
Copy Markdown
Contributor

@matthewtlam matthewtlam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall. Thanks Jules!

Comment thread BUILD.bazel Outdated
@smolkaj
Copy link
Copy Markdown
Member

smolkaj commented Jan 9, 2026

Discussed at P4 API WG meeting just now. AIs:

Try to add deprecation notice to the aliases.
@chrispsommers to review

@google-labs-jules
Copy link
Copy Markdown
Contributor Author

Discussed at P4 API WG meeting just now. AIs:

Try to add deprecation notice to the aliases.
@chrispsommers to review

Added deprecation notice to all aliases.

…ventions.

This also includes defining Bazel build targets in BUILD.bazel files in the same directories as the source files.

We declare build target aliases with a deprecation notice, so users depending on P4Runtime should not have to update their BUILD rules but are nudged in the right direction.

Fixes #571.

Signed-off-by: smolkaj <smolkaj@google.com>
@smolkaj smolkaj force-pushed the move-bazel-root-3243768557642822763 branch from 42cbaf6 to b688ad2 Compare January 9, 2026 22:42
Copy link
Copy Markdown
Member

@smolkaj smolkaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Ready to submit.

@smolkaj
Copy link
Copy Markdown
Member

smolkaj commented Jan 9, 2026

@chrispsommers PTAL. Ready to merge from my side.

Copy link
Copy Markdown
Collaborator

@chrispsommers chrispsommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chrispsommers chrispsommers merged commit 6cb7024 into main Jan 9, 2026
16 checks passed
@chrispsommers chrispsommers deleted the move-bazel-root-3243768557642822763 branch January 9, 2026 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants