Closed robinlinden closed 3 years ago
this is interesting! I wasn't aware of https://conan.io/ and https://conan.io/center/
so just to understand the motivation of adding conan to the ci: this is to get easy access to autobahncpp dependencies for building tests during a ci run, right? conan is not for releasing autobahncpp itself, since obviously autobahncpp is a header only, heavily templated library which needs to be compiled together with an app with no separate binary package ..
which is cool of course .. seems like conan is a new thing that has gained wide use in no time in the c++ communities
ok, had a look at openssl and boost on conan center .. not sure I understand: boost is mostly headers only. right, there are some binary shared libs being built as well, and for those I would understand a binary package distribution site. however, there is a "headers only confiuration" as well :
similar for websocketpp ... which is pure headers-only .. how does this work? why a binary pkgs site for a headers only lib?
Yeah, the motivation for this is to be able to build and test autobahn_cpp without installing system dependencies or manually trying to build the dependencies (not trivial for e.g. libc++ clang boost or openssl for VC++). You could also use it to push autobahn_cpp to conan if you wanted, but that's just an extra and not something I was thinking about. :P It would let users depend on autobahn_cpp by just adding one line in their conanfile.txt and letting conan find and download everything we depend on here.
Boost can be used as both header-only or linked against, depending on which subset of it you're using. Most recipes on there have some options that allow you to specify what you want. E.g. websocketpp allows you to pick between standalone asio or boost asio: https://github.com/conan-io/conan-center-index/blob/master/recipes/websocketpp/all/conanfile.py#L22-L28
The reason some header-only libraries are on there is to allow you to pull in their dependencies at the same time by letting conan handle the transitive dependencies. You can't use websocketpp without also depending on openssl, zlib, and either asio or boost, and conan handles that for you (see https://github.com/conan-io/conan-center-index/blob/master/recipes/websocketpp/all/conanfile.py#L22-L28 again)
Edit: If the dependencies don't exist pushed to conan-center, the recipes for the library contain instructions for building them too, so when I run conan install on e.g. an old boost version with a clang libc++ profile, it downloads the sources and sets up a b2 build for me, so I don't have to debug why it doesn't find my system libraries. :D Very convenient.
It would let users depend on autobahn_cpp by just adding one line in their conanfile.txt and letting conan find and download everything we depend on here. ... The reason some header-only libraries are on there is to allow you to pull in their dependencies at the same time by letting conan handle the transitive dependencies.
ok, yeah, that makes sense!
IOW: once a header-only lib has (optional) binary deps in its transitive set of deps, it makes sense to put it on conan.
so lets publish autobahn-cpp to conan https://conan.io/center/. seems like we need to "Join the Early Access Program" https://github.com/conan-io/conan-center-index/blob/master/docs/how_to_add_packages.md and then
mmh. no clue=) would https://github.com/conan-io/conan-center-index/tree/master/recipes/websocketpp be a good example to look at / steal from for what we need with autobahn?
This is mainly in preparation of the Windows CI (and to make building and testing autobahn_cpp on systems without everything installed more convenient).
Usage:
If you don't already have conan installed and set up, you can do so by doing