bazelbuild / rules_cc

C++ Rules for Bazel
https://bazel.build
Apache License 2.0
186 stars 93 forks source link

com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package 'cc' When Using cc_shared_library #51

Closed bmzhao closed 4 years ago

bmzhao commented 4 years ago

Description of the problem / feature request:

Using bazel version 1.2.0 with cc_shared_library causes a bazel error:

ERROR: While resolving toolchains for target //:a_so: com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package 'cc': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package. - /tmp/experimental/cc ERROR: Analysis of target '//:a_so' failed; build aborted: com.google.devtools.build.lib.packages.BuildFileNotFoundException: no such package 'cc': BUILD file not found in any of the following directories. Add a BUILD file to a directory to mark it as a package. - /tmp/experimental/cc INFO: Elapsed time: 1.010s INFO: 0 processes. FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets configured)

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

https://gist.github.com/bmzhao/311efdfd4306dca02af21b4110ae14bd has a working repro, based off of: https://github.com/bmzhao/experimental/blob/da47bfb740e1729cdf1a9aaa145c4841cc1d004c/BUILD

What operating system are you running Bazel on?

Linux, Debian

What's the output of bazel info release?

release 1.2.0

What version of rules_cc do you use? Can you paste the workspace rule used to fetch rules_cc? What other relevant dependencies does your project have?

https://github.com/bazelbuild/rules_cc/tree/d562dc8046d6251972d18ccfddc3dbfe61e1d79f, which is at commit https://github.com/bazelbuild/rules_cc/commit/d562dc8046d6251972d18ccfddc3dbfe61e1d79f

http_archive( name = "rules_cc", sha256 = "0c5297b7c13b15067180e663a7f8499bdf66b53c33eb53627ec38a1cd57baf96", strip_prefix = "rules_cc-d562dc8046d6251972d18ccfddc3dbfe61e1d79f", urls = ["https://github.com/bazelbuild/rules_cc/archive/d562dc8046d6251972d18ccfddc3dbfe61e1d79f.zip"], )

What Bazel options do you use to trigger the issue? What C++ toolchain do you use?

bazel build --experimental_cc_shared_library :a_so Toolchain was whatever bazel auto-resolved to.

Have you found anything relevant by searching the web?

Nope.

oquenchil commented 4 years ago

This is fixed already. Thanks for reporting!