So, I was working on getting Facebook's seemingly amazing Scribe logging architecture setup to check it out. One of the requirements it has is 'fb303', which is included with Thrift in the contrib directory. I ran into this:


[root@wolverine fb303]# ./configure --with-thriftpath=/usr/local --with-boost=/usr/local
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking for style of include used by make... GNU

checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking for ranlib... ranlib
checking for bash... /bin/sh
checking for perl... /usr/bin/perl
checking for python... /usr/bin/python
checking for ar... /usr/bin/ar
checking for ant... no
checking Checking EXTERNAL_PATH set to... /usr/local/src/scribetest/thrift/contrib/fb303
checking whether to enable optimized build... yes
checking whether to enable static mode... yes
checking Checking thrift_home set to... /usr/local
checking for boostlib >= 1.33.1... yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating cpp/Makefile
config.status: creating py/Makefile
config.status: executing depfiles commands
EXTERNAL_PATH /usr/local/src/scribetest/thrift/contrib/fb303
[root@wolverine fb303]# make
make all-recursive
make[1]: Entering directory `/usr/local/src/scribetest/thrift/contrib/fb303'
Making all in .
make[2]: Entering directory `/usr/local/src/scribetest/thrift/contrib/fb303'
make[2]: Nothing to be done for `all-am'.
make[2]: Leaving directory `/usr/local/src/scribetest/thrift/contrib/fb303'
Making all in cpp
make[2]: Entering directory `/usr/local/src/scribetest/thrift/contrib/fb303/cpp'
make all-am
make[3]: Entering directory `/usr/local/src/scribetest/thrift/contrib/fb303/cpp'
if g++ -DPACKAGE_NAME=\"libfb303\" -DPACKAGE_TARNAME=\"libfb303\" -DPACKAGE_VERSION=\"20080209\" -DPACKAGE_STRING=\"libfb303\ 20080209\" -DPACKAGE_BUGREPORT=\"\" -DHAVE_BOOST= -I. -I. -I.. -Igen-cpp -I/usr/local/include/thrift -I/usr/local/include/boost-1_37 -Wall -O3 -MT FacebookService.o -MD -MP -MF ".deps/FacebookService.Tpo" -c -o FacebookService.o `test -f 'gen-cpp/FacebookService.cpp' || echo './'`gen-cpp/FacebookService.cpp; \
then mv -f ".deps/FacebookService.Tpo" ".deps/FacebookService.Po"; else rm -f ".deps/FacebookService.Tpo"; exit 1; fi
In file included from gen-cpp/FacebookService.cpp:6:
gen-cpp/FacebookService.h:28: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.h:28: error: `Service' has not been declared
gen-cpp/FacebookService.h:28: error: ISO C++ forbids declaration of `_return' with no type
gen-cpp/FacebookService.h:72: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.h:72: error: `Service' has not been declared
gen-cpp/FacebookService.h:72: error: ISO C++ forbids declaration of `parameter' with no type
gen-cpp/FacebookService.h:1077: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.h:1077: error: ISO C++ forbids declaration of `Service' with no type
gen-cpp/FacebookService.h:1077: error: expected `;' before "success"
gen-cpp/FacebookService.h: In member function `bool facebook::fb303::FacebookService_getLimitedReflection_result::operator==(const facebook::fb303::FacebookService_getLimitedReflection_result&) const':
gen-cpp/FacebookService.h:1086: error: `success' was not declared in this scope
gen-cpp/FacebookService.h:1086: error: 'const class facebook::fb303::FacebookService_getLimitedReflection_result' has no member named 'success'
gen-cpp/FacebookService.h:1086: warning: unused variable 'success'
gen-cpp/FacebookService.h: At global scope:
gen-cpp/FacebookService.h:1107: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.h:1107: error: ISO C++ forbids declaration of `Service' with no type
gen-cpp/FacebookService.h:1107: error: expected `;' before '*' token
gen-cpp/FacebookService.h:1241: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.h:1241: error: `Service' has not been declared
gen-cpp/FacebookService.h:1241: error: ISO C++ forbids declaration of `_return' with no type
gen-cpp/FacebookService.h:1243: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.h:1243: error: `Service' has not been declared
gen-cpp/FacebookService.h:1243: error: ISO C++ forbids declaration of `_return' with no type
gen-cpp/FacebookService.h:1434: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.h:1434: error: `Service' has not been declared
gen-cpp/FacebookService.h:1434: error: ISO C++ forbids declaration of `_return' with no type
gen-cpp/FacebookService.cpp: In member function `uint32_t facebook::fb303::FacebookService_getLimitedReflection_result::read(apache::thrift::protocol::TProtocol*)':
gen-cpp/FacebookService.cpp:1795: error: 'class facebook::fb303::FacebookService_getLimitedReflection_result' has no member named 'success'
gen-cpp/FacebookService.cpp: In member function `uint32_t facebook::fb303::FacebookService_getLimitedReflection_result::write(apache::thrift::protocol::TProtocol*) const':
gen-cpp/FacebookService.cpp:1821: error: 'const class facebook::fb303::FacebookService_getLimitedReflection_result' has no member named 'success'
gen-cpp/FacebookService.cpp: In member function `uint32_t facebook::fb303::FacebookService_getLimitedReflection_presult::read(apache::thrift::protocol::TProtocol*)':
gen-cpp/FacebookService.cpp:1851: error: 'class facebook::fb303::FacebookService_getLimitedReflection_presult' has no member named 'success'
gen-cpp/FacebookService.cpp: At global scope:
gen-cpp/FacebookService.cpp:2614: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.cpp:2614: error: variable or field `getLimitedReflection' declared void
gen-cpp/FacebookService.cpp:2614: error: `int facebook::fb303::FacebookServiceClient::getLimitedReflection' is not a static member of `class facebook::fb303::FacebookServiceClient'
gen-cpp/FacebookService.cpp:2614: error: `Service' was not declared in this scope
gen-cpp/FacebookService.cpp:2614: error: `_return' was not declared in this scope
gen-cpp/FacebookService.cpp:2615: error: expected `,' or `;' before '{' token
gen-cpp/FacebookService.cpp:2633: error: `facebook::thrift' has not been declared
gen-cpp/FacebookService.cpp:2633: error: variable or field `recv_getLimitedReflection' declared void
gen-cpp/FacebookService.cpp:2633: error: `int facebook::fb303::FacebookServiceClient::recv_getLimitedReflection' is not a static member of `class facebook::fb303::FacebookServiceClient'
gen-cpp/FacebookService.cpp:2633: error: `Service' was not declared in this scope
gen-cpp/FacebookService.cpp:2633: error: `_return' was not declared in this scope
gen-cpp/FacebookService.cpp:2634: error: expected `,' or `;' before '{' token
gen-cpp/FacebookService.cpp: In member function `void facebook::fb303::FacebookServiceProcessor::process_getLimitedReflection(int32_t, apache::thrift::protocol::TProtocol*, apache::thrift::protocol::TProtocol*)':
gen-cpp/FacebookService.cpp:3070: error: 'class facebook::fb303::FacebookService_getLimitedReflection_result' has no member named 'success'
make[3]: *** [FacebookService.o] Error 1
make[3]: Leaving directory `/usr/local/src/scribetest/thrift/contrib/fb303/cpp'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/local/src/scribetest/thrift/contrib/fb303/cpp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/scribetest/thrift/contrib/fb303'
make: *** [all] Error 2

I googled around but found nothing. I tried logging into #thrift on Freenode, and "SteveC_" informed me that he had the same problem, and pointed me at this thrift bug report that explains it a little better. It would seem that Thrift is no longer in the 'facebook' namespace, but rather 'apache'. This makes perfect sense. However, fb303 still expects it to be facebook. So, on Steve's advice of replacing the word 'facebook' with 'apache' in the fb303 tree, I did this in fb303:

find . -type f | xargs perl -p -i -e 's/facebook/apache/g'

And the make continued a little further until I hit this:


make[2]: Leaving directory `/usr/local/src/scribetest/thrift/contrib/fb303/cpp'
Making all in py
make[2]: Entering directory `/usr/local/src/scribetest/thrift/contrib/fb303/py'
/usr/bin/python setup.py build
running build
running build_py
error: package directory 'fb303' does not exist
make[2]: *** [all-local] Error 1
make[2]: Leaving directory `/usr/local/src/scribetest/thrift/contrib/fb303/py'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/local/src/scribetest/thrift/contrib/fb303'
make: *** [all] Error 2

However, this error seemed to be irrelevant, as 'make install' put fb303 where it was supposed to go.

Building scribe, the same 'find' command from above was required. I ran it after running into the first 'no such thing as facebook' error, and the make continued, and scribe seemed to work just fine.

Hopefully this will find its way into google's indexes and help somebody.