git clone https://github.com/mongodb/mongo.git
cd mongo
git checkout r8.0.4
$ /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
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