Thanks for maintaining this package!
Had issues building cleanly until I changed the things below. If we require gcc14 to build i'd recommend not reading in CC etc. from /etc/makepkg.conf, otherwise the PKGBUILD tends to fail if these are set to something improper.
Further, some bazel esotericism to ensure proper compilers are used:
diff --git a/PKGBUILD b/PKGBUILD
index 41917f2..834ba65 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -79,16 +79,23 @@ prepare() {
build() {
cd "${srcdir}/mongo-r${pkgver}"
# Set gcc14 toolchain for Bazel to resolve C++ toolchain properly
- export CC="${CC:-gcc-14}"
- export CXX="${CXX:-g++-14}"
- export AR="${AR:-gcc-ar-14}"
-
+ export CC="gcc-14"
+ export CXX="g++-14"
+ export AR="gcc-ar-14"
+
# export BAZELISK_SKIP_WRAPPER=1
# export MONGO_BAZEL_WRAPPER_DEBUG=1
export USE_NATIVE_TOOLCHAIN=1
+ # Bazel's autodetected host/exec C++ toolchain (@local_config_cc) is generated
+ # once and cached in ~/.cache/bazel (outside srcdir, so makepkg -C never clears
+ # it). A stale cache can pin the "gcc" tool slot to clang, which then compiles
+ # exec-config targets (e.g. grpc codegen tools) with clang regardless of CC.
+ # Expunge so @local_config_cc is regenerated with the CC/CXX below.
+ bazelisk clean --expunge
+
# core does not build the mongo shell (jstestshell)
# bazelisk build install-core
@@ -108,6 +115,7 @@ build() {
--repo_env=CXX="${CXX}" \
--repo_env=AR="${AR}" \
--repo_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=0 \
+ --//bazel/config:compiler_type=gcc \
--cxxopt='-std=c++20' \
--host_cxxopt='-std=c++20' \
--cxxopt='-w' \
Pinned Comments
pricechrispy commented on 2025-11-09 20:45 (UTC)
Current releases https://www.mongodb.com/try/download/community
pricechrispy commented on 2025-10-03 16:59 (UTC)
Before upgrading to 8.2, you must set the feature compatibility version to 8.0. See documentation: https://www.mongodb.com/docs/manual/release-notes/8.2-upgrade-standalone/#feature-compatibility-version
Note that building takes about 84gb of memory as of 8.2.1.