Skip to content

bazel: add Bazel 8.5.0 build support for simple_switch_grpc#1355

Open
Shawn-Dong wants to merge 1 commit intop4lang:mainfrom
Shawn-Dong:feat/bazel-simple-switch-grpc
Open

bazel: add Bazel 8.5.0 build support for simple_switch_grpc#1355
Shawn-Dong wants to merge 1 commit intop4lang:mainfrom
Shawn-Dong:feat/bazel-simple-switch-grpc

Conversation

@Shawn-Dong
Copy link
Copy Markdown

@Shawn-Dong Shawn-Dong commented Mar 15, 2026

Summary

Add Bazel 8.5.0 build support for simple_switch_grpc and its dependencies. The existing autoconf/CMake build is unaffected.

Design decisions

System gRPC/protobuf
BCR protobuf conflicts with p4lang-PI's pre-generated .pb.h headers, so system-installed libraries are used to maintain ABI compatibility.

config.h via genrule
cmake generates config.h into its build directory but adds the source tree to the include path first. A committed config.h would shadow cmake's version, so a Bazel genrule generates it into bazel-out/ instead.

Exclusive test tags
All 11 tests bind to shared gRPC ports, so tags = ["exclusive"] prevents parallel execution.

Test plan

  • bazel build //targets/simple_switch_grpc:simple_switch_grpc
  • bazel test //targets/simple_switch_grpc/tests/...
  • GitHub Actions CI passes
  • Existing CMake CI unaffected

Add BUILD files for all simple_switch_grpc targets and dependencies.
Use system-installed gRPC/protobuf for ABI compatibility with p4lang-PI.
Generate config.h via genrule to avoid conflicts with cmake build.

Signed-off-by: Shawn Dong <yanshengtian@gmail.com>
@Shawn-Dong Shawn-Dong force-pushed the feat/bazel-simple-switch-grpc branch from ec8234b to 631a029 Compare March 15, 2026 22:57
@matthewtlam
Copy link
Copy Markdown
Contributor

Thanks for your PR @Shawn-Dong, it looks great.

None of the PRs will be carefully reviewed until Apr 1 (once the contributor deadline is over). Starting today (March 16th), the GSoC contributor application will open. Please make sure you submit your application before the deadline.

During the first week of April, after applications and PRs are reviewed, candidates who will be considered will be sent an interview. The contributor who gets admitted into GSoC will have their PR pushed to head

cc: @qobilidop

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.

2 participants