Build Mongo 5.0.13 from source error

Trying to build mongodb from source.
2) Installed all packages as described in mongo/ at r5.0.13-rc0 · mongodb/mongo · GitHub
3) Changed const in src/mongo/bson/util/builder.h to BSONObjMaxUserSize = 64 * 1024 * 1024
4) Build with command python3 buildscripts/ -j 3 DESTDIR=/var/opt/mongo install-mongod

Getting error:

    inlined from 'mongo::mozjs::JSStringWrapper::JSStringWrapper(int32_t)' at src/mongo/scripting/mozjs/jsstringwrapper.cpp:48:12:
/usr/include/aarch64-linux-gnu/bits/string_fortified.h:106:34: error: 'char* __builtin_strncpy(char*, const char*, long unsigned int)' specified bound 64 equals destination size [-Werror=stringop-truncation]
  106 |   return __builtin___strncpy_chk (__dest, __src, __len, __bos (__dest));
      |          ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors
scons: *** [build/59f4f0dd/mongo/scripting/mozjs/jsstringwrapper.o] Error 1
scons: building terminated because of errors.
build/59f4f0dd/mongo/scripting/mozjs/jsstringwrapper.o failed: Error 1

Check another Version “r5.1.0-rc0” and it build successfully. But I need version 5.0. for local environment.

My system:

Linux version 5.15.0-1028-aws (buildd@bos02-arm64-060) (gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #32~20.04.1-Ubuntu SMP Mon Jan 9 18:02:12 UTC 2023

Could you help me? How can i build mongod?

FIxed error with adding " --disable-warnings-as-errors" to build command:
python3 buildscripts/ -j 3 DESTDIR=/var/opt/mongo install-mongod --disable-warnings-as-errors

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.