Re: Should we work around msvc failing to compile tab-complete.c? - Mailing list pgsql-hackers

From Dave Page
Subject Re: Should we work around msvc failing to compile tab-complete.c?
Date
Msg-id CA+OCxoySeRYNmt7yBahDYJWVNao5UUkYMx5wO7LP0ZM08+hd-w@mail.gmail.com
Whole thread Raw
In response to Re: Should we work around msvc failing to compile tab-complete.c?  (Andres Freund <andres@anarazel.de>)
Responses Re: Should we work around msvc failing to compile tab-complete.c?
List pgsql-hackers


On Mon, 8 Jul 2024 at 21:08, Andres Freund <andres@anarazel.de> wrote:
Hi,

On 2024-07-08 14:18:03 -0400, Tom Lane wrote:
> Andres Freund <andres@anarazel.de> writes:
> > Compiling postgres on windows with tab-completion support fails either with
> > "fatal error C1026: parser stack overflow, program too complex”.
> > or (in recent versions) with
> > "…/src/bin/psql/tab-complete.c(4023): fatal error C1001: Internal compiler error."
>
> > It's pretty easy to work around the error [2]. I wonder if we should just do
> > that, then we don't have to insist on a very new msvc version being used and
> > it'll work even if they just decide to fix the internal compiler error.
>
> I'm on board with doing something here, but wouldn't we want to
> back-patch at least a minimal fix to all supported branches?

I think we'd need to backpatch more for older branches. At least

commit 3f28bd7337d
Author: Thomas Munro <tmunro@postgresql.org>
Date:   2022-12-22 17:14:23 +1300

    Add work-around for VA_ARGS_NARGS() on MSVC.


Given that - afaict - tab completion never used to work with msvc, I think
it'd be ok to just do it in 17 or 16+17 or such. Obviously nobody is currently
building with readline support for windows - not sure if any packager is going
to go back and add support for it in older branches.

Packagers aren't likely to be using readline, as it's GPL and it would have to be shipped with packages on Windows. They are more likely to be using libedit if anything. Not sure if that has any bearing on the compilation failure.
 
--

pgsql-hackers by date:

Previous
From: Emanuel Calvo
Date:
Subject: Re: [PATCH] TODO “Allow LISTEN on patterns”
Next
From: Heikki Linnakangas
Date:
Subject: Re: Injection points: preloading and runtime arguments