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

Bazel does not distinguish between aborted and failed repository fetches #7993

Closed
meteorcloudy opened this issue Apr 10, 2019 · 3 comments
Closed
Assignees
Labels
P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug

Comments

@meteorcloudy
Copy link
Member

To reproduce with Bazel 0.25.0 rc1:

$ git clone https://github.com/tensorflow/tensorflow.git
$ cd tensorflow
$ yes "" | ./configure
$ bazel build --config=opt //tensorflow/tools/pip_package:build_pip_package --incompatible_disable_genrule_cc_toolchain_dependency 
Starting local Bazel server and connecting to it...
ERROR: /usr/local/google/home/pcloudy/.cache/bazel/_bazel_pcloudy/d2f15366e3b15100d3593f2d595721a3/external/com_github_googlecloudplatform_google_cloud_cpp/google/cloud/BUILD:31:11: in cmd attribute of genrule rule @com_github_googlecloudplatform_google_cloud_cpp//google/cloud:generate_build_info: $(CC) not defined
INFO: An error occurred during the fetch of repository 'com_google_absl'
INFO: Call stack for the definition of repository 'com_google_absl':
 - /usr/local/google/home/pcloudy/workspace/tensorflow/tensorflow/workspace.bzl:135:5
 - /usr/local/google/home/pcloudy/workspace/tensorflow/WORKSPACE:104:1
ERROR: Analysis of target '//tensorflow/tools/pip_package:build_pip_package' failed; build aborted: Analysis of target '@com_github_googlecloudplatform_google_cloud_cpp//google/cloud:generate_build_info' failed; build aborted
INFO: Elapsed time: 7.706s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (301 packages loaded, 6067 targets configured)

Bazel reports an error in com_google_absl, but the actual error comes from com_github_googlecloudplatform_google_cloud_cpp

@meteorcloudy meteorcloudy added type: bug P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. labels Apr 10, 2019
@aehlig aehlig changed the title Bazel prints incorrect "Call stack for the definition of repository" info Bazel does not distinguish between aborted and failed repository fetches Apr 10, 2019
@aehlig
Copy link
Contributor

aehlig commented Apr 10, 2019

First note that the call stack is not incorrect; it does show the correct place where the repository was defined. It might seem unrelated, but it is still factually correct.

The more fundamental problem in the implementation of external repositories is that all interrupted fetches look the same to the repository rule: a timeout (which would be a legitimate fetch failure) is reported to the repository rule the same way as an "abort the build, as something else has failed anyway". And technically the statement is correct: an error did occur while the fetch of that repository was going on; but it is certainly a legitimate feature request to distinguish between the reasons why a fetch was aborted. As a work around, you can sync or fetch first, or simply build with -k.

@aehlig
Copy link
Contributor

aehlig commented Apr 15, 2019

Related (but different) issue #3851.

@aehlig
Copy link
Contributor

aehlig commented Apr 25, 2019

@philwo philwo added the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Jun 15, 2020
@philwo philwo removed the team-OSS Issues for the Bazel OSS team: installation, release processBazel packaging, website label Nov 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 We'll consider working on this in future. (Assignee optional) team-ExternalDeps External dependency handling, remote repositiories, WORKSPACE file. type: bug
Projects
None yet
Development

No branches or pull requests

3 participants