Skip to content
This repository has been archived by the owner on May 2, 2021. It is now read-only.

I have packaged current version 1.28.1 drawing inspiration from this recipe #37

Closed
0x8000-0000 opened this issue May 3, 2020 · 9 comments

Comments

@0x8000-0000
Copy link

I have packaged current version of grpc at https://github.com/0x8000-0000/conan-recipes, tested on Linux only. This is my first effort at packaging, so feedback is welcome. I have taken a different approach of handling the 3rd party dependencies, so I don't know how to make a pull request to suggest and update to your package - but if you want to borrow my implementation, please go ahead.

I haven't tried it on Windows yet, or tried anything more strenuous than run the greeter example.

@IceflowRE
Copy link

Why don't you use the abseil recipe from conan-center? Same with the protobuff package (it has an option to build the protoc binaries, but no idea if it is suitable).

The protoc_installer and grpc recipes are throwing some warnings regarding to the conan-center error knowledge. More information here, at the very bottom it is described how to enable the hooks, which warn you about those errors)

Anyway the package creation works on windows and the package layout looks clean. (But i didn't took an in-depth look)
If you tweak the grpc package you may/can push it to conan-center too?

@0x8000-0000
Copy link
Author

Why don't you use the abseil recipe from conan-center?

I have tried to stick very close to the 3rd party dependencies of the v1.28.1 of gRPC:

  • abseil 20200225
  • protobuf v3.11.2

The abseil recipe from conan-center is older and from the master branch. The version I packaged is from the Long-Term Support branch which contains the tag above.

Same with the protobuff package (it has an option to build the protoc binaries, but no idea if it is suitable).

I am actually using the protobuf package from conan-center (v3.11.4), but not the protoc_installer because it is only available at version v3.9.1, and the code it generates is not compatible with the protobuf library v3.11.4 .

The protoc_installer and grpc recipes are throwing some warnings regarding to the conan-center error knowledge. More information here, at the very bottom it is described how to enable the hooks, which warn you about those errors)

Anyway the package creation works on windows and the package layout looks clean. (But i didn't took an in-depth look)
If you tweak the grpc package you may/can push it to conan-center too?

Thank you for the quick check. I will try to submit a pull request to conan-io center. It will contain three commits, one for each package.

I am probably tripping the fPIC and test_package rules.

@Croydon
Copy link
Collaborator

Croydon commented May 4, 2020

grpc can't be moved to CCI as long as (at the very least) conan-io/conan-center-index#1179 isn't resolved, then it is the obvious goal

@Croydon
Copy link
Collaborator

Croydon commented May 4, 2020

@0x8000-0000 Which advantages does your recipes have over the current variant here?

@0x8000-0000
Copy link
Author

@0x8000-0000 Which advantages does your recipes have over the current variant here?

Hi @Croydon ,

Functionally, it packages the latest version of gRPC, and uses more recent version of protobuf. Don't know if I would be missing anything going with the older versions, but I'm starting a new project and I would like to be as current as possible.

Implementation-wise, I decided to scrap playing with the gRPC configuration of package vs module and trying to trick the package to accept protobuf from Conan (with my current version of CMake, it was trying to use the CMake bundled FindProtobuf.cmake, which was failing to find protobuf/protoc installed at the OS level). So I am no longer including abseil-cpp.cmake, cares.cmake, protobuf.cmake but I'm letting the variables from conanbuildinfo.cmake provide what's needed.

I am disclaiming any in-depth knowledge of Conan packaging... I first started using it last week, and one colleague needed gRPC. I did the customary Internet search, found a few attempts - and none seemed satisfactory enough, so I "wasted" my weekend making a package. I am hoping I haven't strayed too far from 'idiomatic Conan', or that some of this can be reused for the official packages.

As I acknowledged in my Readme, my version of the packages are based on existing upstream packages with tweaks determined through trial and error and lots of frustration. All mistakes are mine.

@Croydon
Copy link
Collaborator

Croydon commented May 4, 2020

The abseil recipe from conan-center is older and from the master branch. The version I packaged is from the Long-Term Support branch which contains the tag above.

Contributions to add a newer version are very welcome.
You are right that for 1.28.0 we require (or at least should use) a 20200225 version

We can't package branches, as those are a moving target. For projects without real versions, we use date based versions which use a commit from the default branch.

https://github.com/abseil/abseil-cpp/tree/b832dce8489ef7b6231384909fd9b68d5a5ff2b7 is what grpc uses in v1.28.1

https://github.com/abseil/abseil-cpp/tree/b832dce8489ef7b6231384909fd9b68d5a5ff2b7 mentions GitOrigin-RevId: 0033c9e, so from my understanding packaging abseil/abseil-cpp@0033c9e as 20200225 and using it for grpc should be just fine

Would you be willing to contribute this version to CCI?

@0x8000-0000
Copy link
Author

The abseil recipe from conan-center is older and from the master branch. The version I packaged is from the Long-Term Support branch which contains the tag above.

Contributions to add a newer version are very welcome.
You are right that for 1.28.0 we require (or at least should use) a 20200225 version

We can't package branches, as those are a moving target. For projects without real versions, we use date based versions which use a commit from the default branch.

https://github.com/abseil/abseil-cpp/tree/b832dce8489ef7b6231384909fd9b68d5a5ff2b7 is what grpc uses in v1.28.1

https://github.com/abseil/abseil-cpp/tree/b832dce8489ef7b6231384909fd9b68d5a5ff2b7 mentions GitOrigin-RevId: 0033c9e, so from my understanding packaging abseil/abseil-cpp@0033c9e as 20200225 and using it for grpc should be just fine

grpc 1.28.1 says this in .gitmodules:

[submodule "third_party/abseil-cpp"]
        path = third_party/abseil-cpp
        url = https://github.com/abseil/abseil-cpp.git
        branch = lts_2020_02_25

Then if we look in abseil-cpp:

~/libraries/abseil-cpp$ git tag -l
20180600
20181200
20190808
20200225
20200225.1
20200225.2
~/libraries/abseil-cpp$ git branch -r --contains 20200225
  origin/lts_2020_02_25
~/libraries/abseil-cpp$ git branch -r --contains 20200225.1
  origin/lts_2020_02_25
~/libraries/abseil-cpp$ git branch -r --contains 20200225.2  
  origin/lts_2020_02_25

So all three lts_ tags are from the 'lts_2020_02_05' branch. We can package tags, and this is what I've did: just packaged the latest tag on the branch.

Would you be willing to contribute this version to CCI?

With great pleasure. I'll submit a pull request in the next couple of days.

Then I'll go wait for a recent protobuf/protoc package :)

@0x8000-0000
Copy link
Author

This was easy: conan-io/conan-center-index#1523

@Croydon
Copy link
Collaborator

Croydon commented May 1, 2021

This recipe is now in the Conan Center Index.

Please migrate to the recipe version there.
If this is still an issue, please create a new issue in the Conan Center Index issue tracker.

Thanks!

https://conan.io/center/grpc

@Croydon Croydon closed this as completed May 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants