Skip to content

Bump libmongoc, libmongocrypt and get tests running #1828

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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .evergreen/compile-unix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ if [ -n "$LIBMONGOC_VERSION" ]; then
echo "Finding Python3 binary... done."

php scripts/update-submodule-sources.php

# We invoke python manually as it may not be in the path
pushd src/libmongoc/
$PYTHON build/calc_release_version.py > ../LIBMONGOC_VERSION_CURRENT
popd
fi

phpize
Expand Down
1 change: 0 additions & 1 deletion .evergreen/config/functions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ functions:
echo "Checking out libmongoc version: ${LIBMONGOC_VERSION}"
git fetch
git checkout ${LIBMONGOC_VERSION}
# Note: compile-unix.sh will run `make libmongoc-version-current`
fi
- command: subprocess.exec
type: test
Expand Down
4 changes: 1 addition & 3 deletions .evergreen/config/generate-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
'4.2',
];

// TODO: Change when PHP 8.4 is stable
// $latestPhpVersion = max($phpVersions);
$latestPhpVersion = '8.3';
$latestPhpVersion = max($phpVersions);

// Only test the latest PHP version for libmongoc
$libmongocBuildPhpVersions = [ $latestPhpVersion ];
Expand Down
22 changes: 11 additions & 11 deletions .evergreen/config/generated/build/build-libmongoc.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 15 additions & 15 deletions .evergreen/config/generated/test-variant/libmongoc.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .evergreen/config/templates/build/build-libmongoc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
- func: "compile driver"
vars:
PHP_VERSION: "%phpVersion%"
LIBMONGOC_VERSION: "1.30.1"
LIBMONGOC_VERSION: "2.0.1"
- func: "upload build"

- name: "build-php-%phpVersion%-libmongoc-next-stable"
Expand All @@ -19,7 +19,7 @@
- func: "compile driver"
vars:
PHP_VERSION: "%phpVersion%"
LIBMONGOC_VERSION: "r1.30"
LIBMONGOC_VERSION: "r2.0"
- func: "upload build"

- name: "build-php-%phpVersion%-libmongoc-latest"
Expand Down
29 changes: 11 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ always refer to libmongoc.
```shell
cd src/libmongoc
git fetch
git checkout 1.20.0
git checkout 2.1.0
```

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

#### Ensure version information is correct
#### Ensure version information is correct (libmongocrypt only)

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

```shell
make libmongoc-version-current
make libmongocrypt-version-current
```

Alternatively, the `build/calc_release_version.py` script in the submodule can
be executed directly.

Note: If the submodule points to a non-release, non-master branch, the script
may fail to correctly detect the version. This issue is being tracked in
[CDRIVER-3315](https://jira.mongodb.org/browse/CDRIVER-3315) and can be safely ignored since this should only happen
during development (any PHP driver release should point to a tagged submodule
version).

#### Update sources in build configurations

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

```
if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.20.0; then
if $PKG_CONFIG mongoc2 --atleast-version 2.1.0; then

...

AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.20.0)
AC_MSG_ERROR(system libmongoc must be upgraded to version >= 2.1.0)
```

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

- The upcoming patch release of the current libmongoc minor version (e.g. the
`r1.x` branch)
`r2.x` branch)
- The upcoming minor release of libmongoc (e.g. the `master` branch)

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

```shell
git commit -m "Bump libmongoc to 1.20.0" config.m4 config.w32 src/libmongoc src/LIBMONGOC_VERSION_CURRENT sbom.json
git commit -m "Bump libmongoc to 2.1.0" config.m4 config.w32 src/libmongoc sbom.
json
```
5 changes: 1 addition & 4 deletions Makefile.frag
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.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
.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

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

libmongoc-version-current:
cd src/libmongoc/ && python build/calc_release_version.py > ../LIBMONGOC_VERSION_CURRENT

libmongocrypt-version-current:
cd src/libmongocrypt/ && python etc/calc_release_version.py > ../LIBMONGOCRYPT_VERSION_CURRENT

Expand Down
7 changes: 5 additions & 2 deletions bin/prep-release.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ function get_files() {
"scripts/autotools/*/*.{m4}",

"src/*.{c,h}",
"src/LIBMONGOC_VERSION_CURRENT",
"src/LIBMONGOCRYPT_VERSION_CURRENT",

"src/MongoDB/*.{c,h}",
Expand All @@ -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}",
"src/libmongoc/src/kms-message/src/*.{c,h}",
"src/libmongoc/src/kms-message/src/kms_message/*.{c,h}",
"src/libmongoc/src/libbson/src/bson/*.{c,h,h.in}",
Expand All @@ -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}",
// Note: src/libmongocrypt/src/mlib/ does not contain source files (as of libmongocrypt 1.14.0)
"src/libmongocrypt/src/mlib/*.h",
"src/libmongocrypt/src/os_posix/*.{c,h}",
"src/libmongocrypt/src/os_win/*.{c,h}",
"src/libmongocrypt/src/unicode/*.{c,h}",
"src/libmongocrypt/kms-message/src/*.{c,h}",
"src/libmongocrypt/kms-message/src/kms_message/*.{c,h}",
),
Expand Down
Loading
Loading