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
Version 1.3.0 fails to build against Docker php:7.1-fpm-alpine
#655
Comments
Okay folks, apparently the problem only occurs when Bash is not installed. I guess this is not a problem on most environments, except on minimalistic distros like Alpine which don’t have Bash installed by default. I guess we can close this? |
The diff --git a/config.m4 b/config.m4
index d25a1fa..556fb6c 100644
--- a/config.m4
+++ b/config.m4
@@ -153,19 +153,30 @@ if test "$MONGODB" != "no"; then
php_phongo.c \
phongo_compat.c \
src/bson.c \
+ src/bson-encode.c \
src/BSON/Binary.c \
+ src/BSON/BinaryInterface.c \
src/BSON/Decimal128.c \
+ src/BSON/Decimal128Interface.c \
src/BSON/Javascript.c \
+ src/BSON/JavascriptInterface.c \
src/BSON/MaxKey.c \
+ src/BSON/MaxKeyInterface.c \
src/BSON/MinKey.c \
- src/BSON/ObjectID.c \
+ src/BSON/MinKeyInterface.c \
+ src/BSON/ObjectId.c \
+ src/BSON/ObjectIdInterface.c \
src/BSON/Persistable.c \
src/BSON/Regex.c \
+ src/BSON/RegexInterface.c \
src/BSON/Serializable.c \
src/BSON/Timestamp.c \
+ src/BSON/TimestampInterface.c \
src/BSON/Type.c \
src/BSON/Unserializable.c \
src/BSON/UTCDateTime.c \
+ src/BSON/UTCDateTimeInterface.c \
+ src/BSON/functions.c \
src/MongoDB/BulkWrite.c \
src/MongoDB/Command.c \
src/MongoDB/Cursor.c \
@@ -191,6 +202,12 @@ if test "$MONGODB" != "no"; then
src/MongoDB/Exception/SSLConnectionException.c \
src/MongoDB/Exception/UnexpectedValueException.c \
src/MongoDB/Exception/WriteException.c \
+ src/MongoDB/Monitoring/CommandFailedEvent.c \
+ src/MongoDB/Monitoring/CommandStartedEvent.c \
+ src/MongoDB/Monitoring/CommandSubscriber.c \
+ src/MongoDB/Monitoring/CommandSucceededEvent.c \
+ src/MongoDB/Monitoring/Subscriber.c \
+ src/MongoDB/Monitoring/functions.c
"
PHP_ARG_WITH(libbson, whether to use system libbson,
@@ -206,13 +223,13 @@ if test "$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.5.0; then
+ if $PKG_CONFIG libbson-1.0 --atleast-version 1.8.0; then
LIBBSON_INC=`$PKG_CONFIG libbson-1.0 --cflags`
LIBBSON_LIB=`$PKG_CONFIG libbson-1.0 --libs`
LIBBSON_VER=`$PKG_CONFIG libbson-1.0 --modversion`
AC_MSG_RESULT(version $LIBBSON_VER found)
else
- AC_MSG_ERROR(system libbson must be upgraded to version >= 1.5.0)
+ AC_MSG_ERROR(system libbson must be upgraded to version >= 1.8.0)
fi
else
AC_MSG_ERROR(pkgconfig and libbson must be installed)
@@ -226,11 +243,11 @@ if test "$MONGODB" != "no"; then
# Generated with: find src/libbson/src/bson -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
PHP_MONGODB_BSON_SOURCES="bcon.c bson-atomic.c bson.c bson-clock.c bson-context.c bson-decimal128.c bson-error.c bson-iso8601.c bson-iter.c bson-json.c bson-keys.c bson-md5.c bson-memory.c bson-oid.c bson-reader.c bson-string.c bson-timegm.c bson-utf8.c bson-value.c bson-version-functions.c bson-writer.c"
- # Generated with: find src/libbson/src/yajl -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
- PHP_MONGODB_YAJL_SOURCES="yajl_alloc.c yajl_buf.c yajl.c yajl_encode.c yajl_gen.c yajl_lex.c yajl_parser.c yajl_tree.c yajl_version.c"
+ # Generated with: find src/libbson/src/jsonsl -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
+ PHP_MONGODB_JSONSL_SOURCES="jsonsl.c"
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libbson/src/bson], $PHP_MONGODB_BSON_SOURCES, $PHP_MONGODB_BSON_CFLAGS, shared_objects_mongodb, yes)
- PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libbson/src/yajl], $PHP_MONGODB_YAJL_SOURCES, $PHP_MONGODB_BSON_CFLAGS, shared_objects_mongodb, yes)
+ PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libbson/src/jsonsl], $PHP_MONGODB_JSONSL_SOURCES, $PHP_MONGODB_BSON_CFLAGS, shared_objects_mongodb, yes)
fi
AC_MSG_CHECKING(configuring libmongoc)
@@ -244,14 +261,14 @@ if test "$MONGODB" != "no"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
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.5.0; then
+ if $PKG_CONFIG libmongoc-1.0 --atleast-version 1.8.0; then
LIBMONGOC_INC=`$PKG_CONFIG libmongoc-1.0 --cflags`
LIBMONGOC_LIB=`$PKG_CONFIG libmongoc-1.0 --libs`
LIBMONGOC_VER=`$PKG_CONFIG libmongoc-1.0 --modversion`
AC_MSG_RESULT(version $LIBMONGOC_VER found)
else
- AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.5.0)
+ AC_MSG_ERROR(system libmongoc must be upgraded to version >= 1.8.0)
fi
else
AC_MSG_ERROR(pkgconfig and mongoc must be installed)
@@ -262,8 +279,8 @@ if test "$MONGODB" != "no"; then
else
PHP_MONGODB_MONGOC_CFLAGS="$STD_CFLAGS -DMONGOC_COMPILATION -DMONGOC_TRACE"
- # Generated with: find src/libmongoc/src/mongoc -name '*.c' -print0 | cut -sz -d / -f 4- | sort -z | tr '\000' ' '
- PHP_MONGODB_MONGOC_SOURCES="mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-b64.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-client.c mongoc-client-pool.c mongoc-cluster.c mongoc-collection.c mongoc-counters.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-cursorid.c mongoc-cursor-transform.c mongoc-database.c mongoc-find-and-modify.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-index.c mongoc-init.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-opcode.c mongoc-openssl.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-description.c mongoc-server-stream.c mongoc-set.c mongoc-socket.c mongoc-ssl.c mongoc-stream-buffered.c mongoc-stream.c mongoc-stream-file.c mongoc-stream-gridfs.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-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c"
+ # Generated with: find src/libmongoc/src/mongoc -name '*.c' -print0 | cut -sz -d / -f 5- | sort -z | tr '\000' ' '
+ PHP_MONGODB_MONGOC_SOURCES="mongoc-apm.c mongoc-array.c mongoc-async.c mongoc-async-cmd.c mongoc-b64.c mongoc-buffer.c mongoc-bulk-operation.c mongoc-client.c mongoc-client-pool.c mongoc-cluster.c mongoc-cluster-cyrus.c mongoc-cluster-gssapi.c mongoc-cluster-sasl.c mongoc-cluster-sspi.c mongoc-cmd.c mongoc-collection.c mongoc-compression.c mongoc-counters.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-cursorid.c mongoc-cursor-transform.c mongoc-cyrus.c mongoc-database.c mongoc-find-and-modify.c mongoc-gridfs.c mongoc-gridfs-file.c mongoc-gridfs-file-list.c mongoc-gridfs-file-page.c mongoc-gssapi.c mongoc-handshake.c mongoc-host-list.c mongoc-index.c mongoc-init.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-openssl.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-description.c mongoc-server-stream.c mongoc-set.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-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-topology.c mongoc-topology-description-apm.c mongoc-topology-description.c mongoc-topology-scanner.c mongoc-uri.c mongoc-util.c mongoc-version-functions.c mongoc-write-command.c mongoc-write-concern.c"
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mongodb)[src/libmongoc/src/mongoc], $PHP_MONGODB_MONGOC_SOURCES, $PHP_MONGODB_MONGOC_CFLAGS, shared_objects_mongodb, yes)
@@ -271,6 +288,7 @@ if test "$MONGODB" != "no"; then
AC_SUBST(MONGOC_ENABLE_SSL, 0)
AC_SUBST(MONGOC_ENABLE_CRYPTO_LIBCRYPTO, 0)
AC_SUBST(MONGOC_ENABLE_SSL_OPENSSL, 0)
+ AC_SUBST(MONGOC_HAVE_ASN1_STRING_GET0_DATA, 0)
PHP_SETUP_OPENSSL(MONGODB_SHARED_LIBADD, [
AC_SUBST(MONGOC_ENABLE_CRYPTO, 1)
@@ -296,58 +314,64 @@ if test "$MONGODB" != "no"; then
AC_SUBST(MONGOC_ENABLE_SSL_LIBRESSL, 0)
AC_SUBST(MONGOC_NO_AUTOMATIC_GLOBALS, 1)
- fi
+ AC_CHECK_TYPE([socklen_t], [AC_SUBST(MONGOC_HAVE_SOCKLEN, 1)], [AC_SUBST(MONGOC_HAVE_SOCKLEN, 0)], [#include <sys/socket.h>])
-PHP_ARG_WITH(mongodb-sasl, for Cyrus SASL support,
-[ --with-mongodb-sasl[=DIR] mongodb: Include Cyrus SASL support], auto, no)
+ AC_SUBST(MONGOC_ENABLE_COMPRESSION_SNAPPY, 0)
+ AC_SUBST(MONGOC_ENABLE_COMPRESSION_ZLIB, 0)
+ AC_SUBST(MONGOC_ENABLE_COMPRESSION, 0)
+ fi
-if test "$PHP_MONGODB_SASL" != "no"; then
- AC_MSG_CHECKING(for SASL)
- for i in $PHP_MONGODB_SASL /usr /usr/local; do
- if test -f $i/include/sasl/sasl.h; then
- MONGODB_SASL_DIR=$i
- AC_MSG_RESULT(found in $i)
- break
- fi
- done
- if test -z "$MONGODB_SASL_DIR"; then
- AC_MSG_RESULT(not found)
- if test "$PHP_MONGODB_SASL" != "auto"; then
- AC_MSG_ERROR([sasl.h not found!])
- else
- AC_SUBST(MONGOC_ENABLE_SASL, 0)
- AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
- fi
- else
+ PHP_ARG_WITH(mongodb-sasl, for Cyrus SASL support,
+ [ --with-mongodb-sasl[=DIR] mongodb: Include Cyrus SASL support], auto, no)
- PHP_CHECK_LIBRARY(sasl2, sasl_version,
- [
- PHP_ADD_INCLUDE($MONGODB_SASL_DIR)
- PHP_ADD_LIBRARY_WITH_PATH(sasl2, $MONGODB_SASL_DIR/$PHP_LIBDIR, MONGODB_SHARED_LIBADD)
- AC_SUBST(MONGOC_ENABLE_SASL, 1)
- ], [
- if test "$MONGODB_SASL" != "auto"; then
- AC_MSG_ERROR([MongoDB SASL check failed. Please check config.log for more information.])
+ AC_SUBST(MONGOC_ENABLE_SASL, 0)
+ AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
+ AC_SUBST(MONGOC_ENABLE_SASL_CYRUS, 0)
+ AC_SUBST(MONGOC_ENABLE_SASL_SSPI, 0)
+ AC_SUBST(MONGOC_ENABLE_SASL_GSSAPI, 0)
+
+ if test "$PHP_MONGODB_SASL" != "no"; then
+ AC_MSG_CHECKING(for SASL)
+ for i in $PHP_MONGODB_SASL /usr /usr/local; do
+ if test -f $i/include/sasl/sasl.h; then
+ MONGODB_SASL_DIR=$i
+ AC_MSG_RESULT(found in $i)
+ break
fi
- AC_SUBST(MONGOC_ENABLE_SASL, 0)
- ], [
- -L$MONGODB_SASL_DIR/$PHP_LIBDIR
- ])
+ done
- PHP_CHECK_LIBRARY(sasl2, sasl_client_done,
- [
- AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 1)
- ], [
- AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
- ])
+ if test -z "$MONGODB_SASL_DIR"; then
+ AC_MSG_RESULT(not found)
+ if test "$PHP_MONGODB_SASL" != "auto"; then
+ AC_MSG_ERROR([sasl.h not found!])
+ fi
+ else
+
+ PHP_CHECK_LIBRARY(sasl2, sasl_version,
+ [
+ PHP_ADD_INCLUDE($MONGODB_SASL_DIR)
+ PHP_ADD_LIBRARY_WITH_PATH(sasl2, $MONGODB_SASL_DIR/$PHP_LIBDIR, MONGODB_SHARED_LIBADD)
+ AC_SUBST(MONGOC_ENABLE_SASL, 1)
+ AC_SUBST(MONGOC_ENABLE_SASL_CYRUS, 1)
+ ], [
+ if test "$MONGODB_SASL" != "auto"; then
+ AC_MSG_ERROR([MongoDB SASL check failed. Please check config.log for more information.])
+ fi
+ ], [
+ -L$MONGODB_SASL_DIR/$PHP_LIBDIR
+ ])
+
+ PHP_CHECK_LIBRARY(sasl2, sasl_client_done,
+ [
+ AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 1)
+ ])
+ fi
fi
-else
- AC_SUBST(MONGOC_ENABLE_SASL, 0)
- AC_SUBST(MONGOC_HAVE_SASL_CLIENT_DONE, 0)
-fi
+ m4_include(src/libmongoc/build/autotools/m4/ax_prototype.m4)
+ m4_include(src/libmongoc/build/autotools/CheckCompiler.m4)
m4_include(src/libmongoc/build/autotools/WeakSymbols.m4)
m4_include(src/libmongoc/build/autotools/m4/ax_pthread.m4)
AX_PTHREAD
@@ -371,10 +395,12 @@ fi
PHP_ADD_INCLUDE([$ext_srcdir/src/BSON/])
PHP_ADD_INCLUDE([$ext_srcdir/src/MongoDB/])
PHP_ADD_INCLUDE([$ext_srcdir/src/MongoDB/Exception/])
+ PHP_ADD_INCLUDE([$ext_srcdir/src/MongoDB/Monitoring/])
PHP_ADD_INCLUDE([$ext_srcdir/src/contrib/])
PHP_ADD_BUILD_DIR([$ext_builddir/src/BSON/])
PHP_ADD_BUILD_DIR([$ext_builddir/src/MongoDB/])
PHP_ADD_BUILD_DIR([$ext_builddir/src/MongoDB/Exception/])
+ PHP_ADD_BUILD_DIR([$ext_builddir/src/MongoDB/Monitoring/])
PHP_ADD_BUILD_DIR([$ext_builddir/src/contrib/])
if test "$PHP_LIBMONGOC" == "no"; then
PHP_ADD_INCLUDE([$ext_srcdir/src/libmongoc/src/mongoc/])
@@ -387,10 +413,10 @@ fi
m4_include(src/libbson/build/autotools/m4/ac_create_stdint_h.m4)
AC_CREATE_STDINT_H([$srcdir/src/libbson/src/bson/bson-stdint.h])
PHP_ADD_INCLUDE([$ext_srcdir/src/libbson/src/])
- PHP_ADD_INCLUDE([$ext_srcdir/src/libbson/src/yajl/])
+ PHP_ADD_INCLUDE([$ext_srcdir/src/libbson/src/jsonsl/])
PHP_ADD_INCLUDE([$ext_srcdir/src/libbson/src/bson/])
PHP_ADD_BUILD_DIR([$ext_builddir/src/libbson/src/])
- PHP_ADD_BUILD_DIR([$ext_builddir/src/libbson/src/yajl/])
+ PHP_ADD_BUILD_DIR([$ext_builddir/src/libbson/src/jsonsl/])
PHP_ADD_BUILD_DIR([$ext_builddir/src/libbson/src/bson/])
fi Apologies for the lengthy paste, but GitHub wouldn't allow me to attach a
When Would you mind downloading the 1.3.0 sources ( |
Tracking in PHPC-1014. |
Hey @jmikola, so I tried the solution you proposed but unfortunately it didn’t work. I tested this separately (a multi-line string with no backslash after the last word) with I think I might be on to something though. There’s the following code in the generated if test "$MONGODB" != "no"; then
php_enable_developer_flags=no (I guess it matches these lines in If I add a exit 1
if test "$MONGODB" != "no"; then
php_enable_developer_flags=no …the error doesn’t show up, but if I move the if test "$MONGODB" != "no"; then
exit 1
php_enable_developer_flags=no …the error pops up and the script crashes. So the problem may come from this #if test "$MONGODB" != "no"; then
php_enable_developer_flags=no …then the error doesn’t show up anymore, and the script goes on normally. WTF? ^^ I’ll keep on trying to find the source of the problem, but right now I’m kind of out of ideas. |
With the help of the I'll follow up with @ajdavis about this. |
CDRIVER-2297 has been merged and should be released as libbson and libmongoc 1.8.1. Once those are released, I'll follow up with a 1.3.1 release of the PHP driver that bumps its bundled dependencies. Thanks very much for reporting this and spending the time on your end to investigate! |
@jmikola That’s great ! 👍 🎉 Thank you for your time and responsiveness on this, really appreciated 🙇 |
@jmikola / @fabschurt in the meantime, until the 1.3.1 release isn't published, the workaround is to install bash? |
@galindro Yep, exactly. Normally, installing Bash on Alpine replaces the default |
I hope this gets fixed soon 🙏 |
Unfortunately, this is still waiting on libmongoc 1.8.1. Once that's released, we'll be able to tag 1.3.1 of the PHP extension with the dependency bump. |
1.3.1 has been released with a fixed version of libmongoc 1.8.1. Sorry for the delay on this. |
Hey folks,
So it seems that the newest 1.3.0 version fails to compile on Docker
php:7.1-fpm-alpine
image. Here’s my environment:And here’s how to replicate (theoretically):
And here’s the resulting build log:
Installing
mongodb-1.2.11
still works fine.I would have been glad to submit a PR rather than an issue, but my C skills are unfortunately inexistant. Of course let me know if you need more details about the error.
The text was updated successfully, but these errors were encountered: