-
Notifications
You must be signed in to change notification settings - Fork 208
PHPC-2435: Support libmongoc 2.0 #1829
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
Conversation
This fixes the following issues: * PHPC-2581: Bump to libmongoc 2.0.1 * PHPC-2578: Bump to libmongocrypt 1.14.0 * PHPC-2548: Remove MONGOC_WRITE_CONCERN_W_ERRORS_IGNORED * PHPC-2540: Use const for mongoc_host_list_t * PHPC-2547: Remove MONGOC_NO_AUTOMATIC_GLOBALS * PHPC-2549: Remove BSON_EXTRA_ALIGN * PHPC-1548: Add tests for empty authSource URI option * PHPC-2542: Add test coverage for auth mechanism errors
9ef16ef
to
b5f3c8e
Compare
* Add build action to build libmongoc system libraries * Build driver with system libs * Install libmongocrypt as system library * Run tests with system libs * Move system library tests to tests workflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR updates the PHP driver to support libmongoc 2.x along with corresponding version bumps for libmongocrypt and the mongo-c-driver, and removes support for LibreSSL.
- Updated file paths for version retrieval (e.g. from LIBMONGOC_VERSION_CURRENT to src/libmongoc/VERSION_CURRENT)
- Bumped version numbers throughout configuration files, SBOM, CI workflows, and contributor documentation
- Removed LibreSSL support from SSL configuration in autotools
Reviewed Changes
Copilot reviewed 47 out of 47 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
scripts/update-sbom.sh | Updated LIBMONGOC_VERSION file location |
scripts/autotools/libmongocrypt/CheckSSL.m4 | Removed LibreSSL in favor of using only OpenSSL and Darwin |
scripts/autotools/libmongoc/Versions.m4 | Updated version file path reference |
scripts/autotools/libmongoc/CheckSSL.m4 | Refined SSL configuration logic |
scripts/autotools/libbson/Versions.m4 | Updated file path for BSON version file |
sbom.json | Bumped versions for libmongocrypt and mongo-c-driver |
config.w32 | Updated version file path and added extra include path |
config.m4 | Updated PKG_CHECK_MODULES call and version checks for system libs |
CONTRIBUTING.md | Revised instructions for checking out and bumping libmongoc version |
.github workflows & Evergreen configs | Updated CI jobs and actions to use new version numbers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with minor comments.
bin/prep-release.php
Outdated
@@ -49,6 +48,8 @@ function get_files() { | |||
"src/contrib/*.{c,h}", | |||
|
|||
"src/libmongoc/src/common/src/*.{c,h,h.in}", | |||
// Note: src/libmongoc/src/common/src/mlib/ does not contain source files (as of libmongoc 2.0.1) | |||
"src/libmongoc/src/common/src/mlib/*.{c,h}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"src/libmongoc/src/common/src/mlib/*.{c,h}", | |
"src/libmongoc/src/common/src/mlib/*.h", |
Remove unnecessary *.c
glob? I expect the purpose of the comment is to indicate there are no *.c
source files needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated - these are indeed not necessary (here and below).
bin/prep-release.php
Outdated
@@ -64,10 +65,12 @@ function get_files() { | |||
"src/libmongocrypt-compat/mongocrypt/*.{c,h}", | |||
"src/libmongocrypt/src/*.{c,h,h.in}", | |||
"src/libmongocrypt/src/crypto/*.{c,h}", | |||
// Note: src/libmongocrypt/src/mlib/ does not contain source files (as of libmongocrypt 1.3.1) | |||
"src/libmongocrypt/src/mlib/*.{c,h}", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"src/libmongocrypt/src/mlib/*.{c,h}", |
I expect this is redundant with the glob below for src/libmongocrypt/src/mlib/*.h
. The only *.c
source files are tests.
/* Note: Values of w < 0 are invalid, but libmongoc's URI string parsing only | ||
* logs a warning instead of raising an error (see: CDRIVER-2234), so we cannot | ||
* test for this. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment appears incorrect. libmongoc returns an error for unsupported values, e.g. w=-1
:
echo throws(function() {
create_test_manager("mongodb://localhost:27017/?w=-1", []);
}, "MongoDB\Driver\Exception\InvalidArgumentException"), "\n";
Results in output:
Failed to parse MongoDB URI: 'mongodb://localhost:27017/?w=-1'. Error while parsing the 'w' URI option: Unsupported w value [w=-1].
OK: Got MongoDB\Driver\Exception\InvalidArgumentException
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for pointing this out - I guess that comment was never updated after CDRIVER-2234 was fixed.
- name: Add repository | ||
shell: bash | ||
working-directory: /tmp | ||
# Note: no packages for Ubuntu 24.04 noble exist, so we use those for 22.04 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Note: no packages for Ubuntu 24.04 noble exist, so we use those for 22.04 | |
# Note: no packages for Ubuntu 24.04 noble exist, so we use those for 22.04. Update after MONGOCRYPT-813 is released. |
Aside: MONGOCRYPT-813 is planned for the next 1.14.1 patch release.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, I'll update this alongside 1.14.1 then :)
* Support building with SSPI support under Windows * Remove support for building with Cyrus SASL on Windows * Apply feedback from Copilot * Apply code review feedback * Fix handling of missing SASL libs when relying on default value for with-mongodb-sasl
PHPC-2435