facebookarchive/LogDevice

Can not build on Ubuntu 19.10

aliher1911 opened this issue · 3 comments

I'm trying to build logdevice on ubuntu 19.10 following instructions on logdevice.io and I found a couple of issues. Any hints on what I'm doing wrong and how other ppl manage to do it? To make it behave a bit closer to Ubuntu 18 I tried to switch compilers to gcc-7/8/clang but to no avail.

  • Issue 1: when compiling thrift it fails because of underlying folly issue with SDT tracepoints. That could be worked around by disabling tracepoints with flags on fbthrift (-DFOLLY_DISABLE_SDT in build-fbthrift.cmake) or by patching folly (facebook/folly#1396).
  • Issue 2: thrift target in cmake omits -fPIC option and that breaks building shared libs, worked around with add_compile_options(-fPIC) to admin/if/CMakeLists.txt and admin/if/for_open_source.

Am I doing something wrong?

Hi @aliher1911, I wonder if you can try building it using the latest documentation from master (https://logdevice.io/docs/next/Installation.html) instead of the default one and letting us know if you're still facing the same issue?

I just tried and getting the same error which is issue 1:
/usr/bin/c++ -fPIC -std=gnu++17 -shared -Wl,-soname,libthriftcpp2.so -o ../../../lib/libthriftcpp2.so CMakeFiles/thriftcpp2.dir/FrozenTApplicationExc eption.cpp.o CMakeFiles/thriftcpp2.dir/GeneratedCodeHelper.cpp.o CMakeFiles/thriftcpp2.dir/async/AsyncClient.cpp.o CMakeFiles/thriftcpp2.dir/async/Asyn cProcessor.cpp.o CMakeFiles/thriftcpp2.dir/async/ClientSinkBridge.cpp.o CMakeFiles/thriftcpp2.dir/async/ClientStreamBridge.cpp.o CMakeFiles/thriftcpp2. dir/async/Cpp2Channel.cpp.o CMakeFiles/thriftcpp2.dir/async/DuplexChannel.cpp.o CMakeFiles/thriftcpp2.dir/async/FramingHandler.cpp.o CMakeFiles/thriftc pp2.dir/async/HeaderChannel.cpp.o CMakeFiles/thriftcpp2.dir/async/HeaderChannelTrait.cpp.o CMakeFiles/thriftcpp2.dir/async/HeaderClientChannel.cpp.o CM akeFiles/thriftcpp2.dir/async/HeaderServerChannel.cpp.o CMakeFiles/thriftcpp2.dir/async/RequestChannel.cpp.o CMakeFiles/thriftcpp2.dir/async/ResponseCh annel.cpp.o CMakeFiles/thriftcpp2.dir/async/RocketClientChannel.cpp.o CMakeFiles/thriftcpp2.dir/async/RpcTypes.cpp.o CMakeFiles/thriftcpp2.dir/async/Se rverGeneratorStream.cpp.o CMakeFiles/thriftcpp2.dir/async/ServerSinkBridge.cpp.o CMakeFiles/thriftcpp2.dir/security/extensions/ThriftParametersClientEx tension.cpp.o CMakeFiles/thriftcpp2.dir/security/extensions/ThriftParametersContext.cpp.o CMakeFiles/thriftcpp2.dir/security/extensions/Types.cpp.o CMa keFiles/thriftcpp2.dir/server/RequestDebugLog.cpp.o CMakeFiles/thriftcpp2.dir/server/RequestsRegistry.cpp.o CMakeFiles/thriftcpp2.dir/server/BaseThrift Server.cpp.o CMakeFiles/thriftcpp2.dir/server/Cpp2ConnContext.cpp.o CMakeFiles/thriftcpp2.dir/server/Cpp2Connection.cpp.o CMakeFiles/thriftcpp2.dir/ser ver/Cpp2Worker.cpp.o CMakeFiles/thriftcpp2.dir/server/ServerInstrumentation.cpp.o CMakeFiles/thriftcpp2.dir/server/ThriftServer.cpp.o CMakeFiles/thriftcpp2.dir/server/peeking/TLSHelper.cpp.o CMakeFiles/thriftcpp2.dir/transport/core/RpcMetadataUtil.cpp.o CMakeFiles/thriftcpp2.dir/transport/core/ThriftProcessor.cpp.o CMakeFiles/thriftcpp2.dir/transport/core/ThriftRequest.cpp.o CMakeFiles/thriftcpp2.dir/transport/core/ThriftClient.cpp.o CMakeFiles/thriftcpp2.dir/transport/core/ThriftClientCallback.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/PayloadUtils.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/Types.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/client/RequestContext.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/client/RequestContextQueue.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/client/RocketClient.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/client/RocketStreamServerCallback.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/framing/ErrorCode.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/framing/Frames.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/framing/Serializer.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/framing/Util.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/server/RocketServerConnection.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/server/RocketServerFrameContext.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/server/RocketSinkClientCallback.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/server/RocketStreamClientCallback.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/server/RocketThriftRequests.cpp.o CMakeFiles/thriftcpp2.dir/transport/rocket/server/ThriftRocketServerHandler.cpp.o CMakeFiles/thriftcpp2.dir/transport/rsocket/server/RSRoutingHandler.cpp.o CMakeFiles/thriftcpp2.dir/util/Checksum.cpp.o CMakeFiles/thriftcpp2.dir/util/ScopedServerInterfaceThread.cpp.o CMakeFiles/thriftcpp2.dir/util/ScopedServerThread.cpp.o CMakeFiles/thriftcpp2.dir/__/thrift/gen-cpp2/RpcMetadata_constants.cpp.o CMakeFiles/thriftcpp2.dir/__/thrift/gen-cpp2/RpcMetadata_data.cpp.o CMakeFiles/thriftcpp2.dir/__/thrift/gen-cpp2/RpcMetadata_types.cpp.o CMakeFiles/thriftcpp2.dir/transport/rsocket/gen-cpp2/Config_constants.cpp.o CMakeFiles/thriftcpp2.dir/transport/rsocket/gen-cpp2/Config_data.cpp.o CMakeFiles/thriftcpp2.dir/transport/rsocket/gen-cpp2/Config_types.cpp.o CMakeFiles/thriftcpp2.dir/transport/rsocket/gen-cpp2/Config_metadata.cpp.o -Wl,-rpath,/home/ali/Projects/LogDevice2/_build/fbthrift-prefix/src/fbthrift-build/lib:/home/ali/Projects/LogDevice2/_build/staging/usr/local/lib: ../../../lib/libthriftfrozen2.so ../../../lib/libthriftprotocol.so /home/ali/Projects/LogDevice2/_build/staging/usr/local/lib/libReactiveSocket.a ../../../lib/libthriftmetadata.so ../../../lib/libasync.so ../../../lib/libprotocol.so ../../../lib/libtransport.so ../../../lib/libconcurrency.so ../../../lib/libthrift-core.so /home/ali/Projects/LogDevice2/_build/staging/usr/local/lib/libwangle.a /home/ali/Projects/LogDevice2/_build/staging/usr/local/lib/libfizz.a -lrt /home/ali/Projects/LogDevice2/_build/staging/usr/local/lib/libyarpl.a /home/ali/Projects/LogDevice2/_build/staging/usr/local/lib/libfolly.so /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2 -lboost_context -lboost_filesystem -lboost_program_options -lboost_regex -lboost_system -lboost_thread -lboost_chrono -lboost_date_time -lboost_atomic -lglog -lssl -lcrypto /home/ali/Projects/LogDevice2/_build/staging/usr/local/lib/libfmt.a -lz -levent -ldouble-conversion -pthread -lbz2 -llzma -llz4 -lzstd -lsnappy -ldwarf -Wl,-Bstatic -liberty -Wl,-Bdynamic -lsodium -ldl -lunwind /usr/lib/x86_64-linux-gnu/libglog.so /usr/lib/x86_64-linux-gnu/libgflags.so.2.2.2 -lpthread -fuse-ld=gold CMakeFiles/thriftcpp2.dir/util/ScopedServerInterfaceThread.cpp.o(.note.stapsdt+0x14): error: relocation refers to local symbol "" [3100], which is defined in a discarded section section group signature: "_ZN6apache6thrift11concurrency13ThreadManager5ImplTIN5folly11LifoSemImplISt6atomicNS4_19SaturatingSemaphoreILb1ES6_EEEEE15reportTaskStatsERKNS2_4TaskERKNSt6chrono10time_pointINSE_3_V212steady_clockENSE_8durationIlSt5ratioILl1ELl1000000000EEEEEESO_" prevailing definition is from CMakeFiles/thriftcpp2.dir/server/ThriftServer.cpp.o collect2: error: ld returned 1 exit status

It is caused by issue in folly when used by fbthrift. There's another report in fbthrift for the issue and I'm not sure how it could build. I assume it could be because linker in Ubuntu 18 is of different version and somehow ignores this issue. The problem is template class methods are discarded as duplicates from one of .o files but folly added custom sections that are not dropped together with folly. It doesn't fail if dynamic libraries are disabled though, maybe that's the case why you don't see it on internal builds?

We have not invested yet in getting LogDevice on Ubuntu 19 but it sounds like you this should be fixed by thrift/folly teams instead. Please let us know how this is going.