Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline... - Mailing list pgsql-general

From Kirk Wolak
Subject Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...
Date
Msg-id CACLU5mRsMQyW_OcFXeb=NiPScDtUQYrTpY7fbGR-vvBuKkqh=Q@mail.gmail.com
Whole thread Raw
In response to Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...  (Andres Freund <andres@anarazel.de>)
Responses Re: Getting PSQL in Windows to support TAB/Autocomplete via modified readline...  (Andres Freund <andres@anarazel.de>)
List pgsql-general
On Wed, Nov 23, 2022 at 9:32 PM Andres Freund <andres@anarazel.de> wrote:
Hi,

On 2022-11-23 20:55:18 -0500, Kirk Wolak wrote:
> Currently I have a lot of it working, but I need to partner up with some of
> the meson guys...
> if it is already close to working, a couple of my tweaks could accelerate
> it.

I just successfully compiled postgres with meson and readline, using msvc,
only tweaking psql_completion() contents.

The readline I used for building with msvc is from
vcpkg.exe install --triplet x64-windows readline-win32 pkgconf

I also installed icu zlib zstd libxml2 libxslt tcl that way, but shouldn't
matter here.

vcpkg is installed in c:/dev/vcpkg

Other steps:
# let meson know where to get pkgconf from, could also add it to PATH
$ENV:PKG_CONFIG="c:/dev/vcpkg/installed/x64-windows/tools/pkgconf/pkgconf.exe"

# specify location of pkgconfig files, so meson can get compilation flags
meson setup --buildtype debug -Dpkg_config_path=c:/dev/vcpkg/installed/x64-windows/debug/lib/pkgconfig ...

# when running tests, the readline dll needs to be somewhere in PATH
$ENV:PATH="$ENV:PATH;c:/dev/vcpkg/installed/x64-windows/debug/bin"


If you want to build an optimized postgres, you'd need to change the
pkg_config_path and PATH so it doesn't include debug/ (this is because of
needing to link to the same CRT).

Greetings,

Andres Freund
Andres,
  Thank you for this.  We have the build working with meson (w/o readline).
I was not able to get "readline" to be recognized by meson (I've attached the log file)....
It is "there" according to vcpkg.  (other projects have a .pc file this one is missing?)

  I did take this version of readline, and linked it to my VS sources (the hardway), and recompiled/linked,
and IT WORKS!  With Arrow Keys, etc! (although this is like Version 5 of readline)

  I am curious why meson is not seeing these packages as installed?
I changed the readline setting in the meson config to "enabled", but since it doesn't "find" them,
it turns it off in the end...
>> Run-time dependency readline found: NO (tried pkgconfig and cmake)

  Strangely it says it used pkgconfig and cmake?
 
  I am very excited to see auto-complete and readline support coming to windows...

Thanks, Kirk
Attachment

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: delete statement returning too many results
Next
From: Brad White
Date:
Subject: Re: Upgrading to v12