diff --git a/.evergreen/config.yml b/.evergreen/config.yml index 495e2a255..70f9b5db0 100644 --- a/.evergreen/config.yml +++ b/.evergreen/config.yml @@ -1158,17 +1158,17 @@ axes: display_name: libmongoc version values: - id: "lowest-supported" - display_name: "1.23.1" - variables: - LIBMONGOC_VERSION: "1.23.1" - - id: "upcoming-stable" - display_name: "1.23-dev" - variables: - LIBMONGOC_VERSION: "r1.23" - - id: "latest-dev" - display_name: "master" + display_name: "1.24-dev" variables: LIBMONGOC_VERSION: "master" +# - id: "upcoming-stable" +# display_name: "1.24-dev" +# variables: +# LIBMONGOC_VERSION: "r1.24" +# - id: "latest-dev" +# display_name: "master" +# variables: +# LIBMONGOC_VERSION: "master" buildvariants: diff --git a/config.m4 b/config.m4 index 91e50feb1..a73edc450 100644 --- a/config.m4 +++ b/config.m4 @@ -5,6 +5,13 @@ PHP_ARG_ENABLE([mongodb], [Enable MongoDB support])]) if test "$PHP_MONGODB" != "no"; then + dnl Enable C99 (required for libmongoc 1.24+) + AC_PROG_CC_C99 + + if test "$ac_cv_prog_cc_c99" = no; then + AC_MSG_ERROR([Compiler does not support C99]) + fi + dnl Check PHP version is compatible with this extension AC_MSG_CHECKING([PHP version]) @@ -243,14 +250,14 @@ if test "$PHP_MONGODB" != "no"; then AC_PATH_PROG(PKG_CONFIG, pkg-config, no) AC_MSG_CHECKING(for libbson) if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libbson-1.0; then - if $PKG_CONFIG libbson-1.0 --atleast-version 1.23.1; then + if $PKG_CONFIG libbson-1.0 --atleast-version 1.24.0; then PHP_MONGODB_BSON_CFLAGS=`$PKG_CONFIG libbson-1.0 --cflags` PHP_MONGODB_BSON_LIBS=`$PKG_CONFIG libbson-1.0 --libs` PHP_MONGODB_BSON_VERSION=`$PKG_CONFIG libbson-1.0 --modversion` PHP_MONGODB_BSON_VERSION_STRING="System ($PHP_MONGODB_BSON_VERSION)" AC_MSG_RESULT(version $PHP_MONGODB_BSON_VERSION found) else - AC_MSG_ERROR(system libbson must be upgraded to version >= 1.23.1) + AC_MSG_ERROR(system libbson must be upgraded to version >= 1.24.0) fi else AC_MSG_ERROR(pkgconfig and libbson must be installed) @@ -261,14 +268,14 @@ if test "$PHP_MONGODB" != "no"; then AC_MSG_CHECKING(for libmongoc) if test -x "$PKG_CONFIG" && $PKG_CONFIG --exists libmongoc-1.0; then - if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.23.1; then + if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.24.0; then PHP_MONGODB_MONGOC_CFLAGS=`$PKG_CONFIG libmongoc-1.0 --cflags` PHP_MONGODB_MONGOC_LIBS=`$PKG_CONFIG libmongoc-1.0 --libs` PHP_MONGODB_MONGOC_VERSION=`$PKG_CONFIG libmongoc-1.0 --modversion` PHP_MONGODB_MONGOC_VERSION_STRING="System ($PHP_MONGODB_MONGOC_VERSION)" AC_MSG_RESULT(version $PHP_MONGODB_MONGOC_VERSION found) else - AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.23.1) + AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.24.0) fi else AC_MSG_ERROR(pkgconfig and libmongoc must be installed) @@ -308,8 +315,7 @@ if test "$PHP_MONGODB" != "no"; then if test "$PHP_MONGODB_SYSTEM_LIBS" = "no"; then PHP_MONGODB_BUNDLED_CFLAGS="$STD_CFLAGS -DBSON_COMPILATION -DMONGOC_COMPILATION" - dnl TODO: MONGOCRYPT-219 makes the -std argument obsolete - PHP_MONGODB_LIBMONGOCRYPT_CFLAGS="-DKMS_MSG_STATIC -DMLIB_USER -std=gnu99" + PHP_MONGODB_LIBMONGOCRYPT_CFLAGS="-DKMS_MSG_STATIC -DMLIB_USER" PHP_MONGODB_ZLIB_CFLAGS="" dnl M4 doesn't know if we're building statically or as a shared module, so @@ -406,7 +412,7 @@ if test "$PHP_MONGODB" != "no"; then PHP_MONGODB_JSONSL_SOURCES="jsonsl.c" dnl Generated with: find src/libmongoc/src/libmongoc/src/mongoc -name '*.c' -print0 | cut -sz -d / -f 7- | sort -dz | tr '\000' ' ' - PHP_MONGODB_MONGOC_SOURCES="mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-error.c mongoc-find-and-modify.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-command-legacy.c mongoc-write-concern.c" + PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-error.c mongoc-find-and-modify.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-command-legacy.c mongoc-write-concern.c service-gcp.c" dnl Generated with: find src/libmongoc/src/zlib-1.2.12 -maxdepth 1 -name '*.c' -print0 | cut -sz -d / -f 5- | sort -dz | tr '\000' ' ' PHP_MONGODB_ZLIB_SOURCES="adler32.c compress.c crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c" @@ -537,6 +543,7 @@ if test "$PHP_MONGODB" != "no"; then mongodb was configured with the following options: Build configuration: + CC : $CC CFLAGS : $CFLAGS Extra CFLAGS : $STD_CFLAGS $EXTRA_CFLAGS Developers flags (slow) : $MAINTAINER_CFLAGS diff --git a/config.w32 b/config.w32 index fa6b20da8..6e1f7ac55 100644 --- a/config.w32 +++ b/config.w32 @@ -117,7 +117,7 @@ if (PHP_MONGODB != "no") { var PHP_MONGODB_JSONSL_SOURCES="jsonsl.c"; // Generated with: find src/libmongoc/src/libmongoc/src/mongoc -name '*.c' -print0 | cut -sz -d / -f 7- | sort -dz | tr '\000' ' ' - var PHP_MONGODB_MONGOC_SOURCES="mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-error.c mongoc-find-and-modify.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-command-legacy.c mongoc-write-concern.c"; + var PHP_MONGODB_MONGOC_SOURCES="mcd-azure.c mongoc-aggregate.c mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-change-stream.c mongoc-client.c mongoc-client-pool.c mongoc-client-session.c mongoc-client-side-encryption.c mongoc-cluster-aws.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.c mongoc-crypt.c mongoc-crypto.c mongoc-crypto-cng.c mongoc-crypto-common-crypto.c mongoc-crypto-openssl.c mongoc-cursor-array.c mongoc-cursor.c mongoc-cursor-change-stream.c mongoc-cursor-cmd.c mongoc-cursor-cmd-deprecated.c mongoc-cursor-find.c mongoc-cursor-find-cmd.c mongoc-cursor-find-opquery.c mongoc-cursor-legacy.c mongoc-cyrus.c mongoc-database.c mongoc-error.c mongoc-find-and-modify.c mongoc-generation-map.c mongoc-gridfs-bucket.c mongoc-gridfs-bucket-file.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-handshake.c mongoc-host-list.c mongoc-http.c mongoc-index.c mongoc-init.c mongoc-interrupt.c mongoc-libressl.c mongoc-linux-distro-scanner.c mongoc-list.c mongoc-log.c mongoc-matcher.c mongoc-matcher-op.c mongoc-memcmp.c mongoc-ocsp-cache.c mongoc-openssl.c mongoc-optional.c mongoc-opts.c mongoc-opts-helpers.c mongoc-queue.c mongoc-rand-cng.c mongoc-rand-common-crypto.c mongoc-rand-openssl.c mongoc-read-concern.c mongoc-read-prefs.c mongoc-rpc.c mongoc-sasl.c mongoc-scram.c mongoc-secure-channel.c mongoc-secure-transport.c mongoc-server-api.c mongoc-server-description.c mongoc-server-monitor.c mongoc-server-stream.c mongoc-set.c mongoc-shared.c mongoc-socket.c mongoc-ssl.c mongoc-sspi.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.c mongoc-stream-gridfs-download.c mongoc-stream-gridfs-upload.c mongoc-stream-socket.c mongoc-stream-tls.c mongoc-stream-tls-libressl.c mongoc-stream-tls-openssl-bio.c mongoc-stream-tls-openssl.c mongoc-stream-tls-secure-channel.c mongoc-stream-tls-secure-transport.c mongoc-timeout.c mongoc-topology-background-monitoring.c mongoc-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-ts-pool.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-command-legacy.c mongoc-write-concern.c service-gcp.c"; EXTENSION("mongodb", "php_phongo.c", null, PHP_MONGODB_CFLAGS); MONGODB_ADD_SOURCES("/src", "phongo_apm.c phongo_bson.c phongo_bson_encode.c phongo_client.c phongo_compat.c phongo_error.c phongo_execute.c phongo_ini.c phongo_util.c"); diff --git a/scripts/autotools/CheckCompiler.m4 b/scripts/autotools/CheckCompiler.m4 index 11f42ad0e..906021d67 100644 --- a/scripts/autotools/CheckCompiler.m4 +++ b/scripts/autotools/CheckCompiler.m4 @@ -11,6 +11,10 @@ fi AC_PROG_CC AC_PROG_CXX +dnl AC_PROG_CC_C99 is previously called in config.m4, but AC_PROG_CC resets CC +dnl so call it once more to ensure C99 remains enabled +AC_PROG_CC_C99 + # Check that an appropriate C compiler is available. c_compiler="unknown" AC_LANG_PUSH([C]) diff --git a/src/LIBMONGOC_VERSION_CURRENT b/src/LIBMONGOC_VERSION_CURRENT index 49e0a31d4..839c4332d 100644 --- a/src/LIBMONGOC_VERSION_CURRENT +++ b/src/LIBMONGOC_VERSION_CURRENT @@ -1 +1 @@ -1.23.1 +1.24.0-20221129+gite507fc90ff diff --git a/src/libmongoc b/src/libmongoc index 629161ed5..e507fc90f 160000 --- a/src/libmongoc +++ b/src/libmongoc @@ -1 +1 @@ -Subproject commit 629161ed57cb98c1c75ca6e350e7b5900245ced3 +Subproject commit e507fc90ffe1f4571c5cb45d36ca8b86459a616e diff --git a/tests/manager/manager-ctor-read_preference-error-001.phpt b/tests/manager/manager-ctor-read_preference-error-001.phpt index a7290fc51..cbb500369 100644 --- a/tests/manager/manager-ctor-read_preference-error-001.phpt +++ b/tests/manager/manager-ctor-read_preference-error-001.phpt @@ -48,7 +48,7 @@ echo throws(function() { --EXPECT-- OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?readPreference=1'. Unsupported readPreference value [readPreference=1]. +Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?readPreference=1'. Error while assigning URI read preference: Unsupported readPreference value [readPreference=1]. OK: Got MongoDB\Driver\Exception\InvalidArgumentException Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?readPreference=secondary&readPreferenceTags=invalid'. Unsupported value for "readPreferenceTags": "invalid". OK: Got MongoDB\Driver\Exception\InvalidArgumentException diff --git a/tests/manager/manager-ctor-write_concern-error-005.phpt b/tests/manager/manager-ctor-write_concern-error-005.phpt index c8e55fb42..5e95c9bf8 100644 --- a/tests/manager/manager-ctor-write_concern-error-005.phpt +++ b/tests/manager/manager-ctor-write_concern-error-005.phpt @@ -58,9 +58,9 @@ Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?journal=invalid'. Unsupported OK: Got MongoDB\Driver\Exception\InvalidArgumentException Expected boolean for "journal" URI option, string given OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?w=-1&journal=true'. Journal conflicts with w value [w=-1]. +Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?w=-1&journal=true'. Error while parsing the 'w' URI option: Journal conflicts with w value [w=-1]. OK: Got MongoDB\Driver\Exception\InvalidArgumentException -Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?w=0&journal=true'. Journal conflicts with w value [w=0]. +Failed to parse MongoDB URI: 'mongodb://127.0.0.1/?w=0&journal=true'. Error while parsing the 'w' URI option: Journal conflicts with w value [w=0]. OK: Got MongoDB\Driver\Exception\InvalidArgumentException Journal conflicts with w value: -1 OK: Got MongoDB\Driver\Exception\InvalidArgumentException