[SERVER-49429] 3.0 server does not build Created: 10/Jul/20  Updated: 31/Mar/21  Resolved: 16/Jul/20

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

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

Issue Links:
Related
is related to SERVER-55663 Document upper bounds on supported co... Closed
Operating System: ALL
Participants:

 Description   

When I run `scons` to build 3.0.15 I receive the following error:

In file included from src/third_party/boost/boost/mpl/aux_/na_assert.hpp:23,
                 from src/third_party/boost/boost/mpl/arg.hpp:25,
                 from src/third_party/boost/boost/mpl/placeholders.hpp:24,
                 from src/third_party/boost/boost/iterator/iterator_categories.hpp:17,
                 from src/third_party/boost/boost/iterator/detail/facade_iterator_category.hpp:7,
                 from src/third_party/boost/boost/iterator/iterator_facade.hpp:14,
                 from src/third_party/boost/boost/filesystem/v3/path.hpp:28,
                 from src/third_party/boost/boost/filesystem/path.hpp:31,
                 from src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp:35:
src/third_party/boost/boost/mpl/assert.hpp:154:21: warning: unnecessary parentheses in declaration of 'assert_arg' [-Wparentheses]
  154 | failed ************ (Pred::************
      |                     ^
src/third_party/boost/boost/mpl/assert.hpp:159:21: warning: unnecessary parentheses in declaration of 'assert_not_arg' [-Wparentheses]
  159 | failed ************ (boost::mpl::not_<Pred>::************
      |                     ^
In file included from src/third_party/boost/boost/filesystem/path.hpp:31,
                 from src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp:35:
src/third_party/boost/boost/filesystem/v3/path.hpp: In member function 'boost::filesystem3::path& boost::filesystem3::path::append(const Source&, const codecvt_type&)':
src/third_party/boost/boost/filesystem/v3/path.hpp:677:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  677 |     if (path_traits::empty(source))
      |     ^~
src/third_party/boost/boost/filesystem/v3/path.hpp:679:7: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  679 |       string_type::size_type sep_pos(m_append_separator_if_needed());
      |       ^~~~~~~~~~~
src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp: In function 'void mongo::{anonymous}::checkReadAhead(const string&)':
src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp:168:61: error: 'major' was not declared in this scope
  168 |         string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)
      |                                                             ^~~~~
src/mongo/db/storage/mmap_v1/mmap_v1_engine.cpp:168:82: error: 'minor' was not declared in this scope
  168 |         string path = str::stream() << "/sys/dev/block/" << major(dev) << ':' << minor(dev)
      |                                                                                  ^~~~~
g++ -o build/linux2/normal/mongo/db/storage/mmap_v1/mmap_v1_init.o -c -Wnon-virtual-dtor -Woverloaded-virtual -std=c++11 -fno-omit-frame-pointer -fPIC -fno-strict-aliasing -ggdb -pthread -Wall -Wsign-compare -Wno-unknown-pragmas -Winvalid-pch -pipe -O3 -Wno-unused-local-typedefs -Wno-unused-function -Wno-deprecated-declarations -Wno-unused-const-variable -Wno-unused-but-set-variable -Wno-missing-braces -fno-builtin-memcmp -DBOOST_ALL_NO_LIB -D_SCONS -DMONGO_EXPOSE_MACROS -DPCRE_STATIC -DSUPPORT_UTF8 -DMONGO_OPTIMIZED_BUILD -DMONGO_BYTE_ORDER=1234 -D_FILE_OFFSET_BITS=64 -DMONGO_HAVE___THREAD -DMONGO_HAVE_CXX11_ATOMICS -DMONGO_HAVE_STD_IS_TRIVIALLY_COPYABLE -DBOOST_SYSTEM_NO_DEPRECATED -DMONGO_HAVE_HEADER_UNISTD_H -DMONGO_HAVE_POSIX_MONOTONIC_CLOCK -DMONGO_HAVE_EXECINFO_BACKTRACE -DMONGO_ENTERPRISE_VERSION=1 -DNETSNMP_NO_INLINE -Isrc/third_party/s2 -Isrc/third_party/pcre-8.39 -Isrc/third_party/boost -Ibuild/linux2/normal -Isrc src/mongo/db/storage/mmap_v1/mmap_v1_init.cpp
scons: *** [build/linux2/normal/mongo/db/storage/mmap_v1/mmap_v1_engine.o] Error 1
scons: building terminated because of errors.

gcc 9:

serene% gcc -v                                            
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/9/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none:hsa
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 9.3.0-14' --with-bugurl=file:///usr/share/doc/gcc-9/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,gm2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-9 --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 --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --with-target-system-zlib=auto --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=/build/gcc-9-aHzuVo/gcc-9-9.3.0/debian/tmp-nvptx/usr,hsa --without-cuda-driver --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu --with-build-config=bootstrap-lto-lean --enable-link-mutex
Thread model: posix
gcc version 9.3.0 (Debian 9.3.0-14) 



 Comments   
Comment by Jonathan Streets (Inactive) [ 16/Jul/20 ]

at 3.0 the args to scon are

--cc=/path/to/gcc --cxx=/path/to/g++.

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

You select the compiler with the CC and CXX arguments to SCons:

scons CC=/path/to/gcc CXX=/path/to/g++ ...

Note that these are not shell environment variables but are command line arguments to scons. Attempting to set them as shell environment variables will not have the desired effect because scons disregards the users shell environment by design.

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