Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ build --cxxopt=-std=c++17 --host_cxxopt=-std=c++17
build --incompatible_strict_action_env=true
build --features=-supports_start_end_lib --host_features=-supports_start_end_lib
common --experimental_repository_downloader_retries=10
common --incompatible_autoload_externally=+@rules_cc


build:remote --java_runtime_version=rbe_jdk
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
8.8.1
9.3.0
# Switch these two versions if bzlmod doesn't work (let us know too)
6.5.0
4 changes: 2 additions & 2 deletions .github/workflows/generatedcode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: bazel run //:gazelle
- name: Check Diff
run: |
if test -n "$(git status --porcelain)"; then
if test -n "$(git status --porcelain -- ':(exclude)MODULE.bazel.lock')"; then
# MODULE.bazel.lock file can change due to rules_python dependency packages.
git diff HEAD -- ':(exclude)MODULE.bazel.lock'
exit 1
Expand All @@ -54,7 +54,7 @@ jobs:
run: tools/genproto.sh
- name: Check Diff
run: |
if test -n "$(git status --porcelain)"; then
if test -n "$(git status --porcelain -- ':(exclude)MODULE.bazel.lock')"; then
# MODULE.bazel.lock file can change due to rules_python dependency packages.
git diff HEAD -- ':(exclude)MODULE.bazel.lock'
exit 1
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
fetch-depth: 0
persist-credentials: false
- name: Lint Code Base
uses: super-linter/super-linter/slim@4ce20838b8ab83717e78138c5b3a1407148e0918 # v8.7.0
uses: super-linter/super-linter/slim@2da136927bd4a73596db63044b504547c62cb854 # v9.0.0
env:
VALIDATE_ALL_CODEBASE: false
VALIDATE_JSCPD: false
Expand All @@ -47,6 +47,14 @@ jobs:
VALIDATE_BIOME_FORMAT: false
VALIDATE_BIOME_LINT: false
VALIDATE_GITLEAKS: false
VALIDATE_PYTHON: false
VALIDATE_PYTHON_BLACK: false
VALIDATE_PYTHON_FLAKE8: false
VALIDATE_PYTHON_ISORT: false
VALIDATE_PYTHON_MYPY: false
VALIDATE_PYTHON_PYLINT: false
VALIDATE_PYTHON_RUFF: false
VALIDATE_PYTHON_RUFF_FORMAT: false
IGNORE_GENERATED_FILES: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand Down
10 changes: 9 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ bazel_dep(name = "rules_cc", version = "0.2.25")
bazel_dep(name = "rules_distroless", version = "0.5.1")
bazel_dep(name = "rules_oci", version = "2.3.0")

single_version_override(
module_name = "openconfig_gnmi",
patch_strip = 0,
patches = ["//patches:gnmi.patch"],
)

