Skip to content

Bazel dependency check for asan_blacklist.txt with clang-10 #10510

@asraa

Description

@asraa

Description of the problem / feature request:

Envoy (and other bazel projects) are failing asan builds with clang-10 due to a dependency check. The exact error message:

Step #4: ERROR: /builder/home/.cache/bazel/_bazel_root/4e9824db8e7d11820cfa25090ed4ed10/external/boringssl/BUILD:131:1: undeclared inclusion(s) in rule '@boringssl//:crypto':
Step #4: this rule is missing dependency declarations for the following files included by 'external/boringssl/src/crypto/dh/params.c':
Step #4:   '/usr/local/lib/clang/10.0.0/share/asan_blacklist.txt'

Tracking issue on OSS-Fuzz : google/oss-fuzz#3093

Bugs: what's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Install clang-10 and build a bazel project (eg Envoy) with asan. OSS-Fuzz's docker image runs with this. The clang-10 installation in the docker environment was reverted in google/oss-fuzz#3093, building before this commit will reproduce the error.

The issue was solved by using Clang-9 release version.

What operating system are you running Bazel on?

Linux

What's the output of bazel info release?

2.0.0

What's the output of git remote get-url origin ; git rev-parse master ; git rev-parse HEAD ?

Replace this line with your answer.

Have you found anything relevant by searching the web?

The patch that may have caused this issue is llvm/llvm-project@03b84e4#diff-e2fe4c5daa679eec2fe3bad655f14dc0

Comment from Pete Collingbourne:

The change made it so that /usr/local/lib/clang/10.0.0/share/asan_blacklist.txt would appear in the depfile (-MF output) when passing -MD. Presumably bazel implements some sort of check that the files mentioned in the depfile are a subset of those in the rule's dependencies clause. Maybe the solution is to teach bazel that asan_blacklist.txt is a valid dependency of any asan compilation (or maybe all compilations, whichever is easier).

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)team-Rules-CPPIssues for C++ rules

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions