-
Notifications
You must be signed in to change notification settings - Fork 126
Offline builds (reproducibility, security) #38
Comments
Sorry about this. I agree overall I need to beef up the docs here (see #33). Do you have an issue using Hunter or you just want to avoid a tool that isn't used in Postgres? |
jaeger-cpp defaults to using Hunter to download its dependencies off the 'net, even if they exist locally. This is convenient for development but not practical for some production environments. It also makes life hard for clients that want to link to jaeger-cpp since Hunter doesn't install those dependencies. It's necessary to also use Hunter in apps that use a jaeger-cpp built this way... and that's not always practical. Accordingly, add support for finding jaeger-cpp's dependencies via the normal CMake package discovery mechanism. A sligtly unsightly hack is required for nlohmann json, because its header moved from json.hpp to nlohmann/json.hpp in 2.1.0. This introduces support for building with cmake -DHUNTER_ENABLED=0 WIP: - Doesn't support building the tests yet so use -DBUILD_TESTING=0 - nothing packages nlohmann json 2.1.0 yet, 2.0.2 is widespread. but jaegertracing's code doesn't appear to support 2.0.2. For now you should work around it by installing 2.1.x locally from source. WIP for jaegertracing#38
I can't use Hunter. If I even try to suggest adding support for downloading random things off the Internet in the PostgreSQL build system I'll be run out of town. There's increasing work being done for reproducible builds, and offline builds are a hard non-negotiable requirement for many if not most PostgreSQL users and deployments. Package builders would have a heart attack; you're not likely to see the Jaeger cpp agent landing up in Fedora, Debian/Ubuntu, etc without an offline build that can use locally installed dependencies. Not to mention that it's autotools based still (alas), which probably makes using Hunter "fun" even if it were an option. I'm trying to do what I can with limited time because I'm really excited by what opentracing and jeager looks like it can offer. But I bet the great majority would've already gone "too hard basket". Maybe I'm just a reactionary old fogie, though, after all I work with a community that still requires Perl 5.8.8 support in its test harness 🤮. I wrote you a draft README anyway, to try to record what I've figured out so far or had pointed out to me on the chat channel. You'll see it on #33. The above separate commit ringerc@f6ebf97 adds support for local package finding using typical CMake find package modules. It's not quite there yet:
and the fact that
Haven't sent you a PR due to the above. |
@isaachier Forgot to @ mention you, see above |
Figured out what was wrong with the test builds, fixed. Now having difficulty because the source tree seems to contain generated files from Apache Thrift. But:
Without that I don't see how I can compile it. The specific error is:
and it's because my local Thrift is 0.9.1, but the Jaeger files were generated with 0.9.2. Where are the inputs for the Thrift generator? |
jaeger-cpp defaults to using Hunter to download its dependencies off the 'net, even if they exist locally. This is convenient for development but not practical for some production environments. It also makes life hard for clients that want to link to jaeger-cpp since Hunter doesn't install those dependencies. It's necessary to also use Hunter in apps that use a jaeger-cpp built this way... and that's not always practical. Accordingly, add support for finding jaeger-cpp's dependencies via the normal CMake package discovery mechanism. A sligtly unsightly hack is required for nlohmann json, because its header moved from json.hpp to nlohmann/json.hpp in 2.1.0. This introduces support for building with cmake -DHUNTER_ENABLED=0 WIP: - nothing packages nlohmann json 2.1.0 yet, 2.0.2 is widespread. but jaegertracing's code doesn't appear to support 2.0.2. For now you should work around it by installing 2.1.x locally from source. (no bug opened yet) - will fail to compile tests if the local thrift is 0.9.1 since there are committed generated files from 0.9.2 (jaegertracing#45) and there's no mechanism to regenerate them. This seeks to address the beginnings of jaegertracing#38.
jaeger-cpp defaults to using Hunter to download its dependencies off the 'net, even if they exist locally. This is convenient for development but not practical for some production environments. It also makes life hard for clients that want to link to jaeger-cpp since Hunter doesn't install those dependencies. It's necessary to also use Hunter in apps that use a jaeger-cpp built this way... and that's not always practical. Accordingly, add support for finding jaeger-cpp's dependencies via the normal CMake package discovery mechanism. A sligtly unsightly hack is required for nlohmann json, because its header moved from json.hpp to nlohmann/json.hpp in 2.1.0. This introduces support for building with cmake -DHUNTER_ENABLED=0 WIP: - nothing packages nlohmann json 2.1.0 yet, 2.0.2 is widespread. but jaegertracing's code doesn't appear to support 2.0.2. For now you should work around it by installing 2.1.x locally from source. (no bug opened yet) - will fail to compile tests if the local thrift is 0.9.1 since there are committed generated files from 0.9.2 (jaegertracing#45) and there's no mechanism to regenerate them. This seeks to address the beginnings of jaegertracing#38. Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
I can help with the non-Hunter build. Sorry you are having so many issues with that. |
jaeger-cpp defaults to using Hunter to download its dependencies off the 'net, even if they exist locally. This is convenient for development but not practical for some production environments. It also makes life hard for clients that want to link to jaeger-cpp since Hunter doesn't install those dependencies. It's necessary to also use Hunter in apps that use a jaeger-cpp built this way... and that's not always practical. Accordingly, add support for finding jaeger-cpp's dependencies via the normal CMake package discovery mechanism. A sligtly unsightly hack is required for nlohmann json, because its header moved from json.hpp to nlohmann/json.hpp in 2.1.0. This introduces support for building with cmake -DHUNTER_ENABLED=0 WIP: - nothing packages nlohmann json 2.1.0 yet, 2.0.2 is widespread. but jaegertracing's code doesn't appear to support 2.0.2. For now you should work around it by installing 2.1.x locally from source. (no bug opened yet) - will fail to compile tests if the local thrift is 0.9.1 since there are committed generated files from 0.9.2 (jaegertracing#45) and there's no mechanism to regenerate them. This seeks to address the beginnings of jaegertracing#38. Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
jaeger-cpp defaults to using Hunter to download its dependencies off the 'net, even if they exist locally. This is convenient for development but not practical for some production environments. It also makes life hard for clients that want to link to jaeger-cpp since Hunter doesn't install those dependencies. It's necessary to also use Hunter in apps that use a jaeger-cpp built this way... and that's not always practical. Accordingly, add support for finding jaeger-cpp's dependencies via the normal CMake package discovery mechanism. A sligtly unsightly hack is required for nlohmann json, because its header moved from json.hpp to nlohmann/json.hpp in 2.1.0. This introduces support for building with cmake -DHUNTER_ENABLED=0 WIP: - nothing packages nlohmann json 2.1.0 yet, 2.0.2 is widespread. but jaegertracing's code doesn't appear to support 2.0.2. For now you should work around it by installing 2.1.x locally from source. (jaegertracing#47) - will fail to compile tests if the local thrift is 0.9.1 since there are committed generated files from 0.9.2 (jaegertracing#45) and there's no mechanism to regenerate them. This seeks to address the beginnings of jaegertracing#38. Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Add support for finding jaeger-cpp's dependencies via the normal local CMake package discovery mechanism of Find modules. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Add support for finding jaeger-cpp's dependencies via the normal local CMake package discovery mechanism of Find modules. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Restructure the build system to follow CMake conventions: use import libraries consistently, separate CMakeLists.txt for targets, etc. Add Find packages to discover local dependencies not already supported by CMake natively. These are used when Hunter is disabled to allow jaeger cpp-client to use locally installed libraries. This is a preliminary step in splitting the test sources out of the library. Improves jaegertracing#38 Offline builds This introduces support for building with cmake -DHUNTER_ENABLED=0 Limitations for local dependency builds: - Requires a locally installed Thrift 0.9.2 or 0.9.3 EXACTLY, not newer or older. These versions are not widely packaged so a local install is necessary. (jaegertracing#45) - Requires nlohmann json 2.1.0 or newer, which is not widely packaged in Linux distros. Install a local copy. (jaegertracing#47) Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <craig@2ndquadrant.com>
I'm looking into building the jaeger-client-cpp in an air gap system, do you have some documentation around this point? are you planning on merging your fork into upstream? I can try to vendor Hunter dependencies, but not really elegant. |
I do owe this repo more documentation, although I have plans for an overhaul of this project soon. As of now, there are no plans to merge @ringerc's work upstream (it would be outdated by now anyway). He has helped me recognize this issue, and I appreciate the effort, but it won't be possible right now. Regarding your issues building, I believe this is better addressed in the Hunter documentation. Look at the Sorry about the lack of documentation and I hope this helps you. |
I wrote some docs on it, and some patches, but they aren't merged and I can't maintain them if they won't be merged upstream. The case for merging them is weakened by the fact that:
so it's not worth it. Instead you might want to look at using the opentracing-c++ API and its dynamic loading support, then load a jaeger-cpp that's been compiled to statically link the needed libs, so it's just a simple .so . So long as the C++ ABI is compatible you will be fine. It's totally unacceptable for distribution packaging, and really bad for continuous integration workflows, reproducible builds, etc, but it'll likely meet your needs. When I get the chance to resume this, I'll be adding a C-adapter over the opentracing c++ API, and using its dynloader. But I'm waiting on a patch for opentracing c++ API to make span contexts copyable; see opentracing/opentracing-cpp#74 . And I have no time presently due to Other Work Stuff. So I don't plan on working further on making jaeger-cpp offline-buildable, reproducible-buildable, or able to use distro dependencies. Someone else can if they want, but I don't think it's viable unless the Thrift bug is fixed at least. (Even if you changed Jaeger to apply a patch on top of the generated output, the patch has to differ depending on the underlying Thrift version, so you don't gain much). This isn't any complaint at @isaachier btw, they've been super helpful and given their time on things that aren't really their own priorities to help me out. Including even working on a c-client. It's just how it is. I don't see any good answers without major changes including to Jaeger IDL etc. I haven't closed the issue, but it might as well be. |
Jaeger's c++ bindings seem to leap out to the Internet to build private copies of build dependencies like Boost.
A bit of reading of the build code shows that
is sufficient to suppress this behaviour, at which point you can configure it with local dependencies. It'd be nice if this were in the
README.md
.I got partway with:
then building the opentracing C++ API from https://github.com/opentracing/opentracing-cpp and installing that first.
It still gets stuck on the rpm packaging for json-devel (nlohmann) since there's no bundled nlohmann_jsonConfig.cmake . Seems it doesn't know how to do discovery for that, I'll see if I can add it. Same with the yaml libraries.
But even when I make configs fro nlohmann and json-devel and then
it still fails with
It could be related to version, but the CMake code doesn't do any tests for required versions and there's no documentation on required verisons, so I'm struggling to know what's required. I have:
Anyway, it'd be nice to document the dependencies and that building without "grab it all from the Internet" is supported in the README.md.
I'll experiment with it for now by letting Hunter do its thing, but I really don't want to do things like build Boost all the time...
The text was updated successfully, but these errors were encountered: