[SERVER-36206] Server does not build on Debian testing with default gcc compiler Created: 19/Jul/18  Updated: 29/Oct/23  Resolved: 24/Jul/18

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

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

Backwards Compatibility: Fully Compatible
Operating System: Linux
Sprint: Platforms 2018-08-13
Participants:

 Description   

Trying to build server master.

Error:

Compiling build/opt/third_party/icu4c-57.1/source/i18n/dayperiodrules.o
Compiling build/opt/mongo/db/commands/list_databases.o
Generating library build/opt/mongo/db/commands/libshell_protocol.a
Skipping ranlib for thin archive build/opt/mongo/db/commands/libshell_protocol.a
Compiling build/opt/mongo/db/update/log_builder.o
Compiling build/opt/mongo/util/periodic_runner_impl.o
Compiling build/opt/third_party/icu4c-57.1/source/common/ucnv_bld.o
Compiling build/opt/third_party/yaml-cpp-0.5.3/src/scanner.o
Compiling build/opt/mongo/util/cmdline_utils/censor_cmdline.o
Compiling build/opt/mongo/db/s/active_migrations_registry.o
Compiling build/opt/third_party/s2/strings/split.o
Generating library build/opt/mongo/db/libcommon.a
Skipping ranlib for thin archive build/opt/mongo/db/libcommon.a
Compiling build/opt/third_party/s2/strings/strutil.o
Compiling build/opt/third_party/s2/strings/stringprintf.o
Compiling build/opt/third_party/pcre-8.41/pcre_fullinfo.o
Compiling build/opt/third_party/wiredtiger/src/cursor/cur_ds.o
Compiling build/opt/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid128_erf.o
Compiling build/opt/mongo/db/free_mon/free_mon_protocol_gen.o
Compiling build/opt/mongo/db/pipeline/parsed_add_fields.o
Compiling build/opt/third_party/shim_mozjs.o
Compiling build/opt/mongo/db/commands/snapshot_management.o
Compiling build/opt/mongo/platform/stack_locator_linux.o
Compiling build/opt/third_party/icu4c-57.1/source/i18n/rbnf.o
Compiling build/opt/third_party/icu4c-57.1/source/common/rbbitblb.o
Compiling build/opt/mongo/db/operation_context.o
Compiling build/opt/mongo/db/commands/oplog_application_checks.o
Compiling build/opt/mongo/db/auth/authz_manager_external_state_local.o
In file included from src/mongo/platform/stack_locator_pthread_getattr_np.cpp:36:0,
                 from src/mongo/platform/stack_locator_linux.cpp:29:
src/mongo/util/scopeguard.h: In instantiation of 'mongo::ScopeGuardImpl1<F, P1> mongo::MakeGuard(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]':
src/mongo/platform/stack_locator_pthread_getattr_np.cpp:45:51:   required from here
src/mongo/util/scopeguard.h:156:7: error: mangled name for 'mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>::ScopeGuardImpl1(const mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>&)' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
 class ScopeGuardImpl1 : public ScopeGuardImplBase {
       ^~~~~~~~~~~~~~~
src/mongo/util/scopeguard.h:156:7: error: mangled name for 'mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>::ScopeGuardImpl1(const mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>&)' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
src/mongo/util/scopeguard.h:179:53: note: synthesized method 'mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>::ScopeGuardImpl1(const mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>&)' first required here 
     return ScopeGuardImpl1<F, P1>::MakeGuard(fun, p1);
                                                     ^
src/mongo/util/scopeguard.h: In instantiation of 'mongo::ScopeGuardImpl1<F, P1>::~ScopeGuardImpl1() [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]':
src/mongo/platform/stack_locator_pthread_getattr_np.cpp:45:51:   required from here
src/mongo/util/scopeguard.h:162:5: error: mangled name for 'mongo::ScopeGuardImpl1<F, P1>::~ScopeGuardImpl1() [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
     ~ScopeGuardImpl1() throw() {
     ^
src/mongo/util/scopeguard.h:162:5: error: mangled name for 'mongo::ScopeGuardImpl1<F, P1>::~ScopeGuardImpl1() [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
Generating library build/opt/third_party/s2/strings/libstrings.a
src/mongo/util/scopeguard.h: In instantiation of 'mongo::ScopeGuardImpl1<F, P1>::ScopeGuardImpl1(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]':
src/mongo/util/scopeguard.h:159:16:   required from 'static mongo::ScopeGuardImpl1<F, P1> mongo::ScopeGuardImpl1<F, P1>::MakeGuard(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]'
src/mongo/util/scopeguard.h:179:45:   required from 'mongo::ScopeGuardImpl1<F, P1> mongo::MakeGuard(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]'
src/mongo/platform/stack_locator_pthread_getattr_np.cpp:45:51:   required from here
src/mongo/util/scopeguard.h:171:5: error: mangled name for 'mongo::ScopeGuardImpl1<F, P1>::ScopeGuardImpl1(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
     ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1) {}
     ^~~~~~~~~~~~~~~
src/mongo/util/scopeguard.h:171:5: error: mangled name for 'mongo::ScopeGuardImpl1<F, P1>::ScopeGuardImpl1(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
Generating library build/opt/mongo/executor/libnetwork_interface_factory.a
src/mongo/util/scopeguard.h:166:10: error: mangled name for 'void mongo::ScopeGuardImpl1<F, P1>::Execute() [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
     void Execute() {
          ^~~~~~~
src/mongo/util/scopeguard.h:171:5: error: mangled name for 'mongo::ScopeGuardImpl1<F, P1>::ScopeGuardImpl1(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
     ScopeGuardImpl1(F fun, P1 p1) : fun_(fun), p1_(p1) {}
     ^~~~~~~~~~~~~~~
src/mongo/util/scopeguard.h:97:17: error: mangled name for 'static void mongo::ScopeGuardImplBase::SafeExecute(J&) [with J = mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
     static void SafeExecute(J& j) throw() {
                 ^~~~~~~~~~~
src/mongo/util/scopeguard.h:158:35: error: mangled name for 'static mongo::ScopeGuardImpl1<F, P1> mongo::ScopeGuardImpl1<F, P1>::MakeGuard(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
     static ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1) {
                                   ^~~~~~~~~
src/mongo/util/scopeguard.h:162:5: error: mangled name for 'mongo::ScopeGuardImpl1<F, P1>::~ScopeGuardImpl1() [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
     ~ScopeGuardImpl1() throw() {
     ^
src/mongo/util/scopeguard.h:178:31: error: mangled name for 'mongo::ScopeGuardImpl1<F, P1> mongo::MakeGuard(F, P1) [with F = int (*)(pthread_attr_t*) throw (); P1 = pthread_attr_t*]' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
 inline ScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1) {
                               ^~~~~~~~~
src/mongo/util/scopeguard.h:156:7: error: mangled name for 'mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>::ScopeGuardImpl1(const mongo::ScopeGuardImpl1<int (*)(pthread_attr_t*) throw (), pthread_attr_t*>&)' will change in C++17 because the exception specification is part of a function type [-Werror=noexcept-type]
 class ScopeGuardImpl1 : public ScopeGuardImplBase {
       ^~~~~~~~~~~~~~~
Skipping ranlib for thin archive build/opt/third_party/s2/strings/libstrings.a
Skipping ranlib for thin archive build/opt/mongo/executor/libnetwork_interface_factory.a
Compiling build/opt/third_party/IntelRDFPMathLib20U1/LIBRARY/src/bid64_cosh.o
cc1plus: all warnings being treated as errors
Compiling build/opt/mongo/db/pipeline/accumulator_push.o
scons: *** [build/opt/mongo/platform/stack_locator_linux.o] Error 1
 
scons: building terminated because of errors.
build/opt/mongo/platform/stack_locator_linux.o failed: Error 1

System:

speed% gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/7/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 7.3.0-25' --with-bugurl=file:///usr/share/doc/gcc-7/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-7 --program-prefix=x86_64-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib --enable-objc-gc=auto --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-offload-targets=nvptx-none --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 7.3.0 (Debian 7.3.0-25) 
speed% uname -a
Linux speed 4.16.0-2-amd64 #1 SMP Debian 4.16.16-2 (2018-06-22) x86_64 GNU/Linux



 Comments   
Comment by Githook User [ 24/Jul/18 ]

Author:

{'name': 'Mark Benvenuto', 'email': 'mark.benvenuto@mongodb.com', 'username': 'markbenvenuto'}

Message: SERVER-36206 Add note about --disable-warnings-as-errors to building.md
Branch: master
https://github.com/mongodb/mongo/commit/7bc1e78f6c9f66dbd065d37f57d4efcbff54124a

Comment by Andrew Morrow (Inactive) [ 20/Jul/18 ]

Hi oleg.pudeyev - That documentation is simply stating the minimum requirements. We know that the build almost certainly won't work with compilers older than those minima, and we require that we are warnings clean when using those stated minima (they happen to be the exact versions that we run in our CI system for our released binaries). However, we have found that trying to stay warnings clean with all newer compilers is simply unworkable: they just change too fast. So we provide the --disable-warnings-as-errors flag as an escape hatch.

I think your suggestion to add a note to building.md is a fine one. Would you like to send us a PR? I think something along the lines of "Please note that when using compilers newer than these stated minima, it may be necessary to build with the --disable-warnings-as-errors flag so that novel warnings do not cause the build to fail".

Comment by Oleg Pudeyev (Inactive) [ 19/Jul/18 ]

Okay it's building with that added, should this be stated in https://github.com/mongodb/mongo/blob/master/docs/building.md which also states that "GCC 5.4.0 or newer" is required which would include gcc 7?

Comment by Mark Benvenuto [ 19/Jul/18 ]

You need to pass `--disable-warnings-as-errors` since you are using a newer compiler then what MongoDB supports.

Comment by Oleg Pudeyev (Inactive) [ 19/Jul/18 ]

I got the server built using clang.

Generated at Thu Feb 08 04:42:23 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.