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

ERROR: Analysis of target '//src:perf_to_profile' failed; build aborted: error loading package '@com_google_protobuf//': Unable to find package for @rules_java//java:defs.bzl: The repository '@rules_java' could not be resolved. #101

Open
maxsei opened this issue Jul 12, 2021 · 4 comments
Assignees

Comments

@maxsei
Copy link

maxsei commented Jul 12, 2021

Not experienced enough how bazel build system works. I am running into this issue when building.

$ bazel build src:perf_to_profile
ERROR: /home/mschulte/.local/opt/perf_data_converter/src/quipper/BUILD:25:1: every rule of type proto_library implicitly depends upon the target '@com_google_protobuf//:protoc', but this target could not be found because of: error loading package '@com_google_protobuf//': Unable to find package for @rules_java//java:defs.bzl: The repository '@rules_java' could not be resolved.
ERROR: Analysis of target '//src:perf_to_profile' failed; build aborted: error loading package '@com_google_protobuf//': Unable to find package for @rules_java//java:defs.bzl: The repository '@rules_java' could not be resolved.
INFO: Elapsed time: 0.105s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 21 targets configured)
    currently loading: @com_google_protobuf//

Here is some potentially useful information about my system that the issue could depend on

  • g++
g++ (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
  • bazel
Build label: 0.26.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Thu Jun 6 11:05:05 2019 (1559819105)
Build timestamp: 1559819105
Build timestamp as int: 1559819105
  • clang
clang version 6.0.0-1ubuntu2 (tags/RELEASE_600/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
  • java
openjdk version "1.8.0_292"
OpenJDK Runtime Environment (build 1.8.0_292-8u292-b10-0ubuntu1~18.04-b10)
OpenJDK 64-Bit Server VM (build 25.292-b10, mixed mode)
  • javac
javac 11.0.11
  • protoc
libprotoc 3.6.1
@ZachMarcus
Copy link
Contributor

I haven't seen that class of error for @rules_java before, and can't find record of anyone else running into it other than a brief mention in this random Eclipse commit from 2 years ago.

The problem shouldn't be related to perf_data_converter itself (if you wanted to look into it further, I'd recommend looking at what changes got into protobuf around that time). It could have been transient unavailability, or an actual bug introduced in a workspace file somewhere.

If you can still reproduce this from top of tree then I'll give it another look, but I'd wager this has resolved itself.

@maxsei
Copy link
Author

maxsei commented Oct 1, 2021

I'll look that this soon. It was more a curiosity for me rather than anything super critical. If I can help understand this problem I'm glad to. I'll need a few days.

@nsajko
Copy link

nsajko commented Nov 9, 2021

I have a similar issue:

$ bazel build src:perf_to_profile
ERROR: /home/nsajko/src/github.com/google/perf_data_converter/src/BUILD:172:11: error loading package '@com_google_protobuf//': Unable to find package for @rules_pkg//:mappings.bzl: The repository '@rules_pkg' could not be resolved. and referenced by '//src:builder'
ERROR: Analysis of target '//src:perf_to_profile' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.051s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets configured)

This is Archlinux, with Bazel 4.2.0 and protobuf 3.17.3.

@cptspacemanspiff
Copy link

I just wanted to reply that it seems like this is a issue caused by google protobuf moving from 3.19.x to 4.0 . This caused some sort of incompatibility with how dependencies are automatically pulled.

It can be worked around by linking against the older versions of the protobuf repo in perf_data_converter/WORKSPACE and replacing

http_archive(
    name = "com_google_protobuf",
    urls = ["https://codeload.github.com/protocolbuffers/protobuf/zip/master"],
    strip_prefix = "protobuf-master",
    type = "zip",
)

with

http_archive(
    name = "com_google_protobuf",
    urls = ["https://codeload.github.com/protocolbuffers/protobuf/zip/3.19.x"],
    strip_prefix = "protobuf-3.19.x",
    type = "zip",
)

similarly to get the unit tests working replace

http_archive(
     name = "com_google_googletest",
     urls = ["https://github.com/google/googletest/archive/master.zip"],
     strip_prefix = "googletest-master",
)

with

http_archive(
     name = "com_google_googletest",
     urls = ["https://github.com/google/googletest/archive/release-1.11.0.zip"],
     strip_prefix = "googletest-release-1.11.0",
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants