Re: Kerberos support broken on MSVC builds for Windows x64? - Mailing list pgsql-hackers

From Dave Page
Subject Re: Kerberos support broken on MSVC builds for Windows x64?
Date
Msg-id CA+OCxowMKHP_YgGTHAgcebxFou1-kG5aFNc1fx09HXiHPN77Sg@mail.gmail.com
Whole thread Raw
In response to Kerberos support broken on MSVC builds for Windows x64?  (Dave Page <dpage@pgadmin.org>)
Responses Re: Kerberos support broken on MSVC builds for Windows x64?  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers


On Tue, Sep 1, 2020 at 4:22 PM Dave Page <dpage@pgadmin.org> wrote:
I was experimenting with building with MIT Kerberos support on 64 bit Windows using MSVC and ran into a number of linker errors along the lines of:

"C:\Users\dpage\Downloads\postgresql-12.4\pgsql.sln" (default target) (1) ->
"C:\Users\dpage\Downloads\postgresql-12.4\zic.vcxproj" (default target) (2) ->
(Link target) ->
  LINK : fatal error LNK1181: cannot open input file 'C:\Progra~1\MIT\Kerberos\lib.obj' [C:\Users\dpage\Downloads\postgresql-12.4\zic.vcxproj]

That was after I had to manually add the include and lib paths in buildenv.pl. Diving in a bit further I found a couple of things:

1) The only buildfarm machine doing 64bit Windows Kerberos enabled builds with MSVC is hammerkop. It enables it by setting the "krb5" option in config.pl, however, as far as I can see (going back to 9.5), the option is actually "gss". I can't see any sign in the log for the make step that it actually is making any attempt to build with Kerberos, despite the UI showing the icon for it.

2) I can't find anything in the MSVC build scripts in src/tools/msvc to deal with 64bit Kerberos builds - Solution.pm seems to unconditionally try to link with the 32bit libraries (e.g. lib/i386/krb5_32.lib instead of lib/amd64/krb5_64.lib).

I'm assuming noone has tried a build with 64bit Kerberos, or am I missing something?

Sidenote: I'm not sure even a 32bit Kerberos build will work, as Solution.pm assumes the headers are in $self->{options}->{gss} . '\inc\krb5', however in at least the latest installer from MIT they're actually in $self->{options}->{gss} . '\include'.

Attached is a patch against 12.4 for the build system in case anyone wants to play (I'll do it properly against the head branch later). I'm guessing this will work for < 12, as with 12 I'm now getting the following which looks like it's related to GSS encryption:

"C:\Users\dpage\Downloads\postgresql-12.4\pgsql.sln" (default target) (1) ->
"C:\Users\dpage\Downloads\postgresql-12.4\pgcrypto.vcxproj" (default target) (2) ->
"C:\Users\dpage\Downloads\postgresql-12.4\postgres.vcxproj" (default target) (3) ->
(Link target) ->
  be-secure-gssapi.obj : error LNK2019: unresolved external symbol setenv referenced in function secure_open_gssapi [C:\Users\dpage\Downloads\postgresql-12.4\postgres.vcxproj]
  .\Release\postgres\postgres.exe : fatal error LNK1120: 1 unresolved externals [C:\Users\dpage\Downloads\postgresql-12.4\postgres.vcxproj]

I'll dig into that some more.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Is it possible to set end-of-data marker for COPY statement.
Next
From: Alvaro Herrera
Date:
Subject: Re: Reloptions for table access methods