I'm trying to build an older version of Mongod on Arch Linux. It's required by software called Deadline that I intend to use; Deadline's documentation says the following: "For maximum compatibility with Deadline, we recommend you use MongoDB version 5.0.0 through 6.0.16."
I followed Mongodb's build instructions (here) and tried to build v6.0.16 as well as v.6.0.15 and in both cases I have ended up with this specific error:
Compiling build/59f4f0dd/third_party/icu4c-57.1/source/common/unormcmp.o In file included from src/third_party/boost/libs/thread/src/pthread/thread.cpp:19: src/third_party/boost/boost/thread/future.hpp: In member function 'boost::detail::run_it<FutureExecutorContinuationSharedState>& boost::detail::run_it<FutureExecutorContinuationSharedState>:operator=(boost::detail::run_it<FutureExecutorContinuationSharedState>&&)': src/third_party/boost/boost/thread/future.hpp:4672:19: error: 'struct boost::detail::run_it<FutureExecutorContinuationSharedState>' has no member named 'that'; did you mean 'that_'? [-Wtemplate-body] 4672 | that_=x.that; | ^~~~ | that_
I have tried building it with gcc15, gcc12 and gcc8, with no success.
Here's my latest PKGBUILD that I use to do this. It demonstrates my exact steps:
pkgname=mongod
pkgver=6.0.15
pkgrel=1
pkgdesc="MongoDB Database Server (mongod) built from source"
arch=('x86_64')
url="https://www.mongodb.com"
license=('SSPL')
depends=()
makedepends=('python37' 'gcc' 'curl' 'xz')
source=("https://github.com/mongodb/mongo/archive/refs/tags/r${pkgver}.tar.gz"
"fix-ctype-include.patch")
sha256sums=('2e5ed9326182b9c1cfa8e85e0e67f35f840fd6e2390e88198a185e822eb29275'
'c994338420b3302c27af5ee59836cb66787c45f1ad72bf41dad32ab35c437165')
prepare() {
cd "$srcdir/mongo-r${pkgver}"
patch -p0 < "$srcdir/../fix-ctype-include.patch"
}
build() {
cd "$srcdir/mongo-r${pkgver}"
python3.7 -m venv venv
source venv/bin/activate
python3.7 -m pip install --upgrade pip setuptools wheel
python3.7 -m pip install -r etc/pip/compile-requirements.txt
local jobs=$(echo $MAKEFLAGS | grep -oP '(?<=-j)\d+' || echo $(( $(nproc) / 2 )))
python3.7 buildscripts/scons.py install-mongod \
--disable-warnings-as-errors \
-j${jobs} \
MONGO_VERSION=${pkgver} \
LINKFLAGS="-static-libstdc++ -static-libgcc"
deactivate
}
package() {
cd "$srcdir/mongo-r${pkgver}"
install -Dm755 build/install/bin/mongod "$pkgdir/usr/bin/mongod"
}
How can I get past this error?
Solution: there is a typo in a boost file, specifically here in src/third_party/boost/boost/thread/future.hpp line 4672:
that_=x.that; needs to be changed to that_=x.that_;