Skip to content

Instantly share code, notes, and snippets.

@monperrus
Last active February 11, 2025 20:20
Show Gist options
  • Save monperrus/7881d03c8f7c0c13c24b631248467c03 to your computer and use it in GitHub Desktop.
Save monperrus/7881d03c8f7c0c13c24b631248467c03 to your computer and use it in GitHub Desktop.
notes on compiling mongodb v8 on Ubuntu 22 Jammy (Feb 2025)

git clone https://github.com/mongodb/mongo.git
cd mongo
git checkout r8.0.4

scons

$ /usr/bin/python3 -m pip install 'poetry==1.5.1'
# no leyring on a build machine
$ export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
$ /usr/bin/python3 -m poetry install --no-root --sync
$ pip install mongo_tooling_metrics psutil pyyaml cheetah3 retry
$ python3 buildscripts/scons.py --linked=gold 
or
$ python3 buildscripts/scons.py --linked=gold  -j2 for only using 2 cores


also needs 4 packes not in requirements pip install mongo_tooling_metrics psutil pyyaml cheetah3

Error: The recommended linker 'lld' is not supported with the current compiler configuration, you can try the 'gold' linker with '--linker=gold'.

Solution: python3 buildscripts/scons.py --linker=gold

bazel

you need to install bazel

 Failed to query remote execution capabilities: PERMISSION_DENIED: Failed to verify the TLS certificate

Explanation: the default config is for MongoDB employee, with a engflow config in .bazelrc Solution: $ bazel build --config=local

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment