-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
C++ dependency pruning is broken for Windows/MSVC #14947
Comments
@meteorcloudy |
@konste Sure, I'm happy to review a PR, this sounds like a nice improvement for Windows. |
@konste Sorry, I meant the one line fix looks good to me, maybe extract the conditions to a function called |
@bazel-io fork 6.2.0 |
@meteorcloudy please review #17928 |
@meteorcloudy - PR approved! Please merge it and mark for cherry pick to 6.2.0 AND to 7.0.0-pre.20230322.4 if possible. |
/cc @kshyanashree Please cherry pick 788801a into 6.2 branch |
This fixes bazelbuild#14947. Closes bazelbuild#17928. PiperOrigin-RevId: 521446074 Change-Id: I4bc155f0245bc1933e86cd0b37762263437ed1fe
This fixes bazelbuild#14947. Closes bazelbuild#17928. PiperOrigin-RevId: 521446074 Change-Id: I4bc155f0245bc1933e86cd0b37762263437ed1fe
Description of the problem:
With
gcc
style compilerbazel
performs "dotD" dependency pruning of unused headers to limit recompilations if these unused headers were touched. As a feature this is somewhat documented inCODEBASE.md
and several issues here/mails on bazel-discuss.It is less clear if
bazel
does/is supposed to do the same with MSVC toolchains. It is clear thatbazel
uses/showIncludes
to perform header inclusion checking, but unclear if it goes further. #11765 hints at header pruning on Windows being a feature.Bugs: what's the simplest, easiest way to reproduce this bug?
bazel build :main -s
dead.h
which may be used bymain
but is never included frommain.cpp
bazel build :main -s
On Linux/gcc the second build does nothing, on Windows/MSVC the compilation unit is rebuild.
What operating system are you running Bazel on?
Ubuntu 21.10 / Windows 10
What's the output of
bazel info release
?release 5.0.0
Any other information, logs, or outputs that you want to share?
The following change in
bazel/src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java
Line 350 in 6c955a5
The text was updated successfully, but these errors were encountered: