Skip to content
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

Inclusion checking is broken in 0.10.0 #4572

Closed
iphydf opened this issue Feb 2, 2018 · 13 comments
Closed

Inclusion checking is broken in 0.10.0 #4572

iphydf opened this issue Feb 2, 2018 · 13 comments
Labels
P0 This is an emergency and more important than other current work. (Assignee required) type: bug

Comments

@iphydf
Copy link

iphydf commented Feb 2, 2018

external/yasm/BUILD.bazel:115:1: undeclared inclusion(s) in rule '@yasm//:genperf':
this rule is missing dependency declarations for the following files included by 'external/yasm/libyasm/xstrdup.c':
  '/usr/lib/clang/3.8.1/include/stddef.h'
  '/usr/lib/clang/3.8.1/include/stdarg.h'
  '/usr/lib/clang/3.8.1/include/__stddef_max_align_t.h'
  '/usr/lib/clang/3.8.1/include/stdint.h'
INFO: Elapsed time: 3.690s, Critical Path: 0.18s
FAILED: Build did NOT complete successfully

https://github.com/iphydf/toktok-stack/blob/build-yasm/third_party/BUILD.yasm
https://github.com/iphydf/toktok-stack/blob/build-yasm/WORKSPACE

@nicolasnoble
Copy link

Blocking issue for the gRPC team - this happens if you specify build --client_env=CC=clang in the tools/bazel.rc file.

@adelez
Copy link

adelez commented Feb 14, 2018

Friendly ping? Is there any update on this?

@jin
Copy link
Member

jin commented Feb 14, 2018

@mhlopko can you take a look at this please?

@g-easy
Copy link

g-easy commented Feb 15, 2018

I ran into this also.

export CC=clang
bazel clean --expunge
bazel build $some_thing

Looking at $(bazel info output_base)/external/local_config_cc/CROSSTOOL, it has:

  cxx_builtin_include_directory: "/usr/include/c++/6.3.0"
  cxx_builtin_include_directory: "/usr/include/x86_64-linux-gnu/c++/6.3.0"
  cxx_builtin_include_directory: "/usr/include/c++/6.3.0/backward"
  cxx_builtin_include_directory: "/usr/local/include"
  cxx_builtin_include_directory: "/usr/lib/llvm-3.8/lib/clang/3.8.1/include"
  cxx_builtin_include_directory: "/usr/include/x86_64-linux-gnu"
  cxx_builtin_include_directory: "/usr/include"

but no /usr/lib/clang/3.8.1/include

@benjaminp
Copy link
Collaborator

If you're building on a Debian derivative, it's likely due to a Debian patch as described in #3977 (comment).

@philwo philwo added the P0 This is an emergency and more important than other current work. (Assignee required) label Feb 15, 2018
@philwo
Copy link
Member

philwo commented Feb 15, 2018

@ulfjack @mhlopko This seems like a huge regression. Can you help figuring out what's going on here?

@hlopko
Copy link
Member

hlopko commented Feb 16, 2018

Looking into it. The culprit is https://source.bazel.build/bazel/+/e99279bcce475249e58543a5330fa35e59acd7e8:tools/cpp/unix_cc_configure.bzl;dlc=a3fd5e76be71988035388c7e09c3257c8cbb2dd3, since then we're adding -no-canonical-prefixes if compiler supports it and this apparently makes clang to return different include paths in .d files than what it reports in clang -E -xc++ - -v.

@hlopko
Copy link
Member

hlopko commented Feb 16, 2018

@hlopko
Copy link
Member

hlopko commented Feb 16, 2018

And uploaded https://bazel-review.googlesource.com/c/bazel/+/39872 with the fix.

@hlopko
Copy link
Member

hlopko commented Feb 16, 2018

Could you test that the patch fixes the problem for you?

@ulfjack
Copy link
Contributor

ulfjack commented Feb 16, 2018

Does this also fix #3977?

@hlopko
Copy link
Member

hlopko commented Feb 16, 2018

Ok the exported cl I linked to is a merge of multiple changes, I'll link to a proper patch soon :)

@hlopko
Copy link
Member

hlopko commented Feb 16, 2018

katre pushed a commit that referenced this issue Feb 20, 2018
…ed to clang

With e99279b we started passing -no-canonical-prefixes to clang, but that
causes inconsistent directories used in .d files and system include
directories. The solution is to pass -no-canonical-prefixes also when asking
clang for system include directories.

Interestingly, clang in debian breaks when called like:
`clang -E -xc++ - -v -no-canonical-prefixes`
we have to pass absolute path to the binary like:
`/usr/bin/clang -E -xc++ - -v -no-canonical-prefixes`
then it works.

Fixes #4572.

RELNOTES: None.
PiperOrigin-RevId: 186210671
katre pushed a commit that referenced this issue Feb 28, 2018
…ed to clang

With e99279b we started passing -no-canonical-prefixes to clang, but that
causes inconsistent directories used in .d files and system include
directories. The solution is to pass -no-canonical-prefixes also when asking
clang for system include directories.

Interestingly, clang in debian breaks when called like:
`clang -E -xc++ - -v -no-canonical-prefixes`
we have to pass absolute path to the binary like:
`/usr/bin/clang -E -xc++ - -v -no-canonical-prefixes`
then it works.

Fixes #4572.

RELNOTES: None.
PiperOrigin-RevId: 186210671
philwo pushed a commit that referenced this issue Mar 6, 2018
…ed to clang

With e99279b we started passing -no-canonical-prefixes to clang, but that
causes inconsistent directories used in .d files and system include
directories. The solution is to pass -no-canonical-prefixes also when asking
clang for system include directories.

Interestingly, clang in debian breaks when called like:
`clang -E -xc++ - -v -no-canonical-prefixes`
we have to pass absolute path to the binary like:
`/usr/bin/clang -E -xc++ - -v -no-canonical-prefixes`
then it works.

Fixes #4572.

RELNOTES: None.
PiperOrigin-RevId: 186210671
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P0 This is an emergency and more important than other current work. (Assignee required) type: bug
Projects
None yet
Development

No branches or pull requests

9 participants