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

Out-of-source builds fail, "mongo/src/mongo/db/sorter/sorter_gen.h: No such file or directory"

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build
    • None
    • ALL
    • Dev Platform 2020-11-02

      I checked out master on Linux and tried to build using a distinct output directory.

      Source: "/home/emptysquare/Vermino.us Dropbox/Verminous Davis/mongo"
      Build: "/home/emptysquare/build"

      > python buildscripts/scons.py --cache CCFLAGS='-gsplit-dwarf' ICECC=icecc CCACHE=ccache --variables-files=etc/scons/mongodbtoolchain_v3_gcc.vars --link-model=dynamic --allocator=system VARIANT_DIR=ninja --ssl --dbg --enable-free-mon=off --install-mode=hygienic --ninja build.ninja --build-dir=/home/emptysquare/build
      
      > ninja -f build.ninja -j 400
      

      The build fails with:

      FAILED: /home/emptysquare/build/ninja/mongo/client/dbclient_cursor.dyn.o
      PATH=/opt/mongodbtoolchain/v3/bin:/usr/local/bin:/opt/bin:/bin:/usr/bin CCACHE_NOCPP2=1 ICECC_VERSION=/home/emptysquare/build/scons/icecc/opt_mongodbtoolcha
      in_v3_bin_gcc_opt_mongodbtoolchain_v3_bin_g++.tar.gz CCACHE_PREFIX=/usr/bin/icecc ccache /opt/mongodbtoolchain/v3/bin/g++ @/home/emptysquare/build/ninja/mon
      go/client/dbclient_cursor.dyn.o.rsp
      In file included from src/mongo/db/storage/storage_engine.h:40,
                       from src/mongo/db/service_context.h:40,
                       from src/mongo/db/client.h:43,
                       from src/mongo/db/operation_context.h:36,
                       from src/mongo/transport/transport_layer.h:37,
                       from src/mongo/client/mongo_uri.h:43,
                       from src/mongo/client/authenticate.h:40,
                       from src/mongo/client/dbclient_base.h:36,
                       from src/mongo/client/connpool.h:35,
                       from src/mongo/client/dbclient_cursor.cpp:42:
      /home/emptysquare/build/ninja/mongo/db/resumable_index_builds_gen.h:25:10: fatal error: mongo/src/mongo/db/sorter/sorter_gen.h: No such file or directory
       #include "mongo/src/mongo/db/sorter/sorter_gen.h"
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      

      It seems that /home/emptysquare/build/ninja/mongo/db/resumable_index_builds_gen.h isn't generated correctly. It contains:

      #include "mongo/base/data_range.h"
      #include "mongo/base/string_data.h"
      #include "mongo/bson/bsonobj.h"
      #include "mongo/bson/bsonobjbuilder.h"
      #include "mongo/bson/simple_bsonobj_comparator.h"
      #include "mongo/db/namespace_string.h"
      #include "mongo/idl/basic_types.h"
      #include "mongo/idl/idl_parser.h"
      #include "mongo/rpc/op_msg.h"
      #include "mongo/src/mongo/db/sorter/sorter_gen.h"
      #include "mongo/util/uuid.h"
      

      I think there's an incompatibility between IDL files that import IDL files and the --build-dir option.

            Assignee:
            daniel.moody@mongodb.com Daniel Moody
            Reporter:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: