Skip to content

Commit

Permalink
Automated rollback of commit 1b4c37c.
Browse files Browse the repository at this point in the history
*** Reason for rollback ***

Breaks protobuf when bootstrapping bazel (#7605)

ERROR: /home/bazel/.cache/bazel/_bazel_bazel/ec321eb2cc2d0f8f91b676b6d4c66c29/external/io_bazel/third_party/protobuf/3.6.1/BUILD:123:1: undeclared inclusion(s) in rule '@io_bazel//third_party/protobuf/3.6.1:protobuf_lite':
this rule is missing dependency declarations for the following files included by 'external/io_bazel/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.cc':
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/bytestream.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/common.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/port.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/platform_macros.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/macros.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/logging.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/mutex.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/callback.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/stringpiece.h'
  '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/hash.h'

*** Original change description ***

Always set --no-canonical-prefixes if we can

-no-canonical-prefixes should be enough in all cases except very
old compilers. For those, we keep using -fno-canonical-system-headers

Closes #7316.

PiperOrigin-RevId: 236613108
  • Loading branch information
hlopko authored and copybara-github committed Mar 4, 2019
1 parent 28ac6c4 commit badd82e
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tools/cpp/unix_cc_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -202,21 +202,20 @@ def _get_no_canonical_prefixes_opt(repository_ctx, cc):
# If the compiler sometimes rewrites paths in the .d files without symlinks
# (ie when they're shorter), it confuses Bazel's logic for verifying all
# #included header files are listed as inputs to the action.
# We also rely on symlinks not being resolved for remote builds.

# The '-no-canonical-prefixes' flag is enough in most cases.
# In case this flag is not supported (older gcc versions), we try to add
# '-fno-canonical-system-headers' instead.
# The '-fno-canonical-system-headers' should be enough, but clang does not
# support it, so we also try '-no-canonical-prefixes' if first option does
# not work.
opt = _add_compiler_option_if_supported(
repository_ctx,
cc,
"-no-canonical-prefixes",
"-fno-canonical-system-headers",
)
if len(opt) == 0:
return _add_compiler_option_if_supported(
repository_ctx,
cc,
"-fno-canonical-system-headers",
"-no-canonical-prefixes",
)
return opt

Expand Down

0 comments on commit badd82e

Please sign in to comment.