2016-01-10 45 views
1

我有protobuf編譯器版本3.0,需要安裝grpc和grpc python插件。在介紹之後,我加入deb http://http.debian.net/debian jessie-backports main我的sources.list文件,並做了sudo apt-get updatesudo apt-get install libgrpc-dev其返回在Ubuntu上安裝/編譯grpc時出錯

Package libgrpc-dev is not available, but is referred to by another package. 
This may mean that the package is missing, has been obsoleted, or 
is only available from another source 
E: Package 'libgrpc-dev' has no installation candidate 

所以,我決定從源代碼編譯爲中提到的安裝說明,做:

$ git clone https://github.com/grpc/grpc.git 
$ cd grpc 
$ git submodule update --init 
$ make 
$ [sudo] make install 

然而,在化妝步驟中,我得到

[MAKE] Generating cache.mk 
make: Circular /home/vagrant/grpc2/grpc/libs/opt/libboringssl.a <- /home/vagrant/grpc2/grpc/libs/opt/libboringssl.a dependency dropped. 
[C]  Compiling third_party/boringssl/crypto/bio/connect.c 
third_party/boringssl/crypto/bio/connect.c: In function 'split_host_and_port': 
third_party/boringssl/crypto/bio/connect.c:127:17: error: declaration of 'close' shadows a global declaration [-Werror=shadow] 
cc1: all warnings being treated as errors 
make: *** [/home/vagrant/grpc2/grpc/objs/opt/third_party/boringssl/crypto/bio/connect.o] Error 1 

在切換到釋放0_11分支,運行make結果

[HOSTCXX] Compiling src/compiler/csharp_generator.cc 
src/compiler/csharp_generator.cc:47:43: error: 'google::protobuf::compiler::csharp::GetUmbrellaClassName' has not been declared 
src/compiler/csharp_generator.cc: In function 'void grpc_csharp_generator::{anonymous}::GenerateServiceDescriptorProperty(grpc::protobuf::io::Printer*, const ServiceDescriptor*)': 
src/compiler/csharp_generator.cc:237:62: error: 'GetUmbrellaClassName' was not declared in this scope 
make: *** [/home/vagrant/grpc2/grpc/objs/opt/src/compiler/csharp_generator.o] Error 1 

我找不出如何安裝這個。任何幫助,將不勝感激。

回答

1

工作向後:

發佈-0_11:它看起來像你想編譯反對最近的protobuf。由於我們現在都在開發中,偶爾會發生破壞 - 但grpc會跟蹤它在third_party/protobuf中測試的protobuf版本。嘗試檢出並安裝該版本。我提交了https://github.com/grpc/grpc/issues/4697以更新到最新的protobuf 3.0版本。

for master from github:你正在使用哪種編譯器和操作系統?我最近檢查了無聊的整合工作,所以它很新鮮,而且幾乎沒有經過戰鬥測試。我想要通過戰鬥測試。也就是說,如果你做'make EMBED_OPENSSL = false',那麼事情應該適合你。

爲debian包問題:我不知道發生了什麼事。如果你能讓我知道它是哪個操作系統,我很樂意嘗試在你的操作系統和repro上啓動一個虛擬機。

+0

嘿, 謝謝(你的)信息。我在vagrant ubuntu/trusty64上使用它,所以使用股票編譯器的14.04 64位Ubuntu。 –

2

對我後,我在文件中做出變化的問題得到了修正:由

diff --git a/src/compiler/csharp_generator.cc 

b/src/compiler/csharp_generator.cc 
index 7b497df..5a8746d 100644 
--- a/src/compiler/csharp_generator.cc 
+++ b/src/compiler/csharp_generator.cc 
@@ -44,7 +44,7 @@ 

using google::protobuf::compiler::csharp::GetFileNamespace; 
using google::protobuf::compiler::csharp::GetClassName; 
-using google::protobuf::compiler::csharp::GetUmbrellaClassName; 
+using google::protobuf::compiler::csharp::GetReflectionClassName; 
using grpc::protobuf::FileDescriptor; 
using grpc::protobuf::Descriptor; 
using grpc::protobuf::ServiceDescriptor; 
@@ -234,7 +234,7 @@ void GenerateServiceDescriptorProperty(Printer* out, const ServiceDescriptor *se 
    out->Print("public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor\n"); 
    out->Print("{\n"); 
    out->Print(" get { return $umbrella$.Descriptor.Services[$index$]; }\n", 
-    "umbrella", GetUmbrellaClassName(service->file()), "index", 
+    "umbrella", GetReflectionClassName(service->file()), "index", 
       index.str()); 
    out->Print("}\n"); 
    out->Print("\n"); 

更具體地說,請打開文件src/compiler/csharp_generator.cc和替換的所有引用GetUmbrellaClassName GetReflectionClassName