-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding bazel C++ build support for gNOI repository #52
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @vamsipunati, LGTM modulo some small issues.
BUILD
Outdated
@@ -0,0 +1,22 @@ | |||
# Copyright 2021 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this file (and all other BUILD files) to BUILD.bazel, and similarly for the WORKSPACE file.
This is the recommended convention outside of google, since it makes the purpose of these files easy to research for non-Bazel experts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
WORKSPACE
Outdated
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
workspace(name = "gnoi") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
name = "com_github_openconfig_gnoi"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
gnoi_infra_deps.bzl
Outdated
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
"""Dependencies to build PINS infra.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
WORKSPACE
Outdated
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
# -- Load Dependencies --------------------------------------------------------- | ||
load("gnoi_infra_deps.bzl", "gnoi_infra_deps") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The convention is for these to be called "gnoi_deps.bzl" and "gnoi_deps", without the infra part.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
WORKSPACE
Outdated
|
||
gnoi_infra_deps() | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: remove extra new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
factory_reset/BUILD
Outdated
licenses = ["notice"], | ||
) | ||
|
||
filegroup( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
file/BUILD
Outdated
licenses = ["notice"], | ||
) | ||
|
||
filegroup( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
gnoi_infra_deps.bzl
Outdated
if not native.existing_rule("com_github_grpc_grpc"): | ||
http_archive( | ||
name = "com_github_grpc_grpc", | ||
# Move to newer commit to avoid the use of com_github_google_re2. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove this comment and instead use the latest release? (https://github.com/grpc/grpc/releases/tag/v1.37.1)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
gnoi_infra_deps.bzl
Outdated
http_archive( | ||
name = "com_google_protobuf", | ||
url = "https://github.com/protocolbuffers/protobuf/releases/download/v3.14.0/protobuf-all-3.14.0.tar.gz", | ||
strip_prefix = "protobuf-3.14.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use latest release (3.16.0)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
system/BUILD
Outdated
|
||
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library") | ||
|
||
package(default_visibility = ["//visibility:public"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: fix formatting.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
BUILD
Outdated
@@ -0,0 +1,22 @@ | |||
# Copyright 2021 Google LLC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now that we have BUILD files, we should also add a presubmit check to ensure the build never breaks.
You can take this one as a template and just adjust the last two steps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, modulo some formatting nits and including the CI script in this PR. Otherwise looks great!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like the changes I suggested in vamsipunati#1 (comment) didn't make it in
bazel-${{ runner.os }}-build- | ||
- name: Install bazelisk | ||
run: | | ||
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.8.1/$BAZEL" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies, I just realized that GitHub review comments get associated with an entire line, rather than specific characters one marks. So it looks like some of my previous comments we're confusing since they were out of context.
We removed a few thing too much here. We'll want to add back the following:
- name: Install bazelisk
run: |
curl -LO "https://github.com/bazelbuild/bazelisk/releases/download/v1.8.1/$BAZEL"
chmod +x $BAZEL
sudo mv $BAZEL /usr/local/bin/bazel
name: Build
run: bazel build //...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo the last comment.
Before we merge this, one of the admins for this repo should also enable Github Actions for the repo and make sure the workflow passes: https://docs.github.com/en/github/administering-a-repository/disabling-or-limiting-github-actions-for-a-repository#managing-github-actions-permissions-for-your-repository
…on't have any associated rpc services
The thinkit test framework needs gNOI C++ compilation support.