BUILD file not found on package path when loading worker_protobuf_java_proto target

2,280 views
Skip to first unread message

Miles Yucht

unread,
Jun 25, 2016, 5:35:10 PM6/25/16
to bazel-discuss
Hi all,

I'm trying to update the version of Bazel for a project that uses Bazel's java protobuf libraries. In version 0.2.2b, we depended on a target @bazel_tools//src/main/protobuf:worker_protobuf_java_proto, but I get the following error when building this project on version 0.3.0:

error loading package '@bazel_tools//src/main/protobuf': Extension file not found. Unable to load package for '@bazel_tools//third_party/protobuf:protobuf.bzl': BUILD file not found on package path and referenced by '//bazel/rules/scala/scala:scala-worker-lib'.

I installed Bazel on Ubuntu 16.04 following the instructions at http://www.bazel.io/docs/install.html, and bazel version prints the following output:

Build label: 0.3.0
Build target: bazel-out/local-fastbuild/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Fri Jun 10 11:38:23 2016 (1465558703)
Build timestamp: 1465558703
Build timestamp as int: 1465558703

Minimal reproductive case which I think demonstrates the problem:

mkdir test
cd test
touch WORKSPACE
bazel query 'kind(rule, @bazel_tools//src/main/protobuf:all)'

results in:

ERROR: while parsing '@bazel_tools//src/main/protobuf:all': error loading package '@bazel_tools//src/main/protobuf': Extension file not found. Unable to load package for '@bazel_tools//third_party/protobuf:protobuf.bzl': BUILD file not found on package path.

It seems like this BUILD file is present in the release according to github: https://github.com/bazelbuild/bazel/blob/0.3.0/third_party/protobuf/BUILD

Appreciate the guidance in advance!
Miles

Miles Yucht

unread,
Jun 25, 2016, 5:49:49 PM6/25/16
to bazel-discuss
Sorry, the target name is worker_protocol_java_proto, not worker_protobuf_java_proto.

Miles Yucht

unread,
Jun 25, 2016, 6:49:14 PM6/25/16
to bazel-discuss
Ah, I just saw this: https://github.com/bazelbuild/bazel/commit/285112c9b61ca3782e00ccf6411339da7291a3c3. Where can we get these dependencies from now, if not from bazel_tools?

Damien Martin-guillerez

unread,
Jun 27, 2016, 3:43:46 AM6/27/16
to Miles Yucht, bazel-discuss
Hi Miles,

You can use a git_repository to depends on the bazel repository. This protobuf was never intended to be accessed from the bazel_tools repository.

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/ff5cb0dc-6907-4216-9cc2-4e6fb4ad5506%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Miles Yucht

unread,
Jun 27, 2016, 3:47:30 AM6/27/16
to Damien Martin-guillerez, bazel-discuss
Hi Damien,

Thanks for your response! That's exactly what I ended up doing (copying what you guys did in the dash project).

By the way, I was trying to find out exactly what the bazel_tools repository was, since it seems like you can use it without actually adding it in the WORKSPACE file. Where can I go to find out what the bazel_tools repository exposes?

Thanks again!
Miles

Damien Martin-guillerez

unread,
Jun 27, 2016, 3:58:33 AM6/27/16
to Miles Yucht, bazel-discuss
Reply all
Reply to author
Forward
0 new messages