Skip to content

Update submodule sources when building driver #1520

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

Merged
merged 2 commits into from
Mar 11, 2024

Conversation

alcaeus
Copy link
Member

@alcaeus alcaeus commented Mar 7, 2024

This PR adds a call to update-submodule-sources.php when compiling against a different version of libmongoc than the bundled one. This helps avoid "symbol not found" errors when compiling with libmongoc latest with new files not included in the bundled stable release.

@alcaeus alcaeus requested a review from jmikola March 7, 2024 11:20
@alcaeus alcaeus self-assigned this Mar 7, 2024
@alcaeus alcaeus force-pushed the update-submodule-sources-on-build branch from 210a907 to b50a11b Compare March 7, 2024 11:52
# If we're testing a specific version of libmongoc, update submodule sources
if [ -n "$LIBMONGOC_VERSION" ]; then
php scripts/update-submodule-sources.php
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below we have a conditional for make libmongoc-version-current. I suppose that still needs to remain separate because phpize is what builds Makefile from Makefile.frag. So, at best, we could move that between the phpize and ./configure lines below.

And on a related note: the LIBMONGOC_VERSION_CURRENT file is actually referenced during ./configure to create the substitutions, so shouldn't we be running make libmongoc-version-current before ./configure? As-is, I don't think the compiled driver reports the correct version info.

Do you want to handle that in this same PR?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point: LIBMONGOC_VERSION_CURRENT is indeed referenced during ./configure, but we have to run ./configure in order to have the Makefile generated. To avoid that conundrum, I now call phpize and ./configure, then run make libmongoc-version-current before running ./configure again to generate the final Makefile that we're building with. It's a little messy but the only way to work around the issue.

Copy link
Member

@jmikola jmikola Mar 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wouldn't complain if you want to just manually run:

cd src/libmongoc/ && python build/calc_release_version.py > ../LIBMONGOC_VERSION_CURRENT

And then you can leave a comment in both places (the Evergreen config and Makefile.frag) indicating that we should update both instances if it needs to change down the line.

@alcaeus alcaeus force-pushed the update-submodule-sources-on-build branch from e39a388 to 73ea471 Compare March 8, 2024 11:57
@alcaeus alcaeus requested a review from jmikola March 8, 2024 11:59
Copy link
Member

@jmikola jmikola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I'll defer to you if you'd rather avoid the extra ./configure call.

@alcaeus alcaeus merged commit 8281451 into mongodb:v1.17 Mar 11, 2024
@alcaeus alcaeus deleted the update-submodule-sources-on-build branch March 11, 2024 09:09
@alcaeus
Copy link
Member Author

alcaeus commented Mar 18, 2024

Noted after merging that this takes care of PHPC-2006, so I'm linking that here.

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

Successfully merging this pull request may close these issues.

2 participants