FightingMan opened a new issue #1378:
URL: https://github.com/apache/incubator-brpc/issues/1378


   **Describe the bug (描述bug)**
   bazel 引入brpc失败
   单独在brpc项目里面 bazel build ...编译成功
   但是在单独的项目里面通过workspace引入brpc失败
   
   
   **To Reproduce (复现方法)**
   见附件
   
   **Expected behavior (期望行为)**
   bazel能通过workspace引入brpc
   
   **Versions (各种版本)**
   OS: centos7
   Compiler: gcc version 7.3.1 20180303 (Red Hat 7.3.1-6) (GCC)
   brpc: master
   protobuf: libprotoc 3.12.3
   bazel:bazel 1.1.0
   
   **Additional context/screenshots (更多上下文/截图)**
   
   (base) [ /tmp/test_brpc]$ cat test.cpp 
   #include <iostream>
   
   int main() {
       return 0;
   }
   (base) [ /tmp/test_brpc]$ cat BUILD 
   package(default_visibility = ["//visibility:public"])
   
   cc_binary(
       name = "test_server",
       linkopts = [
           "-ldl",
       ],
       deps = [
           ":test_service",
       ],
   )
   
   cc_library(
       name = "test_service",
       srcs = [“test.cpp”],
       visibility = [
           "//visibility:public",
       ],
       deps = [
         "@brpc_cpp//:brpc",
       ],
   )
   
   (base) [ /tmp/test_brpc]$ cat WORKSPACE 
   load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
   load('@bazel_tools//tools/build_defs/repo:git.bzl', 'git_repository')
   git_repository(
       name = "brpc_cpp",
       remote = "https://github.com/apache/incubator-brpc.git";,
       branch = "master",
   )
   (base) [ /tmp/test_brpc]$ bazel build ...
   INFO: Writing tracer profile to 
'/.../4bbabbdb1156dfbb9355920322dd01b1/command.profile.gz'
   DEBUG: Rule 'brpc_cpp' indicated that a canonical reproducible form can be 
obtained by modifying arguments commit = 
"b3a948c9dca29632b3367529488e070852e31f11", shallow_since = "1617642087 +0200" 
and dropping ["branch"]
   DEBUG: Call stack for the definition of repository 'brpc_cpp' which is a 
git_repository (rule definition at 
/.../4bbabbdb1156dfbb9355920322dd01b1/external/bazel_tools/tools/build_defs/repo/git.bzl:195:18):
    - /tmp/test_brpc/WORKSPACE:3:1
   ERROR: /tmp/test_brpc/BUILD:13:1: error loading package '@brpc_cpp//': in 
/.../4bbabbdb1156dfbb9355920322dd01b1/external/brpc_cpp/bazel/brpc.bzl: Unable 
to find package for @com_google_protobuf//:protobuf.bzl: The repository 
'@com_google_protobuf' could not be resolved. and referenced by 
'//:test_service'
   ERROR: Analysis of target '//:test_server' failed; build aborted: error 
loading package '@brpc_cpp//': in 
/.../4bbabbdb1156dfbb9355920322dd01b1/external/brpc_cpp/bazel/brpc.bzl: Unable 
to find package for @com_google_protobuf//:protobuf.bzl: The repository 
'@com_google_protobuf' could not be resolved.
   INFO: Elapsed time: 0.101s
   INFO: 0 processes.
   FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets 
configured)
   (base) [/tmp/test_brpc]$ ls
   BUILD  WORKSPACE   test.cpp


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to