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

Cannot build candidate for 0.24.0: undeclared inclusions in protobuf #7605

Closed
katre opened this issue Mar 1, 2019 · 11 comments
Closed

Cannot build candidate for 0.24.0: undeclared inclusions in protobuf #7605

katre opened this issue Mar 1, 2019 · 11 comments
Assignees
Labels
P0 This is an emergency and more important than other current work. (Assignee required) team-Rules-CPP Issues for C++ rules type: bug

Comments

@katre
Copy link
Member

katre commented Mar 1, 2019

Logs at https://buildkite.com/bazel-trusted/bazel-release/builds/13#d4abc10f-31bb-4b37-adab-4e921d302477

Error message:

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/statusor.cc':
  | '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/statusor.h'
  | '/workdir/third_party/protobuf/3.6.1/src/google/protobuf/stubs/status.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'
 ```
@katre katre added type: bug P0 This is an emergency and more important than other current work. (Assignee required) release blocker team-Rules-CPP Issues for C++ rules labels Mar 1, 2019
@katre
Copy link
Member Author

katre commented Mar 1, 2019

I can't reproduce this locally, but it's consistent on BuildKite.

@tetromino, do you know anything from the protobuf side?
@lberki or @hlopko do you know anything from the cc library side?

@katre
Copy link
Member Author

katre commented Mar 1, 2019

Oh, and I don't seem to have the required access to download the docker image and reproduce this directly, @fweikert do you know how I can get that?

@tetromino
Copy link
Contributor

//third_party/protobuf/3.6.1 uses angle-bracket includes everywhere. For example, in statusor.cc: #include <google/protobuf/stubs/statusor.h>

Is it possible that the include path is such that something (either the compiler or the include scanner) is pulling in includes from the wrong place - from /workdir/third_party/protobuf/3.6.1 insted of the expected place (I'm guessing something like /workdir/external/io_bazel/third_party/protobuf/3.6.1)?

Maybe replacing angle-brackets with "" would help...

@katre
Copy link
Member Author

katre commented Mar 1, 2019

Asking CI team to take a look: @meteorcloudy @fweikert @philwo

@katre
Copy link
Member Author

katre commented Mar 1, 2019

Adding the full log of the failing build:
bazel-release_build_13_ubuntu-14-dot-04.log

@philwo
Copy link
Member

philwo commented Mar 3, 2019

@katre I can reproduce this locally in Docker:

# On my workstation:
cd $HOME/src
git clone https://github.com/bazelbuild/bazel.git bazel-for-docker
sudo chown -R 999:999 bazel-for-docker
docker run -it --rm --init --volume $HOME/src/bazel-for-docker:/workdir --workdir /workdir --network host gcr.io/bazel-public/ubuntu1404:java8 /bin/bash

# Now inside the Docker container:
git fetch --force origin master
git fetch --force origin refs/notes/*:refs/notes/*
bazel build //src:bazel
mkdir output
cp bazel-bin/src/bazel output/bazel
output/bazel build -c opt --stamp --embed_label "0.24.0rc1" --workspace_status_command=scripts/ci/build_status_command.sh src/bazel scripts/packages/with-jdk/install.sh scripts/packages/debian/bazel-debian.deb scripts/packages/debian/bazel.dsc scripts/packages/debian/bazel.tar.gz bazel-distfile.zip

# Results in:
[...]
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'
INFO: Elapsed time: 44.423s, Critical Path: 22.00s
INFO: 1110 processes: 1 local, 1109 processwrapper-sandbox.
FAILED: Build did NOT complete successfully

I think this is a bug in Bazel.

@philwo
Copy link
Member

philwo commented Mar 3, 2019

Automatic bisecting:

git bisect start
git checkout master
bazel build //src:bazel && cp -f bazel-bin/src/bazel output/bazel && output/bazel build -c opt --stamp --embed_label 0.24.0rc1 --workspace_status_command=scripts/ci/build_status_command.sh src/bazel scripts/packages/with-jdk/install.sh scripts/packages/debian/bazel-debian.deb scripts/packages/debian/bazel.dsc scripts/packages/debian/bazel.tar.gz bazel-distfile.zip
# This failed.
git bisect bad

# Checkout baseline of 0.23.0, which should still be fine.
git checkout 441fd75d0047f8a998d784c557736ab9075db893
bazel build //src:bazel && cp -f bazel-bin/src/bazel output/bazel && output/bazel build -c opt --stamp --embed_label 0.24.0rc1 --workspace_status_command=scripts/ci/build_status_command.sh src/bazel scripts/packages/with-jdk/install.sh scripts/packages/debian/bazel-debian.deb scripts/packages/debian/bazel.dsc scripts/packages/debian/bazel.tar.gz bazel-distfile.zip
# That worked.
git bisect good

# Now run the automatic bisect:
git bisect run sh -c "bazel build //src:bazel && cp -f bazel-bin/src/bazel output/bazel && output/bazel build -c opt --stamp --embed_label 0.24.0rc1 --workspace_status_command=scripts/ci/build_status_command.sh src/bazel scripts/packages/with-jdk/install.sh scripts/packages/debian/bazel-debian.deb scripts/packages/debian/bazel.dsc scripts/packages/debian/bazel.tar.gz bazel-distfile.zip"

The culprit is this one: 1b4c37c

Verification:

git checkout master
git config --global user.email philwo@google.com
git config --global user.name 'Philipp Wollermann'
git revert 1b4c37c38804559b5c1ade6f9c93501875e231b0
bazel build //src:bazel && cp -f bazel-bin/src/bazel output/bazel && output/bazel build -c opt --stamp --embed_label 0.24.0rc1 --workspace_status_command=scripts/ci/build_status_command.sh src/bazel scripts/packages/with-jdk/install.sh scripts/packages/debian/bazel-debian.deb scripts/packages/debian/bazel.dsc scripts/packages/debian/bazel.tar.gz bazel-distfile.zip

# Success:
[...]
INFO: Elapsed time: 154.705s, Critical Path: 79.11s
INFO: 2871 processes: 2 local, 2394 processwrapper-sandbox, 475 worker.
INFO: Build completed successfully, 2949 total actions

@katre I recommend to rollback the culprit and cherry-pick that into 0.24.0.

@asuffield
Copy link
Contributor

That's annoying. Does anybody know exactly what the bad behaviour is from --no-canonical-prefixes here, or do we still need to debug it?

It is frustratingly difficult to precisely identify the situations in which this flag must be set and must not be set.

@hlopko
Copy link
Member

hlopko commented Mar 4, 2019

Hi all, I'm creating a rollback so we can unblock 0.24. What the actual problem is still needs investigation. @asuffield, will you have capacity to pursue this?

bazel-io pushed a commit that referenced this issue Mar 4, 2019
*** 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
@katre
Copy link
Member Author

katre commented Mar 4, 2019

Thanks for the rollback @hlopko. I will cherry-pick that into the release and if it works I will close this issue.

katre pushed a commit that referenced this issue Mar 4, 2019
*** 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
@katre
Copy link
Member Author

katre commented Mar 4, 2019

This is now resolved. Thanks for the help everyone.

@katre katre closed this as completed Mar 4, 2019
katre pushed a commit that referenced this issue Mar 7, 2019
*** 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
katre pushed a commit that referenced this issue Mar 7, 2019
*** 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
katre pushed a commit that referenced this issue Mar 8, 2019
*** 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
katre pushed a commit that referenced this issue Mar 13, 2019
*** 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
katre pushed a commit that referenced this issue Mar 19, 2019
*** 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
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) team-Rules-CPP Issues for C++ rules type: bug
Projects
None yet
Development

No branches or pull requests

7 participants