[CXX-2420] Compile failure on Ubuntu-21.10 Created: 10/Dec/21  Updated: 22/Dec/21  Resolved: 22/Dec/21

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Unknown
Reporter: Alessandro Rosetti Assignee: Kevin Albertson
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates CXX-2358 Compilation failure (tests) with glib... Closed

 Description   

Summary

Compiling the library fails using ubuntu 21.10

Environment

MongoCXX Version 3.6.6, 3.6.5, 3.6.4

Compilers tested: gcc-11, clang-13

 

In file included from /usr/include/signal.h:328,
                 from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:8034,
                 from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/main.cpp:16:
/tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:10822:58: error: call to non-‘constexpr’ function ‘long int sysconf(int)’
10822  |     static constexpr std::size_t sigStackSize = 32768 >= MINSIGSTKSZ ? 32768 : MINSIGSTKSZ;
       |                                                          ^~~~~~~~~~~
In file included from /usr/include/x86_64-linux-gnu/bits/sigstksz.h:24,
                 from /usr/include/signal.h:328,
                 from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:8034,
                 from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/main.cpp:16:
/usr/include/unistd.h:640:17: note: ‘long int sysconf(int)’ declared here
  640 | extern long int sysconf (int __name) __THROW;
      |                 ^~~~~~~
In file included from /tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/main.cpp:16:
/tmp/mongo-cxx-driver-r3.6.6/src/third_party/catch/include/catch.hpp:10881:45: error: size of array ‘altStackMem’ is not an integral constant-expression
10881 |     char FatalConditionHandler::altStackMem[sigStackSize] = {};
      |                                             ^~~~~~~~~~~~

How to Reproduce

Compile with Ubuntu21.10

How I built it:

MONGO_CXX_VERSION="r3.6.6"MONGO_CXX_VERSION="r3.6.6"
MONGO_CXX_DIR="mongo-cxx-driver-${MONGO_CXX_VERSION}"
MONGO_CXX_TAR="${MONGO_CXX_DIR}.tar.gz"
MONGO_CXX_URL="https://github.com/mongodb/mongo-cxx-driver/releases/download/${MONGO_CXX_VERSION}/${MONGO_CXX_TAR}"
curl -OL ${MONGO_CXX_URL} && tar -xzf ${MONGO_CXX_TAR} && cd ${MONGO_CXX_DIR}/build && cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DENABLE_TESTS=off  && cmake --build . && cmake --build . --target install

Additional Background

Seems to be related to a libc update.

Also the initial cmake command seems to now be requiring root permissions,  previously only the cmake with --target install



 Comments   
Comment by Kevin Albertson [ 22/Dec/21 ]

Duplicate of CXX-2358. Catch2 is updated to v2.13.7 in the upcoming 3.7.0 release.

Comment by Kevin Albertson [ 12/Dec/21 ]

Thank you for the report alessandro.rosetti@gmail.com. We will look into this soon.

Generated at Wed Feb 07 22:05:52 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.