bazelbuild / bazelbuild/bazel

Incremental build fails (missing dep declarations for std lib), requires expunge

Open
#11,200 5 comments 0 reactions 0 assignees View on GitHub
help wanted P4 team-Documentation team-Rules-CPP type: documentation (cleanup)
Dominant language
Java
Stars
25.8k
Forks
4.6k
Avg merge
2d 20h
Merged PRs (30d)
72

Description

With incremental builds, I see errors like

```
ERROR: /usr/local/google/home/gcmn/.cache/bazel/_bazel_gcmn/151032d5e60e04f24eb0914f43c91bbf/external/com_google_absl/absl/base/BUILD.bazel:145:1: undeclared inclusion(s) in rule '@com_google_absl//absl/base:malloc_internal':
this rule is missing dependency declarations for the following files included by 'external/com_google_absl/absl/base/internal/low_level_alloc.cc':
'/usr/lib/clang/9.0.1/include/stddef.h'
'/usr/lib/clang/9.0.1/include/stdint.h'
'/usr/lib/clang/9.0.1/include/limits.h'
'/usr/lib/clang/9.0.1/include/__stddef_max_align_t.h'
'/usr/lib/clang/9.0.1/include/stdarg.h'
```

The specific starting point varies (not always absl), but it's always an include of some std header. Building with RBE worked, so I think it's something specific about the local state. `bazel clean` was insufficient to fix the issue, but `bazel clean --expunge` made it go away. Per the instructions at https://docs.bazel.build/versions/master/user-manual.html#the-clean-command, I'm filing a bug.

Please let me know what additional information I can provide, although I suspect some things may be lost now that I've run expunge.

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the incremental-build failure involving external/com_google_absl/absl/base/BUILD.bazel and low_level_alloc.cc, noting the missing Clang standard headers. Compare local incremental builds with RBE, then test the reported difference between bazel clean and bazel clean --expunge. Done means identifying the local-state cause and adding a regression test or documented fix.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
build-system
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.