smyte / ratelimit

Smyte's high-performance rate limiter
Other
267 stars 25 forks source link

Compilation errors in Ubuntu 16.04 #4

Open ghost opened 7 years ago

ghost commented 7 years ago

Installed a fresh version of Ubuntu 16.04 and the project build fails with:

ERROR: /home/ubuntu/Desktop/smyte-db/ratelimit/BUILD:1:1: C++ compilation of rule '//ratelimit:ratelimit' failed: Process exited with status 1 [sandboxed].
ratelimit/RateLimitServer.cpp:9:68: error: 'OptionalComponents' in 'class pipeline::RedisPipelineBootstrap' does not name a type
   redisHandlerFactory : [](const pipeline::RedisPipelineBootstrap::OptionalComponents& optionalComponents) {
                                                                    ^
ratelimit/RateLimitServer.cpp:15:3: error: 'kafkaTailerFactoryMap' has not been declared
   kafkaTailerFactoryMap : {},
   ^
ratelimit/RateLimitServer.cpp:15:25: error: expected ',' or '...' before ':' token
   kafkaTailerFactoryMap : {},
                         ^
ratelimit/RateLimitServer.cpp:26:1: error: expected ')' before '}' token
 };
 ^
ratelimit/RateLimitServer.cpp: In lambda function:
ratelimit/RateLimitServer.cpp:26:1: error: expected '{' before '}' token
ratelimit/RateLimitServer.cpp: At global scope:
ratelimit/RateLimitServer.cpp:26:1: error: invalid user-defined conversion from 'ratelimit::<lambda(int, int)>' to 'pipeline::RedisPipelineBootstrap::RedisHandlerFactory {aka std::shared_ptr<pipeline::RedisHandler> (*)(pipeline::RedisPipelineBootstrap*)}' [-fpermissive]
ratelimit/RateLimitServer.cpp:26:1: note: candidate is: ratelimit::<lambda(int, int)>::operator void (*)(int, int)() const <near match>
ratelimit/RateLimitServer.cpp:26:1: note:   no known conversion from 'void (*)(int, int)' to 'pipeline::RedisPipelineBootstrap::RedisHandlerFactory {aka std::shared_ptr<pipeline::RedisHandler> (*)(pipeline::RedisPipelineBootstrap*)}'
In file included from ratelimit/RateLimitServer.cpp:3:0:
./pipeline/RedisPipelineBootstrap.h:113:5: note:   initializing argument 1 of 'pipeline::RedisPipelineBootstrap::Config::Config(pipeline::RedisPipelineBootstrap::RedisHandlerFactory, pipeline::RedisPipelineBootstrap::KafkaConsumerFactoryMap, pipeline::RedisPipelineBootstrap::DatabaseManagerFactory, pipeline::RedisPipelineBootstrap::ScheduledTaskProcessorFactory, pipeline::RedisPipelineBootstrap::RocksDbConfiguratorMap, bool)'
     Config(RedisHandlerFactory _redisHandlerFactory,
     ^
Use --strategy=CppCompile=standalone to disable sandboxing for the failing actions.
Target //ratelimit:ratelimit failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 787.023s, Critical Path: 595.89s

Wrong cpp version? Any ideas?

Thanks!

yunjing commented 7 years ago

Does your compiler support c++14? What version of gcc do you use?

ghost commented 7 years ago

It does support c++14, I'm using:

gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

yunjing commented 7 years ago

Thanks for reporting. We have fixed the compilation issues. Please pull both smyte-db and ratelimit and see if it works now. Note that we now require bazel 0.4.5 and you probably need to run bazel clean before building.