[Bazel CI] ERROR: no such target '@@googletest+//:gtest': target 'gtest' not declared in package '' defined by /private/var/tmp/_bazel_buildkite/googletest+/BUILD.bazel

Open
#641 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
30/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale

Research direction

Start with examples/third-party-dependencies/BUILD at line 35 and the //:gtest_test reference, then reproduce the failure with the pinned commit and USE_BAZEL_VERSION value. Compare the external googletest package's available targets with the requested gtest target; done means bazel build //... succeeds on the reported platforms.

Written by the indexing model from the issue text.

Description

CI: https://buildkite.com/bazel/bazel-at-head-plus-downstream/builds/5067#019a6bf5-60a4-4306-9429-b49e0c99eed6

Platform: Ubuntu, MacOS

Logs:

(05:12:33) ERROR: /private/var/tmp/_bazel_buildkite/52ca603d8c75fd0a5c5014b85d9a18ae/external/googletest+/BUILD.bazel: no such target '@@googletest+//:gtest': target 'gtest' not declared in package '' defined by /private/var/tmp/_bazel_buildkite/52ca603d8c75fd0a5c5014b85d9a18ae/external/googletest+/BUILD.bazel
(05:12:33) ERROR: /Users/buildkite/builds/bk-macos-arm64-ngy9/bazel-org-repo-root/examples/third-party-dependencies/BUILD:35:8: no such target '@@googletest+//:gtest': target 'gtest' not declared in package '' defined by /private/var/tmp/_bazel_buildkite/52ca603d8c75fd0a5c5014b85d9a18ae/external/googletest+/BUILD.bazel and referenced by '//:gtest_test'
(05:12:33) ERROR: Analysis of target '//:gtest_test' failed; build aborted: Analysis failed
(05:12:33) INFO: Elapsed time: 6.641s, Critical Path: 0.02s
(05:12:33) INFO: 1 process: 1 internal.
(05:12:33) ERROR: Build did NOT complete successfully
(05:12:33) FAILED:

Culprit:

Steps:

git clone https://github.com/bazelbuild/examples
git reset 1fc2622b5f1b41183c6118059ac57e4590d92de7 --hard
export USE_BAZEL_VERSION=5a7d6f4e4dee4a08c95ca2450f046f566537266d
bazel build //... 

CC Greenteam @kotlaja

Dominant language
Starlark
Stars
957
Forks
578
Avg merge
2d 10h
Merged PRs (30d)
2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazelbuild/examples

All issues in bazelbuild/examples

Similar issues

More Build System issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.