bazelbuild/bazel

@bazel_tools references missing targets below tools/cpp/runfiles

Open

#15,397 opened on 2022年5月4日

GitHub で見る
 (0 comments) (0 reactions) (0 assignees)Java (4,465 forks)batch import
P3help wantedteam-OSStype: bug

Repository metrics

Stars
 (25,384 stars)
PR merge metrics
 (平均マージ 22d 20h) (30d で 77 merged PRs)

説明

Description of the bug:

The exported version of @bazel_tools//tools/cpp:srcs references a label that does not exist.

This causes a cquery to fail:

$ bazel cquery @bazel_tools//tools/cpp/...
no such target '@bazel_tools//tools/cpp/runfiles:srcs': target 'srcs' not declared in package 'tools/cpp/runfiles' defined by <output_base</external/bazel_tools/tools/cpp/runfiles/BUILD and referenced by '@bazel_tools//tools/cpp:srcs'

ERROR: Analysis of target '@bazel_tools//tools/cpp:srcs' failed; build aborted: Analysis failed

What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.

Executing cquery:

bazel cquery @bazel_tools//tools/cpp/...

Which operating system are you running Bazel on?

Windows 10 and ubuntu 20.04

What is the output of bazel info release?

release 5.1.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

I searched the issues https://github.com/bazelbuild/bazel/issues for similar issues.

Any other information, logs, or outputs that you want to share?

I found a difference in https://github.com/bazelbuild/bazel/blob/5.1.1/tools/cpp/BUILD.tools#L487 .

As compared to: https://github.com/bazelbuild/bazel/blob/5.1.1/tools/cpp/BUILD#L24

I can't tell whether the referred target https://github.com/bazelbuild/bazel/blob/5.1.1/tools/cpp/runfiles/BUILD#L4 should be also included in https://github.com/bazelbuild/bazel/blob/5.1.1/tools/cpp/runfiles/BUILD.tools or if the dangling reference should be removed.

コントリビューターガイド