Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Readme updates required, mongo has moved to (python) poetry dependency management #11

Open
JedMeister opened this issue Nov 29, 2023 · 2 comments

Comments

@JedMeister
Copy link

It looks like mongo has moved to (python) poetry packaging. So the notes in this project readme referring to installing deps via pip needs an update.

It looks like the upstream build docs have been updated to reflect this. But I didn't actually think to check there first so the below is me just "following my nose". It may not be best the approach but it worked for me (on Debian 12/Bookworm). (Note at this point it has only been building for an hour, so perhaps there are still issues?)

Despite the mongo build docs, poetry themselves recommend NOT installing poetry in the build venv. Installing via pipx is probably best in this case (at least IMO), so my initial (Debian 12/Bookworm) dependency list is:

# replace python3-venv and python3-pip with pipx (note python3-venv is a dep of pipx - so will still be installed)
pipx python-dev-is-python3 libssl-dev build-essential libcurl4-openssl-dev liblzma-dev

In my (somewhat limited) experience with poetry, I suspect that it would likely work with any recent version. Regardless, to minimise unexpected issues, I grepped the poetry.lock file in the mongo dir for the specific version upstream are using (I note that the version is explicitly mentioned in the build readme linked above - but IMO better to consult the actual source):

# clone repo ...
cd mongodb-without-avx/mongo
poetry_version=$(grep 'name = "poetry"' -A1 poetry.lock | sed -En '\|^version|s|.*"([0-9\.]+)".*|\1|p')
pipx install poetry=="$poetry_version"
# ensure poetry is in the PATH for this session (to make permanent add to ~/.bashrc)
which poetry || export PATH="~/.local/bin:$PATH"

Install python build deps via poetry:

poetry install

Then enter poetry shell (activate the poetry venv that was created for the deps):

poetry shell

Apply relevant patch and run build script

patch -p1 SConstruct < ../o2_patch.diff
python3 buildscripts/scons.py -j 2 --linker=gold --disable-warnings-as-errors install-mongod | tee build.log

I was going to open a PR to apply the changes myself, but I am only using Debian and aren't sure that my notes here are the best way. If you'd like me to suggest some specific changes, please give me a bit of guidance and I'll try to circle back some time soon.

@scottmonster
Copy link

@JedMeister after reading through the issues and finding this I've got it building right now. Many thanks! Any way I can get a quick explanation on what exactly "--linker=gold" does? I tried googling but came up short.

@JedMeister
Copy link
Author

@scottmonster Glad to hear my post was useful! 😁

Any way I can get a quick explanation on what exactly "--linker=gold" does?

Here is some reading re Gold linker:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants