Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-1756

'make -j 8' fails with "unterminated #ifdef" error

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9
    • Fix Version/s: 0.9.1
    • Component/s: Build Process
    • Labels:
      None
    • Environment:

      OSX 10.7.4

      Description

      If I run 'make' in 1 thread Thrift builds fine. But if I clean&run it with 16 threads the build process fails almost constantly with following error

       
      g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall -g -O2 -MT Benchmark.o -MD -MP -MF .deps/Benchmark.Tpo -c -o Benchmark.o Benchmark.cpp
      /bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall -g -O2 -MT OptionalRequiredTest_types.lo -MD -MP -MF .deps/OptionalRequiredTest_types.Tpo -c -o OptionalRequiredTest_types.lo `test -f 'gen-cpp/OptionalRequiredTest_types.cpp' || echo './'`gen-cpp/OptionalRequiredTest_types.cpp
      /bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall -g -O2 -MT ThriftTest_types.lo -MD -MP -MF .deps/ThriftTest_types.Tpo -c -o ThriftTest_types.lo `test -f 'gen-cpp/ThriftTest_types.cpp' || echo './'`gen-cpp/ThriftTest_types.cpp
      libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include -Wall -g -O2 -MT DebugProtoTest_extras.lo -MD -MP -MF .deps/DebugProtoTest_extras.Tpo -c DebugProtoTest_extras.cpp  -fPIC -DPIC -o .libs/DebugProtoTest_extras.o
      /bin/sh ../../../libtool  --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include  -Wall -g -O2 -MT DebugProtoTest_types.lo -MD -MP -MF .deps/DebugProtoTest_types.Tpo -c -o DebugProtoTest_types.lo `test -f 'gen-cpp/DebugProtoTest_types.cpp' || echo './'`gen-cpp/DebugProtoTest_types.cpp
      libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include -Wall -g -O2 -MT OptionalRequiredTest_types.lo -MD -MP -MF .deps/OptionalRequiredTest_types.Tpo -c gen-cpp/OptionalRequiredTest_types.cpp  -fPIC -DPIC -o .libs/OptionalRequiredTest_types.o
      In file included from DebugProtoTest_extras.cpp:22:
      gen-cpp/DebugProtoTest_types.h:6:1: error: unterminated #ifndef
      libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include -Wall -g -O2 -MT ThriftTest_extras.lo -MD -MP -MF .deps/ThriftTest_extras.Tpo -c ThriftTest_extras.cpp  -fPIC -DPIC -o .libs/ThriftTest_extras.o
      libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include -Wall -g -O2 -MT ThriftTest_types.lo -MD -MP -MF .deps/ThriftTest_types.Tpo -c gen-cpp/ThriftTest_types.cpp  -fPIC -DPIC -o .libs/ThriftTest_types.o
      libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../.. -I../../../lib/cpp/src -I/usr/include -Wall -g -O2 -MT DebugProtoTest_types.lo -MD -MP -MF .deps/DebugProtoTest_types.Tpo -c gen-cpp/DebugProtoTest_types.cpp  -fPIC -DPIC -o .libs/DebugProtoTest_types.o
      DebugProtoTest_extras.cpp:27: error: definition of 'bool thrift::test::debug::Empty::operator<(const thrift::test::debug::Empty&) const' is not in namespace enclosing 'thrift::test::debug::Empty'
      DebugProtoTest_extras.cpp:33: error: expected '}' at end of input
      DebugProtoTest_extras.cpp:33: error: expected '}' at end of input
      DebugProtoTest_extras.cpp:33: error: expected '}' at end of input
      make[4]: *** [DebugProtoTest_extras.lo] Error 1
      make[4]: *** Waiting for unfinished jobs....
      

      The file ./lib/cpp/test/gen-cpp/DebugProtoTest_types.h looks ok. Now if I run 'make -j 16' once again - everything builds fine.

      It makes me think that this is a concurrency issue in Makefiles. My only guess is this is some undeclared dependency. It looks like DebugProtoTest_extras.cpp started building before gen-cpp/DebugProtoTest_types.h generation ended.

        Attachments

        1. thrift.log
          98 kB
          Vitali Lovich

          Issue Links

            Activity

              People

              • Assignee:
                jfarrell Jake Farrell
                Reporter:
                vlovich Vitali Lovich
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: