Skip to content

Commit b5f3c8e

Browse files
committed
Bump libmongoc to 2.0.1 and libmongocrypt to 1.14.0
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
1 parent db442b0 commit b5f3c8e

36 files changed

+254
-190
lines changed

.evergreen/compile-unix.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ if [ -n "$LIBMONGOC_VERSION" ]; then
7272
echo "Finding Python3 binary... done."
7373

7474
php scripts/update-submodule-sources.php
75-
76-
# We invoke python manually as it may not be in the path
77-
pushd src/libmongoc/
78-
$PYTHON build/calc_release_version.py > ../LIBMONGOC_VERSION_CURRENT
79-
popd
8075
fi
8176

8277
phpize

.evergreen/config/functions.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ functions:
140140
echo "Checking out libmongoc version: ${LIBMONGOC_VERSION}"
141141
git fetch
142142
git checkout ${LIBMONGOC_VERSION}
143-
# Note: compile-unix.sh will run `make libmongoc-version-current`
144143
fi
145144
- command: subprocess.exec
146145
type: test

.evergreen/config/generate-config.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@
2121
'4.2',
2222
];
2323

24-
// TODO: Change when PHP 8.4 is stable
25-
// $latestPhpVersion = max($phpVersions);
26-
$latestPhpVersion = '8.3';
24+
$latestPhpVersion = max($phpVersions);
2725

2826
// Only test the latest PHP version for libmongoc
2927
$libmongocBuildPhpVersions = [ $latestPhpVersion ];

.evergreen/config/generated/build/build-libmongoc.yml

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/generated/test-variant/libmongoc.yml

Lines changed: 15 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.evergreen/config/templates/build/build-libmongoc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
- func: "compile driver"
1111
vars:
1212
PHP_VERSION: "%phpVersion%"
13-
LIBMONGOC_VERSION: "1.30.1"
13+
LIBMONGOC_VERSION: "2.0.1"
1414
- func: "upload build"
1515

1616
- name: "build-php-%phpVersion%-libmongoc-next-stable"
@@ -19,7 +19,7 @@
1919
- func: "compile driver"
2020
vars:
2121
PHP_VERSION: "%phpVersion%"
22-
LIBMONGOC_VERSION: "r1.30"
22+
LIBMONGOC_VERSION: "r2.0"
2323
- func: "upload build"
2424

2525
- name: "build-php-%phpVersion%-libmongoc-latest"

CONTRIBUTING.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ always refer to libmongoc.
203203
```shell
204204
cd src/libmongoc
205205
git fetch
206-
git checkout 1.20.0
206+
git checkout 2.1.0
207207
```
208208

