Skip to content

[GSoC26][bazel] add bazel build system support for simple_switch_grpc#1356

Open
c8ef wants to merge 1 commit into
p4lang:mainfrom
c8ef:main
Open

[GSoC26][bazel] add bazel build system support for simple_switch_grpc#1356
c8ef wants to merge 1 commit into
p4lang:mainfrom
c8ef:main

Conversation

@c8ef
Copy link
Copy Markdown
Contributor

@c8ef c8ef commented Mar 19, 2026

Introduces a complete bazel build alongside the existing cmake setup, targeting the simple_switch_grpc binary and its test suite.

Key implementation notes:

  • All BUILD files are formatted with Buildifier and enforced in CI via a dedicated GitHub Actions workflow, keeping the Starlark codebase consistent from day one.
  • config.h is generated using the expand_template idiom rather than a raw genrule, making the enabled/disabled feature set explicit and diff-friendly.
  • External dependencies (Boost, gmp, nanomsg, grpc, p4lang/PI, etc.) are currently consumed as system-installed libraries through a module extension (bazel/ubuntu2204.bzl). This avoids the need to vendor or pin every transitive dependency upfront; migration to BCR-sourced modules can be done incrementally.
  • Groundwork for a full Bazel-native p4lang/PI is already underway: uthash@2.3.0 bazelbuild/bazel-central-registry#8031 tracks a third-party library used by the PI library's contribution to BCR, after which the @ubuntu2204//:pi* stubs can be replaced with proper module dependencies.

Signed-off-by: c8ef <c8ef@outlook.com>
@c8ef
Copy link
Copy Markdown
Contributor Author

c8ef commented Mar 19, 2026

cc @matthewtlam

@matthewtlam
Copy link
Copy Markdown
Contributor

Thanks for your PR @c8ef.

None of the PRs will be carefully reviewed until Apr 1 (once the contributor deadline is over). The GSoC contributor application is currently opened. 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

@matthewtlam
Copy link
Copy Markdown
Contributor

@c8ef Can we update this PR to remove the Boost dependencies that you removed?

@c8ef
Copy link
Copy Markdown
Contributor Author

c8ef commented May 14, 2026

@c8ef Can we update this PR to remove the Boost dependencies that you removed?

The current CI for the bmv2 build doesn't use the Ubuntu PI library. To enable Bazel support for bmv2, we first need to implement Bazel support for PI. I have a working local version, but since the patch is quite large, I’m splitting it into smaller updates - starting with p4lang/PI#646. Once the PI Bazel build is refreshed, I’ll update this PR.

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