Set minimum required version of zstd as 1.4.0.
authorTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Apr 2022 15:05:52 +0000 (11:05 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Fri, 1 Apr 2022 15:05:52 +0000 (11:05 -0400)
It emerges that our new zstd code depends on features that were not
present (or at least not enabled by default) in zstd before 1.4.0.
That's already four years old, so there's little reason to try to
make our code work with something older.  Instead make configure
check that zstd is at least 1.4.0, and document this requirement.

Justin Pryzby (doc changes by me)

Discussion: https://postgr.es/m/efbd94cd1102f99fd1300e44905ee4a994ee2ef6.camel@gunduz.org

configure
configure.ac
doc/src/sgml/installation.sgml

index c5e27697011e6684ec5eb99130446955ce312b8d..a4b654ad94e08006033e931b0625892a0e10c7ed 100755 (executable)
--- a/configure
+++ b/configure
@@ -9092,19 +9092,19 @@ $as_echo "$with_zstd" >&6; }
 if test "$with_zstd" = yes; then
 
 pkg_failed=no
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd" >&5
-$as_echo_n "checking for libzstd... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libzstd >= 1.4.0" >&5
+$as_echo_n "checking for libzstd >= 1.4.0... " >&6; }
 
 if test -n "$ZSTD_CFLAGS"; then
     pkg_cv_ZSTD_CFLAGS="$ZSTD_CFLAGS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd >= 1.4.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libzstd >= 1.4.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd" 2>/dev/null`
+  pkg_cv_ZSTD_CFLAGS=`$PKG_CONFIG --cflags "libzstd >= 1.4.0" 2>/dev/null`
                      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -9116,12 +9116,12 @@ if test -n "$ZSTD_LIBS"; then
     pkg_cv_ZSTD_LIBS="$ZSTD_LIBS"
  elif test -n "$PKG_CONFIG"; then
     if test -n "$PKG_CONFIG" && \
-    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd\""; } >&5
-  ($PKG_CONFIG --exists --print-errors "libzstd") 2>&5
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"libzstd >= 1.4.0\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "libzstd >= 1.4.0") 2>&5
   ac_status=$?
   $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; then
-  pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd" 2>/dev/null`
+  pkg_cv_ZSTD_LIBS=`$PKG_CONFIG --libs "libzstd >= 1.4.0" 2>/dev/null`
                      test "x$?" != "x0" && pkg_failed=yes
 else
   pkg_failed=yes
@@ -9142,14 +9142,14 @@ else
         _pkg_short_errors_supported=no
 fi
         if test $_pkg_short_errors_supported = yes; then
-               ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd" 2>&1`
+               ZSTD_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "libzstd >= 1.4.0" 2>&1`
         else
-               ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd" 2>&1`
+               ZSTD_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "libzstd >= 1.4.0" 2>&1`
         fi
        # Put the nasty error message in config.log where it belongs
        echo "$ZSTD_PKG_ERRORS" >&5
 
-       as_fn_error $? "Package requirements (libzstd) were not met:
+       as_fn_error $? "Package requirements (libzstd >= 1.4.0) were not met:
 
 $ZSTD_PKG_ERRORS
 
index 6a48982c23d30afbef8e26b8c9e141984e33d675..44d35e1b5a2f31c5b2920fa97567e8838caa94ee 100644 (file)
@@ -1073,7 +1073,7 @@ AC_MSG_RESULT([$with_zstd])
 AC_SUBST(with_zstd)
 
 if test "$with_zstd" = yes; then
-  PKG_CHECK_MODULES(ZSTD, libzstd)
+  PKG_CHECK_MODULES(ZSTD, libzstd >= 1.4.0)
   # We only care about -I, -D, and -L switches;
   # note that -lzstd will be added by AC_CHECK_LIB below.
   for pgac_option in $ZSTD_CFLAGS; do
index dcd1e772c6cab4c8024b70b3c90cf71aa61a0688..df32025a86f708dcc676684a8642b96db7e66b53 100644 (file)
@@ -250,7 +250,7 @@ su - postgres
       encrypted client connections.  <productname>OpenSSL</productname> is
       also required for random number generation on platforms that do not
       have <filename>/dev/urandom</filename> (except Windows).  The minimum
-      version required is 1.0.1.
+      required version is 1.0.1.
      </para>
     </listitem>
 
@@ -265,7 +265,7 @@ su - postgres
     <listitem>
      <para>
       You need <productname>LZ4</productname>, if you want to support
-      compression of data with this method; see
+      compression of data with that method; see
       <xref linkend="guc-default-toast-compression"/> and
       <xref linkend="guc-wal-compression"/>.
      </para>
@@ -274,8 +274,9 @@ su - postgres
     <listitem>
      <para>
       You need <productname>zstd</productname>, if you want to support
-      compression of data with this method; see
+      compression of data with that method; see
       <xref linkend="guc-wal-compression"/>.
+      The minimum required version is 1.4.0.
      </para>
     </listitem>