Building Percona Server for MongoDB 8.0 from source

Hello, I’m trying to follow the instructions here Build from source code - Percona Server for MongoDB 8.0 to build mongodb server from source. The instruction is to use buildscripts/scons.py to build, but the v8.0 branch of percona-server-mongodb doesn’t have scons.py. Looks like the build was switched to use bazel at some point. Are there any updated instructions using bazel?

Hello @atalasu,

Thank you for submitting a question to the Percona Community Forum.

We haven’t had a chance yet to properly update our documentation regarding building Percona Server for MongoDB. Nevertheless, I can provide basic guidance for compiling an optimized statically linked version.

The overall procedure mostly remains the same, with some modifications as follows:

  • In the Build AWS Software… section:

    • omit item 2
    • replace item 3 with export AWS_LIBS=/usr
    • replace item 8 with sudo make install
  • In the Install Python… section, replace item 3 with

    python -m pip install 'poetry==2.0.0'
    export PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring
    
  • In the Build Percona Server for MongoDB section, use the following command:

    bazel build --config=psmdb_opt_release \
    --define=MONGO_VERSION=8.0.17-6 --define=GIT_COMMIT_HASH=UNKNOWN \
    install-dist-test
    

That will build mongod, mongos and some other targets.

Should you have any further questions or concerns, don’t hesitate to ask.