Virtual includes / Header inclusion checking behavior changed on Windows bazel9+
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
The same build configuration works on all platforms except Windows, and on Bazel 8. Broken on bazel9 + rolling:
```
(22:06:16) ERROR: C:/b/bk-windows-dmg8/bazel-org-repo-root/module_src/BUILD.bazel:76:11: Compiling third_party/jitterentropy/jitterentropy-library/src/jitterentropy-noise.c failed: undeclared inclusion(s) in rule '//:jitterentropy':
this rule is missing dependency declarations for the following files included by 'third_party/jitterentropy/jitterentropy-library/src/jitterentropy-noise.c':
'include/openssl/base.h'
(22:06:16) ERROR: C:/b/bk-windows-dmg8/bazel-org-repo-root/module_src/BUILD.bazel:76:11: Compiling third_party/jitterentropy/jitterentropy-library/src/jitterentropy-health.c failed: undeclared inclusion(s) in rule '//:jitterentropy':
this rule is missing dependency declarations for the following files included by 'third_party/jitterentropy/jitterentropy-library/src/jitterentropy-health.c':
'include/openssl/base.h'
(22:06:16) ERROR: C:/b/bk-windows-dmg8/bazel-org-repo-root/module_src/BUILD.bazel:76:11: Compiling third_party/jitterentropy/jitterentropy-library/src/jitterentropy-gcd.c failed: undeclared inclusion(s) in rule '//:jitterentropy':
this rule is missing dependency declarations for the following files included by 'third_party/jitterentropy/jitterentropy-library/src/jitterentropy-gcd.c':
'include/openssl/base.h'
(22:06:16) ERROR: C:/b/bk-windows-dmg8/bazel-org-repo-root/module_src/BUILD.bazel:76:11: Compiling third_party/jitterentropy/jitterentropy-library/src/jitterentropy-timer.c failed: undeclared inclusion(s) in rule '//:jitterentropy':
this rule is missing dependency declarations for the following files included by 'third_party/jitterentropy/jitterentropy-library/src/jitterentropy-timer.c':
'include/openssl/base.h'
(22:06:16) ERROR: C:/b/bk-windows-dmg8/bazel-org-repo-root/module_src/BUILD.bazel:76:11: Compiling third_party/jitterentropy/jitterentropy-library/src/jitterentropy-sha3.c failed: undeclared inclusion(s) in rule '//:jitterentropy':
this rule is missing dependency declarations for the following files included by 'third_party/jitterentropy/jitterentropy-library/src/jitterentropy-sha3.c':
'include/openssl/base.h'
```
See https://github.com/bazelbuild/bazel-central-registry/pull/7354 and https://buildkite.com/bazel/bcr-presubmit/builds/27371#019c2589-bc3c-466a-b6d6-6515df5e2b77
### Which category does this issue belong to?
_No response_
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
https://github.com/dzbarsky/aws-lc/tree/1.67.0 has the bazel overlay applied and can be used to run the build on Windows + bazel9. I am not sure if it reproduces with the configured hermetic toolchain or only default system one that BCR uses (I don't have a local windows setup).
### Which operating system are you running Bazel on?
Windows
### What is the output of `bazel info release`?
_No response_
### 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
```
### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
Between 8 and 9. No local env to bisect
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
cc @fmeum
Contributor guide
Research direction
Start with the linked aws-lc 1.67.0 tree and reproduce the Windows build with Bazel 9+, focusing on module_src/BUILD.bazel:76 and the jitterentropy C sources. Compare the behavior with Bazel 8 and check the referenced BCR pull request and Buildkite log. Done means identifying the Bazel 9 regression and confirming a fix or precise mitigation for the undeclared include of include/openssl/base.h.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system, operating-systems
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100