On Sat, May 08, 2021 at 08:19:03PM +0530, Dilip Kumar wrote: > I have fixed some of them, I could not write the test cases where we > have to ensure that 'ALTER TABLE COMPRESSION' is not appearing in the > dump. Basically, I don't have knowledge of the perl language so even > after trying for some time I could not write those 2 test cases. I > have fixed the remaining comments.
Thanks. I have spent some time on that, and after adding some tests with --no-toast-compression, I have applied this part. Now comes the last part of the thread: support for the build with MSVC. I have looked in details at the binaries provided by upstream on its release page, but these are for msys and mingw, so MSVC won't work with that. Saying that, the upstream code can be compiled across various MSVC versions, with 2010 being the oldest version supported, even if there is no compiled libraries provided on the release pages. The way of doing things here is to compile the code by yourself after downloading the source tarball, with liblz4.lib and liblz4.dll being the generated bits interesting for Postgres, so using https://github.com/lz4/lz4/releases as reference for the download looks enough, still that requires some efforts from the users to be able to do that. Another trick is to use vcpkg, but the deliverables generated are named lz4.{dll,lib} which is inconsistent with the upstream naming liblz4.{dll,lib} (see Makefile.inc for the details). My image of the whole thing is that this finishes by being a pain, still that's possible, but that's similar with my experience with any other dependencies. I have been spending some time playing with the builds and that was working nicely. Please note that you have missed an update in config_default.pl and not all the CFLAGS entries were present in GenerateFiles(). It may be nice to see if this stuff requires any adjustments for msys and mingw, but I don't have such environments at hand. All that leads me to the updated version attached. Thoughts? -- Michael
From 9825cfd54d62004b334af647817aba32e538bbf8 Mon Sep 17 00:00:00 2001 From: Michael Paquier <mich...@paquier.xyz> Date: Mon, 10 May 2021 14:55:39 +0900 Subject: [PATCH v3] LZ4 option for windows build and documentation update --- doc/src/sgml/install-windows.sgml | 10 ++++++++++ src/tools/msvc/Solution.pm | 12 ++++++++++++ src/tools/msvc/config_default.pl | 1 + 3 files changed, 23 insertions(+) diff --git a/doc/src/sgml/install-windows.sgml b/doc/src/sgml/install-windows.sgml index 64687b12e6..92087dba68 100644 --- a/doc/src/sgml/install-windows.sgml +++ b/doc/src/sgml/install-windows.sgml @@ -304,6 +304,16 @@ $ENV{MSBFLAGS}="/m"; </para></listitem> </varlistentry> + <varlistentry> + <term><productname>LZ4</productname></term> + <listitem><para> + Required for supporting <productname>LZ4</productname> compression + method for compressing the table data. Binaries and source can be + downloaded from + <ulink url="https://github.com/lz4/lz4/releases"></ulink>. + </para></listitem> + </varlistentry> + <varlistentry> <term><productname>OpenSSL</productname></term> <listitem><para> diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm index 459579d312..60b8d6f650 100644 --- a/src/tools/msvc/Solution.pm +++ b/src/tools/msvc/Solution.pm @@ -535,6 +535,12 @@ sub GenerateFiles $define{HAVE_LIBXSLT} = 1; $define{USE_LIBXSLT} = 1; } + if ($self->{options}->{lz4}) + { + $define{HAVE_LIBLZ4} = 1; + $define{HAVE_LZ4_H} = 1; + $define{USE_LZ4} = 1; + } if ($self->{options}->{openssl}) { $define{USE_OPENSSL} = 1; @@ -1054,6 +1060,11 @@ sub AddProject $proj->AddIncludeDir($self->{options}->{xslt} . '\include'); $proj->AddLibrary($self->{options}->{xslt} . '\lib\libxslt.lib'); } + if ($self->{options}->{lz4}) + { + $proj->AddIncludeDir($self->{options}->{lz4} . '\include'); + $proj->AddLibrary($self->{options}->{lz4} . '\lib\liblz4.lib'); + } if ($self->{options}->{uuid}) { $proj->AddIncludeDir($self->{options}->{uuid} . '\include'); @@ -1165,6 +1176,7 @@ sub GetFakeConfigure $cfg .= ' --with-uuid' if ($self->{options}->{uuid}); $cfg .= ' --with-libxml' if ($self->{options}->{xml}); $cfg .= ' --with-libxslt' if ($self->{options}->{xslt}); + $cfg .= ' --with-lz4' if ($self->{options}->{lz4}); $cfg .= ' --with-gssapi' if ($self->{options}->{gss}); $cfg .= ' --with-icu' if ($self->{options}->{icu}); $cfg .= ' --with-tcl' if ($self->{options}->{tcl}); diff --git a/src/tools/msvc/config_default.pl b/src/tools/msvc/config_default.pl index 256878f582..460c0375d4 100644 --- a/src/tools/msvc/config_default.pl +++ b/src/tools/msvc/config_default.pl @@ -14,6 +14,7 @@ our $config = { extraver => undef, # --with-extra-version=<string> gss => undef, # --with-gssapi=<path> icu => undef, # --with-icu=<path> + lz4 => undef, # --with-lz4=<path> nls => undef, # --enable-nls=<path> tap_tests => undef, # --enable-tap-tests tcl => undef, # --with-tcl=<path> -- 2.31.1
signature.asc
Description: PGP signature