Giter Club home page Giter Club logo

conan-protobuf's Introduction

conan-protobuf's People

Contributors

gasuketsu avatar kbinani avatar lasote avatar marcodiiga avatar memsharded avatar phibedy avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar

conan-protobuf's Issues

MacOS Error

While trying to use protobuf in a project I encountered an error. So I cloned the Repository and ran conan test which gave the following result:

arch=x86_64
build_type=Release
compiler=apple-clang
compiler.libcxx=libc++
compiler.version=7.3
os=Macos

dyld: Symbol not found: __ZN6google8protobuf8compiler20CommandLineInterface12AllowPluginsERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE
  Referenced from: conan-protobuf/test_package/build/da39a3ee5e6b4b0d3255bfef95601890afd80709/./bin/protoc (which was built for Mac OS X 10.11)
  Expected in: /usr/local/lib/libprotoc.9.dylib
 in conan-protobuf/test_package/build/da39a3ee5e6b4b0d3255bfef95601890afd80709/./bin/protoc
ERROR: Error 5 while executing ./bin/protoc ../../message.proto --proto_path=../.. --cpp_out="."

When I tested it on Linux it worked fine. Any help would be appreciated.

Build fails on ubuntu 16.04 with gcc 5.4

New ubuntu 16.04

//install basics
//automake/libtool is needed for protobuffers
sudo apt-get update
sudo apt-get install python python-pip build-essential make git cmake automake libtool
//install conan
sudo pip install conan
//add remote to conan
conan remote add lms http://mineforce.de:9300
conan install lms/2.0@lms/stable --build=missing

Error

[100%] Linking CXX executable bin/lms
liblmscore.so: undefined reference to `google::protobuf::internal::empty_string_'
liblmscore.so: undefined reference to `google::protobuf::internal::WireFormatLite::ReadString(google::protobuf::io::CodedInputStream*, std::string*)'
liblmscore.so: undefined reference to `pugi::xml_node::path(char) const' #Some other lib we have to fix
liblmscore.so: undefined reference to `google::protobuf::DescriptorPool::FindFileByName(std::string const&) const'
liblmscore.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteString(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
liblmscore.so: undefined reference to `google::protobuf::Message::InitializationErrorString() const'
liblmscore.so: undefined reference to `google::protobuf::internal::StringTypeHandlerBase::Delete(std::string*)'
liblmscore.so: undefined reference to `google::protobuf::MessageFactory::InternalRegisterGeneratedFile(char const*, void (*)(std::string const&))'
liblmscore.so: undefined reference to `google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(int, std::string const&, google::protobuf::io::CodedOutputStream*)'
liblmscore.so: undefined reference to `google::protobuf::internal::StringTypeHandlerBase::New()'
liblmscore.so: undefined reference to `google::protobuf::io::CodedOutputStream::WriteStringWithSizeToArray(std::string const&, unsigned char*)'
liblmscore.so: undefined reference to `google::protobuf::Message::GetTypeName() const'
collect2: error: ld returned 1 exit status
CMakeFiles/lms.dir/build.make:95: recipe for target 'bin/lms' failed
make[2]: *** [bin/lms] Error 1
CMakeFiles/Makefile2:104: recipe for target 'CMakeFiles/lms.dir/all' failed
make[1]: *** [CMakeFiles/lms.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

lms/2.0@lms/stable: ERROR: Package '13a8d081f533db91339ab619a0f71485c8820c78' build failed
lms/2.0@lms/stable: WARN: Build folder /home/phoenix/.conan/data/lms/2.0/lms/stable/build/13a8d081f533db91339ab619a0f71485c8820c78
ERROR: lms: Error 512 while executing cmake --build . 

It works on ubuntu 14.04 with gcc 4.8 and 6.2.

env_info for other packages depends on this pacakge

Currently I am trying coming conan 0.20.0 (0.20.0dev1) to create packages that depends on this protobuf package with new "virturlbuildenv" generator.

In Linux environment, library package (let's name it A here) depends on this protobuf may want perform "protoc" to generate pb.cc/h in its make phase.
I have tried describe imports() in recipe for package A and found files listed in imports() are missing when building package under package build directory (i.e. ~/.conan/data/A/version/user/channel/build/package). I am not sure if this is expected behavior in conan, but I think adding env_info like following snipet would be helpful for this scenario and users will be able to run "protoc" without importing.

Or, is there other good way ?

diff --git a/conanfile.py b/conanfile.py
index d23e28b..57ab8ab 100644
--- a/conanfile.py
+++ b/conanfile.py
@@ -103,3 +103,6 @@ class ProtobufConan(ConanFile):
             self.cpp_info.libs = ["libprotobuf.a"] if not self.options.shared else ["libprotobuf.9.dylib"]
         else:
             self.cpp_info.libs = ["protobuf"]
+        if self.settings.os == "Linux":
+            self.env_info.path.append(os.path.join(self.package_folder, "bin"))
+            self.env_info.LD_LIBRARY_PATH.append(os.path.join(self.package_folder, "lib"))

Upload fails on Linux when shared is true

As mentioned in conan-io/conan#919, the upload fails on Linux when the shared option is true.

Change 'upload_repo' user from None (anonymous) to osechet
Uploading Protobuf/3.3.0@memsharded/testing
Uploading conanmanifest.txt                                           
[==================================================]                  
Uploaded conan recipe 'Protobuf/3.3.0@memsharded/testing' to 'upload_repo': https://api.bintray.com/conan/osechet/Conan
Uploading package 1/2: 9dc468f1c6797ce318a916e9e85c89fb15cd3e47
Package integrity OK!                                                 
Requesting upload permissions...Done!                                 
Uploading conanmanifest.txt                                           
[==================================================]                  
Uploading conaninfo.txt                                               
[==================================================]                  
Uploading conan_package.tgz                                           
[==================================================]                  
Uploading package 2/2: c9141d18ebeb1f2ce6a80c78c8ea06c46125d0ca
Checking package integrity...                                         
WARN: Mismatched checksum 'bin/.libs/lt-protoc' (manifest: None, file: a5af685d3ba9d9e6dce3dd24e860a47a)
ERROR: Cannot upload corrupted package 'Protobuf/3.3.0@memsharded/testing:c9141d18ebeb1f2ce6a80c78c8ea06c46125d0ca'
Traceback (most recent call last):
  File "build.py", line 14, in <module>
    builder.run()
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/conan/packager.py", line 235, in run
    self.upload_packages()
  File "/home/travis/virtualenv/python3.6.1/lib/python3.6/site-packages/conan/packager.py", line 296, in upload_packages
    raise Exception("Error uploading")
Exception: Error uploading

The problem is related to a lt-protoc file created in a hidden directory. The file is not referenced in the manifest but conan tries to upload it.

FindProtobuf.cmake

I would need the PROTOBUF_GENERATE_CPP() from FindProtobuf.cmake. I am not sure if it's already added/how to add it.

zlib too old version

When building with Ubuntu 16.04 and clang++-3.8 it seems like Protobuf doesn't pick up the referred zlib-library, but rather links to /usr/lib.

checking zlib version... configure: error: in `/home/hestad/.conan/data/Protobuf/3.3.0/memsharded/testing/build/720e8fdc278174b45ecf41394c5e5ec78ed30ff8/protobuf-3.3.0':
> configure: error: --with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4)

From conanfile: Protobuf/3.3.0@memsharded/testing

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.