archive_override(
module_name = "p4runtime",
integrity = "sha256-n2T6gGjkKtl5QRzJWhTjYG1G4Z6wjuUJszs+XAVBqmc=",
Expand All @@ -44,6 +50,8 @@ http_archive(
http_archive(
name = "com_github_opencomputeproject_sai",
build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")

exports_files(["meta/Doxyfile"])

filegroup(
Expand All @@ -69,7 +77,7 @@ cc_library(
######################################
######### Python ####################
######################################
bazel_dep(name = "rules_python", version = "1.9.2")
bazel_dep(name = "rules_python", version = "2.4.1")

# This prevents "current user is root" build failures in Cloud Build Presubmit
python = use_extension("@rules_python//python/extensions:python.bzl", "python")
Expand Down
22 changes: 13 additions & 9 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 8 additions & 6 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ http_archive(

http_archive(
name = "rules_python",
sha256 = "98880e2942e66fbe23202bd4174c089a54a203c32fc1cbc1c6c86df9f97ad7e3",
strip_prefix = "rules_python-1.9.2",
url = "https://github.com/bazel-contrib/rules_python/releases/download/1.9.2/rules_python-1.9.2.tar.gz",
sha256 = "7338fac5da94920b9a2db88add662246e7c41cc5c357ea93670ef23f1f153d4f",
strip_prefix = "rules_python-2.4.1",
url = "https://github.com/bazel-contrib/rules_python/releases/download/2.4.1/rules_python-2.4.1.tar.gz",
)

http_archive(
Expand All @@ -65,10 +65,10 @@ http_archive(

http_archive(
name = "com_google_absl",
sha256 = "71358f2e72e945d280bfab44090eacb3f98e10fead31fd97876f05a835510d92",
strip_prefix = "abseil-cpp-20250512.2",
sha256 = "f9148fb00ec98a2396bdf875c99a78e6a70afa662b107862d92b285d857a8320",
strip_prefix = "abseil-cpp-20250814.2",
urls = [
"https://github.com/abseil/abseil-cpp/releases/download/20250512.2/abseil-cpp-20250512.2.tar.gz",
"https://github.com/abseil/abseil-cpp/releases/download/20250814.2/abseil-cpp-20250814.2.tar.gz",
],
)

Expand Down Expand Up @@ -282,6 +282,8 @@ swift_rules_dependencies()
http_archive(
name = "com_github_opencomputeproject_sai",
build_file_content = """
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "sai",
hdrs = glob(["inc/*.h","experimental/*.h"]),
Expand Down
4 changes: 2 additions & 2 deletions cloudbuild/buildtest.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ steps:
curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 && \
install bazel /usr/local/bin/
apt-get update && apt-get -y install libpcap-dev libnl-genl-3-dev libnl-3-dev clang
export CC=clang
export CC=/usr/bin/clang
bazel build --remote_cache=https://storage.googleapis.com/lemming-bazel-cache --google_default_credentials //...
- id: test
name: gcr.io/cloud-builders/bazel
script: |
curl -Lo bazel https://github.com/bazelbuild/bazelisk/releases/download/v1.16.0/bazelisk-linux-amd64 && \
install bazel /usr/local/bin/
apt-get update && apt-get -y install libpcap-dev libnl-genl-3-dev libnl-3-dev clang
export CC=clang
export CC=/usr/bin/clang
bazel test --test_output=errors --combined_report=lcov --remote_cache=https://storage.googleapis.com/lemming-bazel-cache --google_default_credentials \
$(bazel query 'attr(size, small, tests("//...")) + attr(size, medium, tests("//..."))')
timeout: 3600s
Expand Down
2 changes: 1 addition & 1 deletion configs/bullseye/cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# This becomes the BUILD file for @local_config_cc// under non-BSD unixes.

load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
load("@rules_cc//cc:defs.bzl", "cc_library", "cc_toolchain", "cc_toolchain_suite")
load(":armeabi_cc_toolchain_config.bzl", "armeabi_cc_toolchain_config")
load(":cc_toolchain_config.bzl", "cc_toolchain_config")

Expand Down
1 change: 1 addition & 0 deletions configs/bullseye/cc/armeabi_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ load(
"feature",
"tool_path",
)
load("@rules_cc//cc:defs.bzl", "CcToolchainConfigInfo", "cc_common")

def _impl(ctx):
toolchain_identifier = "stub_armeabi-v7a"
Expand Down
1 change: 1 addition & 0 deletions configs/bullseye/cc/cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

"""A Starlark cc_toolchain configuration rule"""

load("@rules_cc//cc:defs.bzl", "CcToolchainConfigInfo", "cc_common")
load("@bazel_tools//tools/build_defs/cc:action_names.bzl", "ACTION_NAMES")
load(
"@bazel_tools//tools/cpp:cc_toolchain_config_lib.bzl",
Expand Down
1 change: 1 addition & 0 deletions dataplane/standalone/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library")
load("@rules_pkg//pkg:deb.bzl", "pkg_deb")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")

Expand Down
2 changes: 2 additions & 0 deletions dataplane/standalone/sai/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_library")

cc_library(
name = "sai",
srcs = [
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ require (
github.com/go-openapi/swag/stringutils v0.29.2 // indirect
github.com/go-openapi/swag/typeutils v0.29.2 // indirect
github.com/go-openapi/swag/yamlutils v0.29.2 // indirect
github.com/go-test/deep v1.1.1 // indirect
github.com/go-viper/mapstructure/v2 v2.5.0 // indirect
github.com/google/gnostic-models v0.7.1 // indirect
github.com/google/s2a-go v0.1.10 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ github.com/go-openapi/testify/v2 v2.7.0 h1:bycOreEj6wfBvijg3YFogZ/sFjTCDmQnwSodS
github.com/go-openapi/testify/v2 v2.7.0/go.mod h1:SgsVHtfooshd0tublTtJ50FPKhujf47YRqauXXOUxfw=
github.com/go-task/slim-sprig/v3 v3.0.0 h1:sUs3vkvUymDpBKi3qH1YSqBQk9+9D/8M2mN1vB6EwHI=
github.com/go-task/slim-sprig/v3 v3.0.0/go.mod h1:W848ghGpv3Qj3dhTPRyJypKRiqCdHZiAzKg9hl15HA8=
github.com/go-test/deep v1.1.0 h1:WOcxcdHcvdgThNXjw0t76K42FXTU7HpNQWHpA2HHNlg=
github.com/go-test/deep v1.1.0/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/go-test/deep v1.1.1 h1:0r/53hagsehfO4bzD2Pgr/+RgHqhmf+k1Bpse2cTu1U=
github.com/go-test/deep v1.1.1/go.mod h1:5C2ZWiW0ErCdrYzpqxLbTX7MG14M9iiw8DgHncVwcsE=
github.com/go-viper/mapstructure/v2 v2.5.0 h1:vM5IJoUAy3d7zRSVtIwQgBj7BiWtMPfmPEgAXnvj1Ro=
github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM=
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
Expand Down
11 changes: 11 additions & 0 deletions patches/gnmi.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- bazel/generate_cc.bzl
+++ bazel/generate_cc.bzl
@@ -194,7 +194,7 @@
),
"plugin": attr.label(
executable = True,
- providers = ["files_to_run"],
+ providers = [DefaultInfo],
cfg = "exec",
),
"flags": attr.string_list(
Loading
Loading