bazelbuild / bazelbuild/bazel

Ability to specify per_file_copt for external repositories

Open
#2,762 6 comments 4 reactions 0 assignees View on GitHub
P3 team-Rules-CPP type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

I want to be able to add the following to my .bazelrc in order to silence unused parameter warnings from protobufs. However, per_file_copt does not seem to work with the leading `@` to identify other repositories.
`--per_file_copt=@com_google_protobuf//.*,@com_google_protobuf//.*@-Wnounused-parameter`

(Of course other personally less appealing alternatives include setting `-Wnounused-parameter` for everything or going inside the protobuf repo and cleaning up the hundred or so warnings.)

Contributor guide

Open the contributing guide

Research direction

Start by tracing Bazel's per_file_copt handling for patterns beginning with @ and compare it with the .bazelrc syntax shown in the issue. Reproduce the protobuf warning case using that configuration; done means the option suppresses the targeted warnings in @com_google_protobuf without applying the flag globally.

Written by the indexing model from the issue text.

Assessment

Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.