bazelbuild / bazelbuild/bazel

Investigate flag change performance costs

Open
#15,520 0 comments 3 reactions 1 assignee Claimed by @gregestren View on GitHub
P2 team-Configurability type: feature request
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

### Description of the feature request:

Repeating the same build with any flag changes forces a full redo of Bazel's analysis phase. This can make trivial rebuilds noticeably slow (https://github.com/bazelbuild/bazel/issues/13186).

This code documents correctness concerns that prompt the redoing:

https://github.com/bazelbuild/bazel/blob/3cd5f8411a22341c5c964cfd03166a3bdc267bfc/src/main/java/com/google/devtools/build/lib/skyframe/SkyframeBuildView.java#L334-L339

(see https://github.com/bazelbuild/bazel/issues/13186#issuecomment-1027268206 for elaboration on the bug link)

It's unclear if we need to resort to such drastic measures to preserve correctness.

This issue tracks researching

- [ ] where precisely do the correctness concerns come from
- [ ] do user-defined (Starlark) flags and native flags require different treatment?
- [ ] can that code comment be more precise?
- [ ] can we add Skyframe nodes so Skyframe invalidation automatically does the right thing (redoing only affected nodes)?

@haxorz @brentleyjones

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

unnecessarily slow rebuilds when all you do is change `--foo=1` to `--foo=2`

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

all

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

n/a

### 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 master; git rev-parse HEAD` ?

```text
n/a
```

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

_No response_

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

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.