[SERVER-43382] Compilation error regarding IndexBuildBlock undefined on my Ubuntu 19 machine's local compile Created: 20/Sep/19  Updated: 29/Oct/23  Resolved: 21/Sep/19

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 4.3.1

Type: Bug Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Execution Team 2019-09-23
Participants:

 Description   

Compilation invocation:

scons_args = "CC=/opt/mongodbtoolchain/v3/bin/clang" "CXX=/opt/mongodbtoolchain/v3/bin/clang++" $
    "-j32" "--opt=off" "--dbg=on" "--link-model=dynamic" "--allocator=system" "--ssl=on" $
    "--icecream" "VARIANT_DIR=ninja"

Compilation error:

[4859/4973 ( 97%) 64.308s]DYNLIB build/ninja/mongo/db/catalog/libindex_builds_manager.so
FAILED: build/ninja/mongo/db/catalog/libindex_builds_manager.so
/bin/icerun /opt/mongodbtoolchain/v3/bin/clang++ @build/ninja/mongo/db/catalog/libindex_builds_manager.so.rsp
/opt/mongodbtoolchain/revisions/96e2650c61290915d321ca0e2fb6b2bcd68a0cfc/stow/gcc-v3.UUf/lib/gcc/x86_64-mongodb-linux/8.2.0/../../../../include/c++/8.2.0/bits/unique_ptr.h:137: error: undefined reference to 'mongo::IndexBuildBlock::~IndexBuildBlock()'
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
[4865/4973 ( 97%) 64.495s]DYNLIB build/ninja/mongo/db/libcloner.so
FAILED: build/ninja/mongo/db/libcloner.so
/bin/icerun /opt/mongodbtoolchain/v3/bin/clang++ @build/ninja/mongo/db/libcloner.so.rsp
/opt/mongodbtoolchain/revisions/96e2650c61290915d321ca0e2fb6b2bcd68a0cfc/stow/gcc-v3.UUf/lib/gcc/x86_64-mongodb-linux/8.2.0/../../../../include/c++/8.2.0/bits/unique_ptr.h:137: error: undefined reference to 'mongo::IndexBuildBlock::~IndexBuildBlock()'
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
[4866/4973 ( 97%) 64.627s]DYNLIB build/ninja/mongo/db/s/libsharding_catalog_manager.so
ninja: build stopped: subcommand failed.

Compilation fix here:

diff --git a/src/mongo/db/catalog/SConscript b/src/mongo/db/catalog/SConscript
index f1d8de9ee2..e0edff18a2 100644
--- a/src/mongo/db/catalog/SConscript
+++ b/src/mongo/db/catalog/SConscript
@@ -226,6 +226,7 @@ env.Library(
     ],
     LIBDEPS=[
         'collection',
+        'index_build_block',
         'index_timestamp_helper',
         '$BUILD_DIR/mongo/base',
         '$BUILD_DIR/mongo/db/audit',
@@ -239,7 +240,6 @@ env.Library(
         '$BUILD_DIR/mongo/util/progress_meter',
     ],
     LIBDEPS_PRIVATE=[
-        'index_build_block',
         '$BUILD_DIR/mongo/db/index/index_build_interceptor',
         '$BUILD_DIR/mongo/db/storage/storage_options',
         '$BUILD_DIR/mongo/idl/server_parameter',

Is there something I'm doing wrong? The evergreen waterfall seems just fine... IndexBuildBlock is used internally to multi_index_block only, so exposing it higher makes no sense. I cleared my build directory.



 Comments   
Comment by Githook User [ 20/Sep/19 ]

Author:

{'name': 'Dianna Hohensee', 'username': 'DiannaHohensee', 'email': 'dianna.hohensee@mongodb.com'}

Message: SERVER-43382 move index_build_block from a private dependency of the multi_index_block library to a public one
Branch: master
https://github.com/mongodb/mongo/commit/3dc398ef9f7a973521a7f484ee9f8309aae478c2

Comment by Dianna Hohensee (Inactive) [ 20/Sep/19 ]

Drew observed that multi_index_block.h defines struct IndexToBuild with a std::unique_ptr<IndexBuildBlock>. Thus, the multi_index_block SCons library does not entirely hide use of IndexBuildBlock and the multi_index_block library inclusion of index_build_block cannot be private. He has not looked into why our evergreen builders are fine with this state of affairs.

Generated at Thu Feb 08 05:03:02 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.