Skip to content

Add bazel build system support for simple_switch_grpc#1401

Merged
jafingerhut merged 12 commits into
p4lang:mainfrom
c8ef:bazel
Jun 8, 2026
Merged

Add bazel build system support for simple_switch_grpc#1401
jafingerhut merged 12 commits into
p4lang:mainfrom
c8ef:bazel

Conversation

@c8ef

@c8ef c8ef commented May 26, 2026

Copy link
Copy Markdown
Contributor

c8ef added 4 commits May 26, 2026 21:41
Signed-off-by: c8ef <c8ef@outlook.com>
Signed-off-by: c8ef <c8ef@outlook.com>
Signed-off-by: c8ef <c8ef@outlook.com>
Signed-off-by: c8ef <c8ef@outlook.com>
Comment thread targets/simple_switch_grpc/tests/base_test.h
@c8ef c8ef marked this pull request as ready for review May 26, 2026 14:38
@c8ef

c8ef commented May 26, 2026

Copy link
Copy Markdown
Contributor Author

cc @matthewtlam @qobilidop for review.

Comment thread .github/workflows/bazel.yml
Comment thread .bazelversion.license
Comment thread MODULE.bazel Outdated
Comment thread MODULE.bazel
Comment thread MODULE.bazel
Comment thread BUILD.bazel
Comment thread BUILD.bazel Outdated
Comment thread PI/BUILD.bazel

load("@rules_cc//cc:cc_test.bzl", "cc_test")

_COMMON_SRCS = [

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there a particular reason why these are not apart of the _COMMON_DEPS?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

_COMMON_SRCS is a list of source files, whereas _COMMON_DEPS is a list of local or remote dependencies.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to make all the common source files be built similarly to the common deps? So that the only source files are the tests itself?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I moved the common sources into a test_common library, so they can now be treated as common deps. However, the tests still need to run exclusively due to port sharing.

Comment thread targets/simple_switch_grpc/tests/BUILD.bazel
Signed-off-by: c8ef <c8ef@outlook.com>
This reverts commit f4bc3c7.

Signed-off-by: c8ef <c8ef@outlook.com>
@c8ef c8ef requested review from jafingerhut and matthewtlam June 2, 2026 17:45
c8ef added 2 commits June 3, 2026 20:31
Signed-off-by: c8ef <c8ef@outlook.com>

@matthewtlam matthewtlam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

PTAL at my comments

Signed-off-by: c8ef <c8ef@outlook.com>
@c8ef

c8ef commented Jun 4, 2026

Copy link
Copy Markdown
Contributor Author

PTAL at my comments

All resolved, please take another look.

@c8ef c8ef requested a review from matthewtlam June 4, 2026 12:46

@matthewtlam matthewtlam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just looking for clarification on a couple of last comments but we are almost there!

Signed-off-by: c8ef <c8ef@outlook.com>
@c8ef

c8ef commented Jun 6, 2026

Copy link
Copy Markdown
Contributor Author

Just looking for clarification on a couple of last comments but we are almost there!

Thanks for the detailed review! I took the initiative to mark some addressed comments as resolved, but feel free to reopen them if you have further feedback.

Signed-off-by: c8ef <c8ef@outlook.com>

@matthewtlam matthewtlam left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The refactoring in targets/simple_switch_grpc/tests/BUILD.bazel looks amazing and very explicit following Bazel standards. LGTM!

@jafingerhut jafingerhut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Approving and merging based upon matthewtlam's review and approval.

@jafingerhut jafingerhut merged commit 6de17e5 into p4lang:main Jun 8, 2026
11 checks passed
@c8ef c8ef deleted the bazel branch June 9, 2026 01:09
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