bazelbuild / bazelbuild/bazel

Allow changing warning options without rebuilding everything

Open
#25,886 0 comments 1 reaction 0 assignees View on GitHub
team-Core type: feature request untriaged
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

I’d like to be able to change the compiler warning options without rebuilding everything. This should be safe because warning options do not affect code generation.

### Which category does this issue belong to?

Core, Performance

### What underlying problem are you trying to solve with this feature?

I’m trying to get [Envoy](https://github.com/envoyproxy/envoy) to compile, and am running into problems because V8 builds with `-Werror` yet triggers warnings with Clang 19. I’m trying to suppress these warnings, but every time I change the warning level with `--cxxopt` Bazel rebuilds all C++ files. This is not necessary because these options can change whether a build succeeds, but they cannot change the output of a successful build in any way that matters. This assumes that nobody is doing autoconf-style compiler and/or external dependency checking with `-Werror`, but nobody should be doing that.

### Which operating system are you running Bazel on?

Arch Linux

### What is the output of `bazel info release`?

release 7.6.0

### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.

_No response_

### What's the output of `git remote get-url origin; git rev-parse HEAD` ?

```text
Not applicable
```

### Have you found anything relevant by searching the web?

#13880 does not apply because this is about warning flags, which do not affect code generation.

### Any other information, logs, or outputs that you want to share?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by tracing how Bazel handles --cxxopt when configuring C++ compile actions and how warning options enter rebuild decisions. Compare the behavior with the concern in #13880; done means changing warning options avoids recompiling unaffected C++ files while still allowing warning failures to change build success.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system, performance
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.