Skip to content
This repository has been archived by the owner on Aug 30, 2022. It is now read-only.

Remove Thrift headers from Jaeger public headers #121

Closed
sebastian-garofalo opened this issue Aug 6, 2018 · 6 comments
Closed

Remove Thrift headers from Jaeger public headers #121

sebastian-garofalo opened this issue Aug 6, 2018 · 6 comments

Comments

@sebastian-garofalo
Copy link

Hi

The example app works, although one of the unit tests fails, but then when I try to use the library in my projects I get the following error.

In file included from /usr/local/include/jaegertracing/Tag.h:20:0,
                 from /usr/local/include/jaegertracing/LogRecord.h:20,
                 from /usr/local/include/jaegertracing/Span.h:26,
                 from /usr/local/include/jaegertracing/UDPTransport.h:20,
                 from /usr/local/include/jaegertracing/reporters/Config.h:25,
                 from /usr/local/include/jaegertracing/Config.h:23,
                 from /usr/local/include/jaegertracing/Tracer.h:28,
                 from followersServer.cc:11:
/usr/local/include/jaegertracing/thrift-gen/jaeger_types.h:12:27: fatal error: thrift/Thrift.h: No such file or directory
compilation terminated.

So I tried to update the thrift submodule as you mention in the README but doesn't seems to be working fine, I get:

sgarofalo@AR-IT08661:~/dev/jaeger-client-cpp$ find idl/thrift/ -type f -name \*.thrift -exec thrift -gen cpp -out src/jaegertracing/thrift-gen {} \;
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/jaeger.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/zipkincore.thrift:19] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/agent.thrift:21] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/aggregation_validator.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/baggage.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/crossdock/tracetest.thrift:18] No generator named 'netcore' could be found!
[ERROR:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/crossdock/tracetest.thrift:28] (last token was 'Downstream')
Type "Downstream" has not been defined.
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/dependency.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/jaeger.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/sampling.thrift:18] No generator named 'netcore' could be found!
[WARNING:/home/sgarofalo/dev/jaeger-client-cpp/idl/thrift/zipkincore.thrift:19] No generator named 'netcore' could be found!
sgarofalo@AR-IT08661:~/dev/jaeger-client-cpp$ git apply scripts/thrift-gen.patch
error: patch failed: src/jaegertracing/thrift-gen/tracetest_types.cpp:60
error: src/jaegertracing/thrift-gen/tracetest_types.cpp: patch does not apply
error: patch failed: src/jaegertracing/thrift-gen/tracetest_types.h:61
error: src/jaegertracing/thrift-gen/tracetest_types.h: patch does not apply

And the original error is still present.
Does anyone knows what is going on and how can I solve it?

Thanks

@isaachier
Copy link
Contributor

isaachier commented Aug 6, 2018

@sebastian-garofalo the main issue here is that thrift/Thrift.h is missing, and that is part of the core thrift C++ library. Please make sure you have installed the dependencies and try again. Do not use the patch and/or regenerate the files for now.

@sebastian-garofalo
Copy link
Author

After installing thrift it got solved, weird that the example app didn't need it. Thanks

@rnburn
Copy link
Contributor

rnburn commented Aug 7, 2018

@isaachier - if you use hunter to install thrift, those headers aren't going to be available in the regularly searched include paths.

is it possible to not include any of the thrift dependencies in jaeger's public headers?

@isaachier
Copy link
Contributor

isaachier commented Aug 7, 2018

@rnburn if that were true, Travis would have had compilation failures. Hunter manipulates the search path to include the dependency on Thrift. As an aside, I could potentially limit Thrift headers to implementation files, but it might be a big rewrite. Not sure if it makes sense when the dependency on the Thrift library would still be necessary.

@rnburn
Copy link
Contributor

rnburn commented Aug 7, 2018

@isaachier - you statically link everything into the jaeger library, so you don't need thrift after building jaeger.

Lots of people don't use cmake to build their projects. In that case, the hunter include directories wouldn't be searched unless they explicitly add flags for them to their build system.

But given that they're not needed outside the implementation files, why include them? if nothing else, it's going to make compilation slower to add unnecessary header files like that.

@isaachier
Copy link
Contributor

Right I agree that might be a solvable issue. Will reopen and retitle this issue.

@isaachier isaachier reopened this Aug 7, 2018
@isaachier isaachier changed the title Thrift missing files Remove Thrift headers from Jaeger public headers Aug 7, 2018
BeDeBaMu added a commit to BeDeBaMu/jaeger-client-cpp that referenced this issue Sep 16, 2019
Adresses jaegertracing#121
so that thrift is a private dependency of jaeger.

Signed-off-by: Benoit De Backer <[email protected]>
yurishkuro pushed a commit that referenced this issue Sep 25, 2019
Adresses #121
so that thrift is a private dependency of jaeger.

Signed-off-by: Benoit De Backer <[email protected]>
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

4 participants