209209
During development, it may be necessary to temporarily point the submodule to a
@@ -218,24 +218,16 @@ git submodules set-url src/libmongoc https://github.com/<owner>/<repo>.git
218218
git submodules set-branch -b <branch> src/libmongoc
219219
```
220220

221-
#### Ensure version information is correct
221+
#### Ensure version information is correct (libmongocrypt only)
222222

223-
Various build processes and tools rely on the version files to infer version
224-
information. This file can be regenerated using Makefile targets:
223+
For libmongocrypt, version information needs to be updated after updating to
224+
a newer submodule version. This can be done by running the corresponding make
225+
target:
225226

226227
```shell
227-
make libmongoc-version-current
228+
make libmongocrypt-version-current
228229
```
229230

230-
Alternatively, the `build/calc_release_version.py` script in the submodule can
231-
be executed directly.
232-
233-
Note: If the submodule points to a non-release, non-master branch, the script
234-
may fail to correctly detect the version. This issue is being tracked in
235-
[CDRIVER-3315](https://jira.mongodb.org/browse/CDRIVER-3315) and can be safely ignored since this should only happen
236-
during development (any PHP driver release should point to a tagged submodule
237-
version).
238-
239231
#### Update sources in build configurations
240232

241233
The Autotools and Windows build configurations (`config.m4` and `config.w32`,
@@ -261,11 +253,11 @@ libmongoc and libbson.
261253
For example, the following lines might be updated for libmongoc:
262254

263255
```
264-
if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.20.0; then
256+
if $PKG_CONFIG mongoc2 --atleast-version 2.1.0; then
265257
266258
...
267259
268-
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.20.0)
260+
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 2.1.0)
269261
```
270262

271263
#### Update tested versions in Evergreen configuration (libmongoc only)
@@ -277,7 +269,7 @@ information about the build tasks and where they are used. In general, we test
277269
against two additional versions of libmongoc:
278270

279271
- The upcoming patch release of the current libmongoc minor version (e.g. the
280-
`r1.x` branch)
272+
`r2.x` branch)
281273
- The upcoming minor release of libmongoc (e.g. the `master` branch)
282274

283275
#### Update sources in PECL package generation script
@@ -307,5 +299,6 @@ test suite passes. Once done, commit the changes to all of the above
307299
files/paths. For example:
308300

309301
```shell
310-
git commit -m "Bump libmongoc to 1.20.0" config.m4 config.w32 src/libmongoc src/LIBMONGOC_VERSION_CURRENT sbom.json
302+
git commit -m "Bump libmongoc to 2.1.0" config.m4 config.w32 src/libmongoc sbom.
303+
json
311304
```

Makefile.frag

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.PHONY: mv-coverage lcov-coveralls lcov-local coverage coveralls format format-changed format-check test-clean package package.xml libmongoc-version-current libmongocrypt-version-current generate-function-map
1+
.PHONY: mv-coverage lcov-coveralls lcov-local coverage coveralls format format-changed format-check test-clean package package.xml libmongocrypt-version-current generate-function-map
22

33
ifneq (,$(realpath $(EXTENSION_DIR)/json.so))
44
PHP_TEST_SHARED_EXTENSIONS := "-d" "extension=$(EXTENSION_DIR)/json.so" $(PHP_TEST_SHARED_EXTENSIONS)
@@ -63,9 +63,6 @@ package:
6363
package.xml:
6464
php bin/prep-release.php $(MONGODB_VERSION) $(MONGODB_STABILITY) $(RELEASE_NOTES_FILE)
6565

66-
libmongoc-version-current:
67-
cd src/libmongoc/ && python build/calc_release_version.py > ../LIBMONGOC_VERSION_CURRENT
68-
6966
libmongocrypt-version-current:
7067
cd src/libmongocrypt/ && python etc/calc_release_version.py > ../LIBMONGOCRYPT_VERSION_CURRENT
7168

bin/prep-release.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ function get_files() {
3939
"scripts/autotools/*/*.{m4}",
4040

4141
"src/*.{c,h}",
42-
"src/LIBMONGOC_VERSION_CURRENT",
4342
"src/LIBMONGOCRYPT_VERSION_CURRENT",
4443

4544
"src/MongoDB/*.{c,h}",
@@ -49,6 +48,8 @@ function get_files() {
4948
"src/contrib/*.{c,h}",
5049

5150
"src/libmongoc/src/common/src/*.{c,h,h.in}",
51+
// Note: src/libmongoc/src/common/src/mlib/ does not contain source files (as of libmongoc 2.0.1)
52+
"src/libmongoc/src/common/src/mlib/*.{c,h}",
5253
"src/libmongoc/src/kms-message/src/*.{c,h}",
5354
"src/libmongoc/src/kms-message/src/kms_message/*.{c,h}",
5455
"src/libmongoc/src/libbson/src/bson/*.{c,h,h.in}",
@@ -64,10 +65,12 @@ function get_files() {
6465
"src/libmongocrypt-compat/mongocrypt/*.{c,h}",
6566
"src/libmongocrypt/src/*.{c,h,h.in}",
6667
"src/libmongocrypt/src/crypto/*.{c,h}",
67-
// Note: src/libmongocrypt/src/mlib/ does not contain source files (as of libmongocrypt 1.3.1)
68+
"src/libmongocrypt/src/mlib/*.{c,h}",
69+
// Note: src/libmongocrypt/src/mlib/ does not contain source files (as of libmongocrypt 1.14.0)
6870
"src/libmongocrypt/src/mlib/*.h",
6971
"src/libmongocrypt/src/os_posix/*.{c,h}",
7072
"src/libmongocrypt/src/os_win/*.{c,h}",
73+
"src/libmongocrypt/src/unicode/*.{c,h}",
7174
"src/libmongocrypt/kms-message/src/*.{c,h}",
7275
"src/libmongocrypt/kms-message/src/kms_message/*.{c,h}",
7376
),

0 commit comments

Comments
 (0)