Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-31936

Compile Error in planner_access.cpp

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.10
    • Component/s: Build
    • Labels:
    • ALL
    • Hide

      Using vagrant, spin up one instance of ubuntu/artful64
      Install build-essential and scons
      Run scons mongod mongo

      Show
      Using vagrant, spin up one instance of ubuntu/artful64 Install build-essential and scons Run scons mongod mongo

      I am unable to compile mongo 3.4.10 from source. There is an error:

      Compiling build/opt/mongo/db/query/planner_access.o                             
      In file included from src/mongo/platform/compiler.h:151:0,                      
                       from src/mongo/util/invariant.h:30,                            
                       from src/mongo/base/string_data.h:41,                          
                       from build/opt/mongo/base/error_codes.h:32,                    
                       from src/mongo/base/status.h:34,                               
                       from src/mongo/db/query/canonical_query.h:32,                  
                       from src/mongo/db/query/planner_access.h:31,                   
                       from src/mongo/db/query/planner_access.cpp:33:                 
      src/mongo/db/query/planner_access.cpp: In static member function 'static mongo::QuerySolutionNode* mongo::QueryPlannerAccess::buildIndexedDataAccess(const mongo::CanonicalQuery&, mongo::MatchExpression*, bool, const std::vector<mongo::IndexEntry>&, const mongo::QueryPlannerParams&)':
      src/mongo/util/invariant.h:51:41: error: enum constant in boolean context [-Werror=int-in-bool-context]
               if (MONGO_unlikely(!(_Expression))) {                           \      
                                               ^
      src/mongo/platform/compiler_gcc.h:77:80: note: in definition of macro 'MONGO_unlikely'
        MONGO_unlikely(x) static_cast<bool>(__builtin_expect(static_cast<bool>(x), 0))
                                                                               ^
      src/mongo/util/invariant.h:56:19: note: in expansion of macro 'MONGO_invariant' 
       #define invariant MONGO_invariant
                         ^~~~~~~~~~~~~~~
      src/mongo/db/query/planner_access.cpp:1218:13: note: in expansion of macro 'invariant'
                   invariant(MatchExpression::ELEM_MATCH_OBJECT);                     
                   ^~~~~~~~~
      cc1plus: all warnings being treated as errors                                   
      scons: *** [build/opt/mongo/db/query/planner_access.o] Error 1                  
      scons: building terminated because of errors.                                   
      build/opt/mongo/db/query/planner_access.o failed: Error 1
      

            Assignee:
            david.storch@mongodb.com David Storch
            Reporter:
            utkonos Robert Simmons
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: