Skip to content

Add option to disable header inclusion check #24926

@froody

Description

@froody

Description of the feature request:

In my CI environment, I see builds randomly fail with errors like this (with protobuf-29.3 imported via MODULE.bazel).

this rule is missing dependency declarations for the following files included by 'src/google/protobuf/any_lite.cc':
  'bazel-out/k8-opt-exec-ST-d57f47055a04/bin/external/protobuf~/src/google/protobuf/_virtual_includes/protobuf_lite/google/protobuf/port.h'

The randomness of this error plus the need to clean the bazel cache (which doesn't always make the error go away) wastes countless hours of time. I would love to have a flag like --incompatible-ignore-header-checks which made these errors non-fatal

Which category does this issue belong to?

C++ Rules

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

Builds failing due to false positives from header inclusion checks

Which operating system are you running Bazel on?

Ubuntu 22.04

What is the output of bazel info release?

7.4.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 ?

<private repo>

Have you found anything relevant by searching the web?

No response

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

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    P4This is either out of scope or we don't have bandwidth to review a PR. (No assignee)team-Rules-CPPIssues for C++ rulestype: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions