[postgis-tickets] [SCM] PostGIS branch master updated. 3.1.0alpha2-75-g733eed8

git at osgeo.org git at osgeo.org
Mon Oct 5 01:52:45 PDT 2020


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  733eed8a963f90dae5b4d3a503f68bdda9c77d2c (commit)
      from  962ef92215fdac72b317d7d99201931394174afa (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 733eed8a963f90dae5b4d3a503f68bdda9c77d2c
Author: Raúl Marín <git at rmr.ninja>
Date:   Fri Oct 2 17:52:45 2020 +0200

    Enforce protobuf-c dependency
    
    Unless explicitly disabled, enforce the dependency on libprotobuf-c >= 1.1.0.
    
    Previously it would fail silently and disable MVT and GeoJSON support. This later
    translated into end user complaints
    
    Closes https://github.com/postgis/postgis/pull/582/

diff --git a/NEWS b/NEWS
index 681f1b0..cb49fbb 100644
--- a/NEWS
+++ b/NEWS
@@ -4,6 +4,8 @@ Only tickets not included in 3.1.0alpha2
 
 * Breaking changes *
   - #4737, Bump minimum protobuf-c requirement to 1.1.0 (Raúl Marín)
+           The configure step will now fail if the requirement isn't
+           met or explicitly disabled (--without-protobuf)
   - #4258, Untangle postgis_sfcgal into its own .so (Regina Obe)
 
 * New features *
diff --git a/configure.ac b/configure.ac
index 91ccd9c..4c7d412 100644
--- a/configure.ac
+++ b/configure.ac
@@ -979,8 +979,7 @@ dnl Detect if protobuf-c installed
 dnl ===========================================================================
 
 CHECK_PROTOBUF=yes
-HAVE_PROTOBUF=yes
-HAVE_GEOBUF=no
+HAVE_PROTOBUF=no
 
 AC_ARG_WITH([protobuf],
 	[AS_HELP_STRING([--without-protobuf], [build without protobuf-c support])],
@@ -989,6 +988,7 @@ AC_ARG_WITH([protobuf],
 dnl User didn't turn OFF protobuf support so...
 if test "$CHECK_PROTOBUF" != "no"; then
 
+	HAVE_PROTOBUF=yes
 	dnl Need to find libdir, incdir and protoc-c compiler
 
 	CPPFLAGS_SAVE="$CPPFLAGS"
@@ -1036,13 +1036,13 @@ if test "$CHECK_PROTOBUF" != "no"; then
 
 	dnl confirm that discovered/configured include path works
 	AC_CHECK_HEADER([protobuf-c/protobuf-c.h], [],
-		AC_MSG_RESULT([unable to find protobuf-c/protobuf-c.h using $CPPFLAGS])
+		AC_MSG_ERROR([unable to find protobuf-c/protobuf-c.h using CPPFLAGS. You can disable MVT and Geobuf support using --without-protobuf])
 		HAVE_PROTOBUF=no
 	)
 
 	dnl confirm that discovered/configured library path works
 	AC_CHECK_LIB([protobuf-c], [protobuf_c_message_init], [],
-		AC_MSG_RESULT([unable to link protobuf-c using $LDFLAGS])
+		AC_MSG_ERROR([unable to link protobuf-c using $LDFLAGS. You can disable MVT and Geobuf support using --without-protobuf])
 		HAVE_PROTOBUF=no
 	)
 
@@ -1052,6 +1052,9 @@ if test "$CHECK_PROTOBUF" != "no"; then
 
 	AC_MSG_CHECKING([protobuf-c version])
 	AC_PROTOBUFC_VERSION([PROTOC_VERSION])
+        if test ! "$PROTOC_VERSION" -ge 1001000; then
+                AC_MSG_ERROR("Old protobuf-c release found but 1.1.0 is required. You can disable MVT and Geobuf support using --without-protobuf")
+        fi
 	AC_MSG_RESULT([$PROTOC_VERSION])
 
 	CPPFLAGS="$CPPFLAGS_SAVE"
@@ -1061,7 +1064,7 @@ if test "$CHECK_PROTOBUF" != "no"; then
 	dnl confirm that protobuf compiler is available
 	AC_PATH_PROG(PROTOCC, protoc-c)
 	if test -z "$PROTOCC"; then
-		AC_MSG_RESULT([Cannot find protoc-c protobuf compiler on the PATH: $PATH])
+		AC_MSG_ERROR([Cannot find protoc-c protobuf compiler on the PATH: $PATH. You can disable MVT and Geobuf support using --without-protobuf])
 		HAVE_PROTOBUF=no
 	fi
 
@@ -1069,15 +1072,14 @@ if test "$CHECK_PROTOBUF" != "no"; then
         if test "$HAVE_PROTOBUF" = "yes"; then
 		AC_DEFINE([HAVE_LIBPROTOBUF], [1], [Define to 1 if libprotobuf-c is present])
 		AC_DEFINE_UNQUOTED([LIBPROTOBUF_VERSION], [$PROTOC_VERSION], [Numeric version number for libprotobuf-c])
-		AC_DEFINE([HAVE_GEOBUF], [1], [Define to 1 if geobuf is present])
-		HAVE_GEOBUF=yes
-	fi
+	else
+                AC_MSG_ERROR("Missing protobuf-c support. You can disable MVT and Geobuf support using --without-protobuf")
+        fi
 
-    AC_SUBST([HAVE_PROTOBUF])
-    AC_SUBST([HAVE_GEOBUF])
-    AC_SUBST([PROTOC_VERSION])
-    AC_SUBST([PROTOBUF_CPPFLAGS])
-    AC_SUBST([PROTOBUF_LDFLAGS])
+        AC_SUBST([HAVE_PROTOBUF])
+        AC_SUBST([PROTOC_VERSION])
+        AC_SUBST([PROTOBUF_CPPFLAGS])
+        AC_SUBST([PROTOBUF_LDFLAGS])
 
 fi
 
diff --git a/postgis/Makefile.in b/postgis/Makefile.in
index b78e0ad..be788f5 100644
--- a/postgis/Makefile.in
+++ b/postgis/Makefile.in
@@ -52,10 +52,7 @@ SPGIST_OBJ= gserialized_spgist_2d.o gserialized_spgist_3d.o gserialized_spgist_n
 endif
 
 ifeq (@HAVE_PROTOBUF@,yes)
-PROTOBUF_OBJ = vector_tile.pb-c.o
-ifeq (@HAVE_GEOBUF@,yes)
-PROTOBUF_OBJ += geobuf.pb-c.o
-endif
+PROTOBUF_OBJ = vector_tile.pb-c.o geobuf.pb-c.o
 UTHASH_INCLUDE = -I../deps/uthash/include
 endif
 
@@ -217,11 +214,9 @@ geobuf.pb-c.c geobuf.pb-c.h: geobuf.proto
 ifeq (@HAVE_PROTOBUF@,yes)
 lwgeom_out_mvt.o: vector_tile.pb-c.h
 mvt.o: vector_tile.pb-c.h
-ifeq (@HAVE_GEOBUF@,yes)
 lwgeom_out_geobuf.o: geobuf.pb-c.h
 geobuf.o: geobuf.pb-c.h
 endif
-endif
 
 # Borrow the $libdir substitution from PGXS but customise by running the preprocessor
 # and adding the version number
diff --git a/postgis/geobuf.c b/postgis/geobuf.c
index 8264060..485902c 100644
--- a/postgis/geobuf.c
+++ b/postgis/geobuf.c
@@ -26,7 +26,7 @@
 #include "geobuf.h"
 #include "pgsql_compat.h"
 
-#if defined HAVE_LIBPROTOBUF && defined HAVE_GEOBUF
+#if defined HAVE_LIBPROTOBUF
 
 #define FEATURES_CAPACITY_INITIAL 50
 #define MAX_PRECISION 1e6
diff --git a/postgis/geobuf.h b/postgis/geobuf.h
index 2e0ae5f..da2dd4d 100644
--- a/postgis/geobuf.h
+++ b/postgis/geobuf.h
@@ -42,7 +42,7 @@
 #include "lwgeom_pg.h"
 #include "lwgeom_log.h"
 
-#if defined HAVE_LIBPROTOBUF && defined HAVE_GEOBUF
+#if defined HAVE_LIBPROTOBUF
 
 #include "geobuf.pb-c.h"
 
diff --git a/postgis/lwgeom_out_geobuf.c b/postgis/lwgeom_out_geobuf.c
index 5db6c8e..e70f7f4 100644
--- a/postgis/lwgeom_out_geobuf.c
+++ b/postgis/lwgeom_out_geobuf.c
@@ -45,8 +45,8 @@
 PG_FUNCTION_INFO_V1(pgis_asgeobuf_transfn);
 Datum pgis_asgeobuf_transfn(PG_FUNCTION_ARGS)
 {
-#if ! (defined HAVE_LIBPROTOBUF && defined HAVE_GEOBUF)
-	elog(ERROR, "ST_AsGeobuf: Missing libprotobuf-c >= version 1.1");
+#if !(defined HAVE_LIBPROTOBUF)
+	elog(ERROR, "ST_AsGeobuf: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	MemoryContext aggcontext;
@@ -82,8 +82,8 @@ Datum pgis_asgeobuf_transfn(PG_FUNCTION_ARGS)
 PG_FUNCTION_INFO_V1(pgis_asgeobuf_finalfn);
 Datum pgis_asgeobuf_finalfn(PG_FUNCTION_ARGS)
 {
-#if ! (defined HAVE_LIBPROTOBUF && defined HAVE_GEOBUF)
-	elog(ERROR, "ST_AsGeoBuf: Missing libprotobuf-c >= version 1.1");
+#if !(defined HAVE_LIBPROTOBUF)
+	elog(ERROR, "ST_AsGeobuf: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	uint8_t *buf;
diff --git a/postgis/lwgeom_out_mvt.c b/postgis/lwgeom_out_mvt.c
index eaf2577..27efd3e 100644
--- a/postgis/lwgeom_out_mvt.c
+++ b/postgis/lwgeom_out_mvt.c
@@ -42,7 +42,7 @@ PG_FUNCTION_INFO_V1(ST_AsMVTGeom);
 Datum ST_AsMVTGeom(PG_FUNCTION_ARGS)
 {
 #ifndef HAVE_LIBPROTOBUF
-	elog(ERROR, "Missing libprotobuf-c");
+	elog(ERROR, "ST_AsMVTGeom: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	GBOX *bounds = NULL;
@@ -126,7 +126,7 @@ PG_FUNCTION_INFO_V1(pgis_asmvt_transfn);
 Datum pgis_asmvt_transfn(PG_FUNCTION_ARGS)
 {
 #ifndef HAVE_LIBPROTOBUF
-	elog(ERROR, "Missing libprotobuf-c");
+	elog(ERROR, "ST_AsMVT: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	MemoryContext aggcontext, old_context;
@@ -181,7 +181,7 @@ PG_FUNCTION_INFO_V1(pgis_asmvt_finalfn);
 Datum pgis_asmvt_finalfn(PG_FUNCTION_ARGS)
 {
 #ifndef HAVE_LIBPROTOBUF
-	elog(ERROR, "Missing libprotobuf-c");
+	elog(ERROR, "ST_AsMVT: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	mvt_agg_context *ctx;
@@ -207,7 +207,7 @@ PG_FUNCTION_INFO_V1(pgis_asmvt_serialfn);
 Datum pgis_asmvt_serialfn(PG_FUNCTION_ARGS)
 {
 #ifndef HAVE_LIBPROTOBUF
-	elog(ERROR, "Missing libprotobuf-c");
+	elog(ERROR, "ST_AsMVT: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	mvt_agg_context *ctx;
@@ -237,7 +237,7 @@ PG_FUNCTION_INFO_V1(pgis_asmvt_deserialfn);
 Datum pgis_asmvt_deserialfn(PG_FUNCTION_ARGS)
 {
 #ifndef HAVE_LIBPROTOBUF
-	elog(ERROR, "Missing libprotobuf-c");
+	elog(ERROR, "ST_AsMVT: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	MemoryContext aggcontext, oldcontext;
@@ -258,7 +258,7 @@ PG_FUNCTION_INFO_V1(pgis_asmvt_combinefn);
 Datum pgis_asmvt_combinefn(PG_FUNCTION_ARGS)
 {
 #ifndef HAVE_LIBPROTOBUF
-	elog(ERROR, "Missing libprotobuf-c");
+	elog(ERROR, "ST_AsMVT: Compiled without protobuf-c support");
 	PG_RETURN_NULL();
 #else
 	MemoryContext aggcontext, oldcontext;
diff --git a/postgis/postgis_libprotobuf.c b/postgis/postgis_libprotobuf.c
index 0ffce0e..6bc95e0 100644
--- a/postgis/postgis_libprotobuf.c
+++ b/postgis/postgis_libprotobuf.c
@@ -14,7 +14,7 @@
 PG_FUNCTION_INFO_V1(postgis_libprotobuf_version);
 Datum postgis_libprotobuf_version(PG_FUNCTION_ARGS)
 {
-#ifdef HAVE_PROTOBUF_C_VERSION
+#ifdef HAVE_LIBPROTOBUF
 	const char *ver = protobuf_c_version();
 	text *result = cstring_to_text(ver);
 	PG_RETURN_POINTER(result);
diff --git a/postgis_config.h.in b/postgis_config.h.in
index 027c574..18d6b70 100644
--- a/postgis_config.h.in
+++ b/postgis_config.h.in
@@ -41,15 +41,9 @@
 /* Define to 1 if libprotobuf-c is present */
 #undef HAVE_LIBPROTOBUF
 
-/* Define to 1 if protobuf_c_version() is present */
-#undef HAVE_PROTOBUF_C_VERSION
-
 /* Numeric version number for libprotobuf */
 #undef LIBPROTOBUF_VERSION
 
-/* Define to 1 if libprotobuf-c is >= version 1.1 */
-#undef HAVE_GEOBUF
-
 /* Define to 1 if libjson is present */
 #undef HAVE_LIBJSON
 
diff --git a/regress/core/Makefile.in b/regress/core/Makefile.in
index 4db0e8c..fd9529f 100644
--- a/regress/core/Makefile.in
+++ b/regress/core/Makefile.in
@@ -227,12 +227,9 @@ ifeq (@HAVE_PROTOBUF@,yes)
 	# ST_AsMVT, ST_AsGeobuf
 	TESTS += \
 		mvt \
-		mvt_jsonb
-ifeq (@HAVE_GEOBUF@,yes)
-	TESTS += \
+		mvt_jsonb \
 		geobuf
 endif
-endif
 
 all install uninstall:
 

-----------------------------------------------------------------------

Summary of changes:
 NEWS                          |  2 ++
 configure.ac                  | 28 +++++++++++++++-------------
 postgis/Makefile.in           |  7 +------
 postgis/geobuf.c              |  2 +-
 postgis/geobuf.h              |  2 +-
 postgis/lwgeom_out_geobuf.c   |  8 ++++----
 postgis/lwgeom_out_mvt.c      | 12 ++++++------
 postgis/postgis_libprotobuf.c |  2 +-
 postgis_config.h.in           |  6 ------
 regress/core/Makefile.in      |  5 +----
 10 files changed, 32 insertions(+), 42 deletions(-)


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list