Giter Site home page Giter Site logo

Comments (9)

superchild avatar superchild commented on May 2, 2024

I found some bug in this CMakeList.txt
Try to modify

foreach(reflect ${arg_REFLECT})
    set(outputs ${outputs}
        ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflect.h
        ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflect.cpp)
endforeach(reflect)

to

foreach(reflect ${arg_REFLECT})
    set(outputs ${outputs}
        ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflection.h
        ${CMAKE_BINARY_DIR}/gen/${dirname}/gen-${gen}/${reflect}_reflection.cpp)
endforeach(reflect)

and also needs to modify the cmake_parse_arguments.
Try to modify

function(fboss_add_thrift)
    cmake_parse_arguments("arg" "" "OPTIONS";"THRIFTSRC" "SERVICES" ${ARGN})

to

function(fboss_add_thrift)
    set(options)
    set(oneValueArgs OPTIONS REFLECT)
    set(multiValueArgs THRIFTSRC SERVICES)
    cmake_parse_argument("arg" "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

from fboss.

vitaliy-senchyshyn avatar vitaliy-senchyshyn commented on May 2, 2024

This helped a bit but now I see error as follows:
fboss/external/fbthrift/thrift/compiler/thrift1: error while loading shared libraries: libfolly.so.48: cannot open shared object file: No such file or directory

At the same time I see that this library is here:
fboss$ find . -name libfolly.so.48
./external/folly/folly/.libs/libfolly.so.48

So this looks quite strange. But perhaps this happens because ./getdeps.sh throws errors on gen-cpp2/ stage and fails to finish. Although ./getdeps.sh now has exact versions of folly, fbthrift and iproute2 which have to be downloaded but looks like there is still some mistake in versions mentioned there. First of all I've added the command "git reset --hard $2" after "cd $1" function build() but still see many errors as follows:

In file included from gen-cpp2/SaslAuthService.cpp:7:0:
gen-cpp2/SaslAuthService.h:79:37: error: expected type-specifier before ‘ProcessFunc’
using BinaryProtocolProcessFunc = ProcessFunc<SaslAuthServiceAsyncProcessor, apache::thrift::BinaryProtocolReader>;
^
gen-cpp2/SaslAuthService.h:80:36: error: expected type-specifier before ‘ProcessMap’
using BinaryProtocolProcessMap = ProcessMap;
^
gen-cpp2/SaslAuthService.h:81:16: error: ‘BinaryProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
static const SaslAuthServiceAsyncProcessor::BinaryProtocolProcessMap& getBinaryProtocolProcessMap();
^
gen-cpp2/SaslAuthService.h:83:10: error: ‘BinaryProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
static SaslAuthServiceAsyncProcessor::BinaryProtocolProcessMap binaryProcessMap_;
^
gen-cpp2/SaslAuthService.h:85:38: error: expected type-specifier before ‘ProcessFunc’
using CompactProtocolProcessFunc = ProcessFunc<SaslAuthServiceAsyncProcessor, apache::thrift::CompactProtocolReader>;
^
gen-cpp2/SaslAuthService.h:86:37: error: expected type-specifier before ‘ProcessMap’
using CompactProtocolProcessMap = ProcessMap;
^
gen-cpp2/SaslAuthService.h:87:16: error: ‘CompactProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
static const SaslAuthServiceAsyncProcessor::CompactProtocolProcessMap& getCompactProtocolProcessMap();
^
gen-cpp2/SaslAuthService.h:89:10: error: ‘CompactProtocolProcessMap’ in ‘class apache::thrift::sasl::SaslAuthServiceAsyncProcessor’ does not name a type
static SaslAuthServiceAsyncProcessor::CompactProtocolProcessMap compactProcessMap_;
^
gen-cpp2/SaslAuthService.h: In constructor ‘apache::thrift::sasl::SaslAuthServiceAsyncClient::SaslAuthServiceAsyncClient(std::shared_ptrapache::thrift::RequestChannel)’:
gen-cpp2/SaslAuthService.h:127:50: error: no matching function for call to ‘apache::thrift::Cpp2ConnContext::Cpp2ConnContext()’
connectionContext_.reset(new apache::thrift::Cpp2ConnContext);
^
gen-cpp2/SaslAuthService.h:127:50: note: candidates are:
In file included from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:29:0,
from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
from gen-cpp2/SaslAuthService.h:9,
from gen-cpp2/SaslAuthService.cpp:7:
../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:39:12: note: apache::thrift::Cpp2ConnContext::Cpp2ConnContext(const folly::SocketAddress_, const apache::thrift::async::TAsyncSocket_, apache::thrift::transport::THeader_, const apache::thrift::SaslServer_, apache::thrift::async::TEventBaseManager_, const std::shared_ptrapache::thrift::RequestChannel&)
explicit Cpp2ConnContext(
^
../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:39:12: note: candidate expects 6 arguments, 0 provided
../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: apache::thrift::Cpp2ConnContext::Cpp2ConnContext(const apache::thrift::Cpp2ConnContext&)
class Cpp2ConnContext : public apache::thrift::server::TConnectionContext {
^
../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: candidate expects 1 argument, 0 provided
../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: apache::thrift::Cpp2ConnContext::Cpp2ConnContext(apache::thrift::Cpp2ConnContext&&)
../../../thrift/lib/cpp2/server/Cpp2ConnContext.h:37:7: note: candidate expects 1 argument, 0 provided
In file included from gen-cpp2/SaslAuthService.cpp:9:0:
gen-cpp2/SaslAuthService.tcc: In member function ‘void apache::thrift::sasl::SaslAuthServiceAsyncProcessor::process_authFirstRequest(std::unique_ptrapache::thrift::ResponseChannel::Request, std::unique_ptrfolly::IOBuf, std::unique_ptr, apache::thrift::Cpp2RequestContext_, apache::thrift::async::TEventBase_, apache::thrift::concurrency::ThreadManager_)’:
gen-cpp2/SaslAuthService.tcc:48:159: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
queue.append(apache::thrift::transport::THeader::transform(queue.move(), ctx->getHeader()->getWriteTransforms(), ctx->getHeader()->getMinCompressBytes()));
^
gen-cpp2/SaslAuthService.tcc:48:159: note: candidate is:
In file included from ../../../thrift/lib/cpp/server/TConnectionContext.h:25:0,
from ../../../thrift/lib/cpp/EventHandlerBase.h:25,
from ../../../thrift/lib/cpp/TProcessor.h:25,
from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:20,
from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
from gen-cpp2/SaslAuthService.h:9,
from gen-cpp2/SaslAuthService.cpp:7:
../../../thrift/lib/cpp/transport/THeader.h:140:40: note: static std::unique_ptrfolly::IOBuf apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, std::vector&, uint32_t)
static std::unique_ptrfolly::IOBuf transform(
^
../../../thrift/lib/cpp/transport/THeader.h:140:40: note: no known conversion for argument 2 from ‘const std::vector’ to ‘std::vector&’
In file included from gen-cpp2/SaslAuthService.cpp:9:0:
gen-cpp2/SaslAuthService.tcc: In static member function ‘static void apache::thrift::sasl::SaslAuthServiceAsyncProcessor::throw_authFirstRequest(std::unique_ptrapache::thrift::ResponseChannel::Request, int32_t, apache::thrift::ContextStack_, std::exception_ptr::exception_ptr, apache::thrift::Cpp2RequestContext)’:
gen-cpp2/SaslAuthService.tcc:91:165: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
^
gen-cpp2/SaslAuthService.tcc:91:165: note: candidate is:
In file included from ../../../thrift/lib/cpp/server/TConnectionContext.h:25:0,
from ../../../thrift/lib/cpp/EventHandlerBase.h:25,
from ../../../thrift/lib/cpp/TProcessor.h:25,
from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:20,
from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
from gen-cpp2/SaslAuthService.h:9,
from gen-cpp2/SaslAuthService.cpp:7:
../../../thrift/lib/cpp/transport/THeader.h:140:40: note: static std::unique_ptrfolly::IOBuf apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, std::vector&, uint32_t)
static std::unique_ptrfolly::IOBuf transform(
^
../../../thrift/lib/cpp/transport/THeader.h:140:40: note: no known conversion for argument 2 from ‘const std::vector’ to ‘std::vector&’
In file included from gen-cpp2/SaslAuthService.cpp:9:0:
gen-cpp2/SaslAuthService.tcc:104:165: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));
^
gen-cpp2/SaslAuthService.tcc:104:165: note: candidate is:
In file included from ../../../thrift/lib/cpp/server/TConnectionContext.h:25:0,
from ../../../thrift/lib/cpp/EventHandlerBase.h:25,
from ../../../thrift/lib/cpp/TProcessor.h:25,
from ../../../thrift/lib/cpp2/async/AsyncProcessor.h:20,
from ../../../thrift/lib/cpp2/ServiceIncludes.h:5,
from gen-cpp2/SaslAuthService.h:9,
from gen-cpp2/SaslAuthService.cpp:7:
../../../thrift/lib/cpp/transport/THeader.h:140:40: note: static std::unique_ptrfolly::IOBuf apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, std::vector&, uint32_t)
static std::unique_ptrfolly::IOBuf transform(
^
../../../thrift/lib/cpp/transport/THeader.h:140:40: note: no known conversion for argument 2 from ‘const std::vector’ to ‘std::vector&’
In file included from gen-cpp2/SaslAuthService.cpp:9:0:
gen-cpp2/SaslAuthService.tcc: In static member function ‘static void apache::thrift::sasl::SaslAuthServiceAsyncProcessor::throw_wrapped_authFirstRequest(std::unique_ptrapache::thrift::ResponseChannel::Request, int32_t, apache::thrift::ContextStack
, folly::exception_wrapper, apache::thrift::Cpp2RequestContext_)’:
gen-cpp2/SaslAuthService.tcc:126:165: error: no matching function for call to ‘apache::thrift::transport::THeader::transform(std::unique_ptrfolly::IOBuf, const std::vector&, uint32_t)’
queue.append(apache::thrift::transport::THeader::transform(queue.move(), reqCtx->getHeader()->getWriteTransforms(), reqCtx->getHeader()->getMinCompressBytes()));

from fboss.

oridb avatar oridb commented on May 2, 2024

What version of Thrift are you building against?

from fboss.

vitaliy-senchyshyn avatar vitaliy-senchyshyn commented on May 2, 2024

v0.28.0 as mentioned in ./getdeps.sh

from fboss.

oridb avatar oridb commented on May 2, 2024

Odd. What compiler version?

from fboss.

vitaliy-senchyshyn avatar vitaliy-senchyshyn commented on May 2, 2024

/fboss$ g++ --version
g++ (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4

from fboss.

vitaliy-senchyshyn avatar vitaliy-senchyshyn commented on May 2, 2024

Any updates?

from fboss.

vitaliy-senchyshyn avatar vitaliy-senchyshyn commented on May 2, 2024

After my hard disc clean up things are much better(I guess the problems above occurred because of thrift, folly and iproute2 libraries of versions other than required here were installed in system directories. Apparently they affected compilation).

I still see one compilation error which should be fixed but as a temporary solution I've just commented it out and this helped - fboss was built successfully. The error is as follows and I guess has to be fixed anyway:

/home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp: In destructor ‘virtual facebook::fboss::NeighborUpdater::~NeighborUpdater()’:
/home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp:156:37: error: no matching function for call to ‘std::vectorfolly::Future<folly::Unit >::push_back(std::remove_referencefolly::Future<void&>::type)’
stopTasks.push_back(std::move(f));
^
/home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp:156:37: note: candidates are:
In file included from /usr/include/c++/4.8/vector:64:0,
from /usr/include/c++/4.8/bits/random.h:34,
from /usr/include/c++/4.8/random:50,
from /usr/include/c++/4.8/bits/stl_algo.h:65,
from /usr/include/c++/4.8/algorithm:62,
from /usr/include/boost/container/detail/flat_tree.hpp:23,
from /usr/include/boost/container/flat_map.hpp:25,
from /home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.h:12,
from /home/vsenchyshyn/projects/xpliant/tmp/fboss/fboss/agent/NeighborUpdater.cpp:10:
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = folly::Futurefolly::Unit; _Alloc = std::allocatorfolly::Future<folly::Unit >; std::vector<_Tp, _Alloc>::value_type = folly::Futurefolly::Unit]
push_back(const value_type& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:901:7: note: no known conversion for argument 1 from ‘std::remove_referencefolly::Future<void&>::type {aka folly::Future}’ to ‘const value_type& {aka const folly::Futurefolly::Unit&}’
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = folly::Futurefolly::Unit; _Alloc = std::allocatorfolly::Future<folly::Unit >; std::vector<_Tp, _Alloc>::value_type = folly::Futurefolly::Unit]
push_back(value_type&& __x)
^
/usr/include/c++/4.8/bits/stl_vector.h:919:7: note: no known conversion for argument 1 from ‘std::remove_referencefolly::Future<void&>::type {aka folly::Future}’ to ‘std::vectorfolly::Future<folly::Unit >::value_type&& {aka folly::Futurefolly::Unit&&}’

from fboss.

oridb avatar oridb commented on May 2, 2024

This should be fixed.

from fboss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.