Skip to content

bazel: suppress protobuf deprecation warnings in generated .pb.cc files#29945

Merged
travisdowns merged 1 commit intoredpanda-data:devfrom
travisdowns:td-suppress-protobuf-warnings
Apr 1, 2026
Merged

bazel: suppress protobuf deprecation warnings in generated .pb.cc files#29945
travisdowns merged 1 commit intoredpanda-data:devfrom
travisdowns:td-suppress-protobuf-warnings

Conversation

@travisdowns
Copy link
Copy Markdown
Member

Existing per-file suppressions covered the external protobuf sources and
specific redpanda .cc files that include protobuf headers, but missed
generated .pb.cc files (e.g. under proto/ or src/v/schema/protobuf/).
This adds a wildcard per_file_copt rule for all *.pb.cc files so new
proto targets don't need individual entries.

Backports Required

  • none - not a bug fix
  • none - this is a backport
  • none - issue does not exist in previous branches
  • none - papercut/not impactful enough to backport
  • v25.3.x
  • v25.2.x
  • v25.1.x

Release Notes

  • none

Existing suppressions covered external protobuf sources and specific
redpanda .cc files that include protobuf headers, but missed generated
.pb.cc files (e.g. under proto/ or src/v/schema/protobuf/).
Copilot AI review requested due to automatic review settings March 24, 2026 14:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates Bazel build flags to suppress protobuf deprecation warnings across all generated protobuf C++ sources, so new proto targets don’t require per-target or per-file additions.

Changes:

  • Add a --per_file_copt wildcard rule intended to match all generated *.pb.cc files and disable -Wdeprecated-declarations for them.

Comment thread .bazelrc
build --per_file_copt=src/v/serde/protobuf/tests/parser_test.cc@-Wno-deprecated-declarations
build --per_file_copt=src/v/iceberg/conversion/tests/iceberg_protobuf_tests.cc@-Wno-deprecated-declarations
build --per_file_copt=src/v/pandaproxy/schema_registry/protobuf.cc@-Wno-deprecated-declarations
build --per_file_copt=.*\\.pb\\.cc@-Wno-deprecated-declarations
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The --per_file_copt pattern is over-escaped in .bazelrc. In a .bazelrc file there is no shell layer, so .*\\.pb\\.cc is passed literally and the regex will not match *.pb.cc as intended (it effectively matches a backslash followed by any character). Use a single backslash for escaping the dots (and consider anchoring with $ if you want to avoid partial matches).

Suggested change
build --per_file_copt=.*\\.pb\\.cc@-Wno-deprecated-declarations
build --per_file_copt=.*\.pb\.cc$@-Wno-deprecated-declarations

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Empirically it works?

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.

I really dislike this UX fwiw I always run into escaping problems.

@travisdowns
Copy link
Copy Markdown
Member Author

/ci-repeat 1

@travisdowns
Copy link
Copy Markdown
Member Author

BK seems to have gotten confused by two PRs I opened close in time, one from my own repo and one from rp (which I closed).

Comment thread .bazelrc
build --per_file_copt=src/v/serde/protobuf/tests/parser_test.cc@-Wno-deprecated-declarations
build --per_file_copt=src/v/iceberg/conversion/tests/iceberg_protobuf_tests.cc@-Wno-deprecated-declarations
build --per_file_copt=src/v/pandaproxy/schema_registry/protobuf.cc@-Wno-deprecated-declarations
build --per_file_copt=.*\\.pb\\.cc@-Wno-deprecated-declarations
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.

I really dislike this UX fwiw I always run into escaping problems.

@vbotbuildovich
Copy link
Copy Markdown
Collaborator

CI test results

test results on build#82279
test_class test_method test_arguments test_kind job_url test_status passed reason test_history
CloudTopicsL0GCNodeFailureTest test_node_failure_mid_gc {"cloud_storage_type": 2} integration https://buildkite.com/redpanda/redpanda/builds/82279#019d2039-631b-4236-9c5c-3de7c045294a FLAKY 10/11 Test PASSES after retries.No significant increase in flaky rate(baseline=0.0214, p0=1.0000, reject_threshold=0.0100. adj_baseline=0.1000, p1=0.3487, trust_threshold=0.5000) https://redpanda.metabaseapp.com/dashboard/87-tests?tab=142-dt-individual-test-history&test_class=CloudTopicsL0GCNodeFailureTest&test_method=test_node_failure_mid_gc

@travisdowns travisdowns merged commit 32b08d7 into redpanda-data:dev Apr 1, 2026
28 of 29 checks passed
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.

5 participants