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

Protobuf support of gcc-4.8 #437

Closed
bashbug opened this issue Sep 12, 2018 · 17 comments
Closed

Protobuf support of gcc-4.8 #437

bashbug opened this issue Sep 12, 2018 · 17 comments
Assignees
Labels
enhancement feedback Waiting for feedback from the original issue author. Gets closed after several weeks if no feedback

Comments

@bashbug
Copy link

bashbug commented Sep 12, 2018

Running: conan install protobuf/3.6.1@bincrafters/stable
Leads to: ERROR: Unable to find 'protobuf/3.6.1@bincrafters/stable' in remotes

From here: #392 and specifically https://camo.githubusercontent.com/4f222ee19e71cac7c464221911a2c66667d48bd7/68747470733a2f2f73637265656e73686f747363646e2e66697265666f7875736572636f6e74656e742e636f6d2f696d616765732f34343731616533642d666331352d343034362d383438622d6336393536343439363065642e706e67

Ubuntu 14.04 users with gcc-4.8 are not supported. Any plan to do so?

Package Details

  • Package Name/Version: protobuf/3.6.1
  • Operating System: Linux Ubuntu 14.04
  • Compiler+version: gcc-4.8
@uilianries
Copy link
Member

Hi @bashbug !

we don't provide support for GCC 4.8 by default, but we can add when requested.

we dropped GCC 4.8 some time ago to save our CI time using Travis and also we had no objections.

@bashbug
Copy link
Author

bashbug commented Sep 13, 2018

@uilianries thanks for the fast response.
For now, I have to build from source and have to maintain the package by myself. Would really like not to do so.
I think it would be really helpful, if gcc-4.8 gets supported. Others might need it too.

@uilianries
Copy link
Member

Hi @bashbug !

Now it is possible to download protobuf with GCC 4.8 support

protobuf/3.6.1@bincrafters/stable

There is support for 64 bits only, but feel free to ask if you need to use 32 bits also.

@uilianries uilianries added the feedback Waiting for feedback from the original issue author. Gets closed after several weeks if no feedback label Sep 16, 2018
@bashbug
Copy link
Author

bashbug commented Sep 17, 2018

Hi @uilianries
Thanks for that fast integration!
I tried to pull it from bincrafters but it seems not to be availabe. From your latest commit bincrafters/conan-protobuf@5d7e882 it looks like you reverted the commit supporting gcc 4.8. ?

@SSE4
Copy link
Member

SSE4 commented Sep 20, 2018

@bashbug it was re-added after revert bincrafters/conan-protobuf@b03bfcf
please give an another try

@SSE4
Copy link
Member

SSE4 commented Sep 29, 2018

GCC 4.8 packages were added, closing

@SSE4 SSE4 closed this as completed Sep 29, 2018
@bashbug
Copy link
Author

bashbug commented Oct 17, 2018

@uilianries @SSE4 I'm very sorry for the late response. Thanks for adding gcc 4.8 support. Works!

While using the package I saw that https://bintray.com/bincrafters/public-conan/protoc_installer%3Abincrafters/3.6.1%3Astable gets also installed. Which means the protoc binary is available. Really useful would be to have protobuf_generate_cpp available, which is normally part of a protobuf installation https://github.com/protocolbuffers/protobuf/blob/master/cmake/protobuf-module.cmake.in

@SSE4
Copy link
Member

SSE4 commented Oct 17, 2018

@bashbug I am not sure I got the point, do you have more information on what is protobuf_generate_cpp, is it executable, library, header or what? we invoke install of protobuf, so it should have everything installed

@SSE4 SSE4 reopened this Oct 17, 2018
@bashbug
Copy link
Author

bashbug commented Oct 17, 2018

Sorry, I didn't want to re-open that issue! Was just a suggestion which came to my mind.

If you install protobuf https://github.com/protocolbuffers/protobuf/tree/master/cmake
When calling find_package(protobuf) in within a CMakeLists.txt
The protobuf-config.cmake is called and https://github.com/protocolbuffers/protobuf/blob/master/cmake/protobuf-config.cmake.in#L125 includes protobuf-module.cmake which provides the function protobuf_generate_cpp https://github.com/protocolbuffers/protobuf/blob/master/cmake/protobuf-module.cmake.in#L4

This function can then be used within your CMakeLists.txt to invoke the protoc executable to generate from *.proto file its *.pb.cc and *.pb.h files. This allows you to generate those files during build time with cmake.

@SSE4
Copy link
Member

SSE4 commented Oct 17, 2018

I think it's already available and used, e.g. take a look at our test_package implementation:
https://github.com/bincrafters/conan-protobuf/blob/stable/3.6.1/test_package/CMakeLists.txt#L29

@bashbug
Copy link
Author

bashbug commented Oct 17, 2018

I tried it protobuf_MODULE_COMPATIBLE is always false. Even without checking that, the function protobuf_generate_cpp is not defined.

I guess, the test you referring to is just skipped and the variables ${TEST_SRCS} ${TEST_PROTOS} are empty. I can not see from the test, that it actually tests if the protobuf_MODULE_COMPATIBLE is true and the files are really generated.

@SSE4
Copy link
Member

SSE4 commented Oct 17, 2018

seems like it's an optional feature of protobuf since 3.x version:
protocolbuffers/protobuf#1931
https://github.com/protocolbuffers/protobuf/blob/master/cmake/protobuf-options.cmake#L6
I think we may add corresponding option to the conan package with default false
does it work for your use-case?
P.S. as I understand, with protobuf 3.x it's no longer necessary to explicitly call protobuf_generate_cpp into your CMakeLists.txt, you may just add *.proto files to the sources, and it's enough

@bashbug
Copy link
Author

bashbug commented Oct 18, 2018

@SSE4 You my man! Thanks a lot for digging it out! The new function is called protobuf_generate as it is now part of the protobuf-config.cmake https://github.com/protocolbuffers/protobuf/blob/c7352b39f85e910c017a8b872a08be3bfb1f117f/cmake/protobuf-config.cmake.in#L10
I'm not really a cmake pro. It's interesting that find_package(protobuf) is not appending invoking the protobuf-config.cmake I have to explicitly call find_package(protobuf CONFIG). But now it works. Thanks for you help!

@SSE4
Copy link
Member

SSE4 commented Oct 18, 2018

anyway, I'll provide compatibility option just for the sanity

@bashbug
Copy link
Author

bashbug commented Oct 18, 2018

So sad, the new function protobuf_generate has a bug protocolbuffers/protobuf@3e84147 which seems to be still part of 3.6.1

@Croydon
Copy link
Member

Croydon commented Oct 31, 2018

Is this done? If not what is left to do?

@bashbug
Copy link
Author

bashbug commented Oct 31, 2018

From my side it is done.

@Croydon Croydon closed this as completed Oct 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement feedback Waiting for feedback from the original issue author. Gets closed after several weeks if no feedback
Projects
None yet
Development

No branches or pull requests

4 participants