-
Notifications
You must be signed in to change notification settings - Fork 126
Thrift IDL not in main repository, no build support #45
Comments
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 <[email protected]>
OK so the Thrift schema files are shared among many language bindings. Hence, they are actually in a submodule |
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 <[email protected]>
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 <[email protected]>
@isaachier Aah, that's |
For other readers that means
then you'll find that Surprising it's in Will look at plugging it into the cmake build later, out of time now. |
I don't think you need to plug in to build at all (I didn't for a reason). Just regenerate a move to your thrift-gen directory. |
On 29 January 2018 at 02:47, isaachier ***@***.***> wrote:
I don't think you need to plug in to build at all (I didn't for a reason).
Just regenerate a move to your thrift-gen directory.
That's fine for an ad-hoc local build. But for packaging and deployment it
should be done the same way every time, in the CMakeFile. Ideally the
generated sources shouldn't be in git at all, just the IDL to produce them,
but that's not so practical when the IDL is in another module.
It's also not user friendly to have to manually fetch some IDL, generate
some sources, move them across, etc when you do a build. Especially if
undocumented. The more of these sorts of corner cases there are the harder
it is to get someone to use a tool, contribute to it, etc.
Consider a typical workflow like this:
- Fetch commit from git, with any submodules
- "make dist" a tarball and gpg sign it, annotating it with the commit id
or tag
- (offline) generate srpm with .spec file and sources
- (offline) build the srpm on target platforms, using local repositories of
signed RPMs for dependencies
- (offline) sign the rpms
- Push resulting .rpm and debuginfo into repository for testing
- Run smoketests in CI
- Push resulting rpms to public repository for use by other
builds/tools/users
"make dist" needs to know how to generate the IDL. For users to be able to
compile the software the way they'd usually expect to, so does "make".
A CMake check for Thrift >= 0.9.2 would ensure there's a useful error, at
least. And while I'm prototyping I can do all this stuff manually. But for
deployment in core infrastructure in organisations that have regulatory
requirements to satisfy or aren't ready to jump fully on the container
bandwagon yet, that's not going to work out.
Per my comment on the other open issue, I guess it's a target audience /
dev style thing. What's your target audience, and do you want to deal with
users who can't chase the bleeding edge and do everything online?
I'd argue you should, but I obviously have a vested interest. But also,
don't you want to be able to see full request lifecycles including things
like where they spent time waiting on locks in the DB, what request
latencies were like, etc? 'cos those projects work a bit more
conservatively.
…--
Craig Ringer http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
|
Regarding the Thrift sources, the idl directory should never have to be used. The fact that we use Thrift 0.9.2 does force users of more recent versions to manually generate the idl files. If they had the "right" version, they wouldn't need to know about it. The target audience is a good question and followed up there |
I just tried to build with the latest Thrift in Rawhide
and it fails too:
since it looks like the Thrift folks renamed the member. So it appears that jaeger cpp-client probably currently works with thrift I strongly argue that committing generated files from IDL is bad practice, especially where the result of code-generation from the IDL doesn't follow a strong specification and isn't guaranteed to be compatible across versions. It doesn't look to me like Thrift generated code is meant to be used with a different library version. It'd be better to generate the code from the IDL, per something like https://github.com/snikulov/cmake-modules/blob/master/FindThrift.cmake / https://github.com/apache/parquet-cpp/blob/master/cmake_modules/FindThrift.cmake where a |
Ok, Thrift installed with
|
@isaachier I did a manual rebuild of the IDL with the existing Thrift 0.9.2, to see if I could reproduce the current sources. I'm then going to go on to make sure it works with any suitable Thrift. But the generated sources do not match what's in the Jaeger The diff can be seen in ringerc@819eff4 ; I pushed a branch with it for convenient viewing. Were these changes made locally by hand? I'm using the same Thrift version as the IDL scripts use, and the Makefile in idl/ doesn't pass extra arguments. Looking at the diff I'm inclined to think "local changes" ? |
Causes build failures:
which looks to be down to
If I try building with Thrift 0.9.1, thrift generation fails with
so it looks like Thrift is having issues with a self-reference of some sort. If the IDL cannot be regenerated it'll be hard to keep up with changes to the protocol. BTW, shouldn't the IDL be part of the opentracing project? Or am I missing how all this works? |
Same issue if I use Thrift 0.10.0
|
Zipkin isn't used in C++ client. The tracetest changes are indeed a real issue and one reason I cannot foresee making the Thrift generation part of the standard build. See this issue and ensuing discussion: jaegertracing/jaeger-idl#35. I had to painstakingly fix the generated code by hand to avoid a serious issue in the schema definition. |
@isaachier Thanks for the reference, I never would've found that. Seems like a horrible decision in Thrift about how to translate the IDL to C++.
The tests they added in apache/thrift#84 cover various self-referential forms other than optional self-inclusion. Looking for a Thrift bug. Seems like it'd be hard to fix this without changing the opentracing IDL. But maybe that's what should happen. |
Didn't find a Thrift bug so created https://issues.apache.org/jira/browse/THRIFT-4484 |
"one of" the reasons? Other known issues? |
Add support for finding jaeger-cpp's dependencies via the normal local CMake package discovery mechanism of Find modules. 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 <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
This IDL is fine for languages where everything is by-reference. But for C++, it tries to embed a class by-value into its self, which cannot succeed, and results in compilation failure. See jaegertracing#35 This has been worked around by patching the IDL-generated code; see jaegertracing/jaeger-client-cpp#45 . It turns out we can just tell Thrift to include the optional member by-reference. See the comment in https://issues.apache.org/jira/browse/THRIFT-4484 about `cpp.ref`. Apparently that's now spelled `&` in Thrift IDL. I don't know what effect it has for other languages, the documentation is sparse at best, and doesn't mention this at all. If this doesn't break other languages I think it's the correct fix for the IDL.
@isaachier I think I found a fix for the IDL issue; ringerc/jaeger-idl#1 . |
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
I'm abandoning making it work on different Thrift versions for now. Thrift 0.11.0 and newwer build with This goes in the too-hard basket at this point, given that the IDL is also busted per jaegertracing/jaeger-idl#35 and even Thrift 0.11.0 generates bad code for the fix using by-reference inclusion. I'll push a branch with my WIP, but unless someone has more time/care than me, it looks like the dependency on 0.9.2-0.9.3 stays. |
This is a C++11 codebase so it can rely on std::shared_ptr. std::shared_ptr handles incomplete types correctly, unlike boost::shared_ptr. This helps when building against newer versions of Thrift. FIXME: This only works for, and is required for, Thrift 0.11.0 and newer built without -DFORCE_BOOST_SMART_PTR. Older Thrift requires boost::shared_ptr. So we have to use namespace hacks like Thrift's lib/cpp/src/thrift/stdcxx.h does to support both. This is WIP for jaegertracing#45 Signed-off-by: Craig Ringer <[email protected]>
Build Crossdock support into the UnitTest executable not the library, and only build it when JAEGERTRACING_BUILD_CROSSDOCK is set. In addition to shrinking the library this lets us drop the exact Thrift 0.9.2 or 0.9.3 requirement when not building with Crossdock. The IDL bug / Thrift bug discussed in jaegertracing#45 only affects the IDL used with Crossdock testing. Or at least, it would let us drop the Thrift requirement if not for the problems with std::shared_ptr vs boost::shared_ptr. Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
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 <[email protected]>
Improves jaegertracing#33 Documents jaegertracing#38, jaegertracing#45, jaegertracing#47, jaegertracing#51 Signed-off-by: Craig Ringer <[email protected]>
We need a newer Thrift to support hosts with openssl 1.1. Since Jaeger its self requires a c++11 compiler and nlohmann-json requires at least g++ 4.9, supporting newer dependencies makes sense. But Thrift 0.9.2 didn't support openssl 1.1. This is some pretty brutal surgery: - Remove crossdock and zipkin support entirely. The IDL is broken for C++ / Thrift generates bad code for it. See jaegertracing/jaeger-idl#35, https://issues.apache.org/jira/browse/THRIFT-4484 jaegertracing#45 - Adapt Thrift's namespace-aliasing approach to support Thrift built with use of std::smart_ptr or boost::smart_ptr; Thrift switched to std::smart_ptr in later versions but retains boost::smart_ptr for BC. - Regenerate IDL with Thrift 0.11.0 and commit in-tree. Unsure if Hunter still works; may need to package Thrift 0.11.0 Haven't tested with a Thrift configured with Boost smart pointers. Don't do that. The wholesale removal of zipkin and crossdock support means this is unlikely to be committable to mainline. Hopefully Thrift will fix their codegen. If not, well, we're probably going to throw Thrift out entirely soon.
Resolved in latest release with #94. |
This still requires a patch file to be applied by the build on top of the generated Thrift IDL right? A patch that's probably specific to the Thrift version used? Not a complaint in any way, just for clarity in terms of how it's resolved. |
In the jaeger cpp-client source dir:
and a
git grep emitZipkinBatch
finds only generated output from Thrift + references inUDPClient.h
,UDPClientTest.cpp
, andMockAgent.h
.Where are the Thrift sources to re-generate what's in
thrift-gen
?It's necessary for #38 to work since the local Thrift may not be the same version as the Thrift compiler used to check in the sources. Plus it's not great to carry generated sources in git when you can avoid it.
The text was updated successfully, but these errors were encountered: