Re: Reduce the number of special cases to build contrib modules on windows

2021-08-09 Thread David Rowley
On Fri, 30 Jul 2021 at 15:05, David Rowley wrote: > Does anyone have any thoughts on where we should draw the line on > parsing Makefiles? I'm a little worried that I'm adding pasing just > for exactly how the Makefiles are today and that it could easily be > broken if something is adjusted later

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-29 Thread David Rowley
On Thu, 29 Jul 2021 at 00:05, David Rowley wrote: > I pushed the v9 0001 and 0005 patch after adjusting the AddFile($self, > ...) to become $self->AddFile(...) I pushed all the patches, apart from the 0004 patch. One weird thing I noticed with the -D define patch (245de4845) and the LOWER_NODE a

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-28 Thread David Rowley
On Wed, 28 Jul 2021 at 03:52, Dagfinn Ilmari Mannsåker wrote: > > Alvaro Herrera writes: > > I think using the return value of grep as a boolean is confusing. It > > seems more legible to compare to 0. So instead of this: > > > > + if (! grep { $_ eq $ref} @{ $self->{references} })

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread David Rowley
On Wed, 28 Jul 2021 at 04:01, Alvaro Herrera wrote: > > On 2021-Jul-27, Dagfinn Ilmari Mannsåker wrote: > > > Alvaro Herrera writes: > > > > + if (grep { $_ eq $ref} @{ $self->{references} } == 0) > > > > I disagree. Using grep in boolean context is perfectly idiomatic perl. > > What w

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread David Rowley
On Wed, 28 Jul 2021 at 03:52, Dagfinn Ilmari Mannsåker wrote: > > Alvaro Herrera writes: > > > On 2021-Jul-28, David Rowley wrote: > > > >> 0003: Is a tidy up patch to make the 'includes' field an array rather > >> than a string > > > > In this one, you can avoid turning one line into four with m

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread David Rowley
On Wed, 28 Jul 2021 at 01:44, Dagfinn Ilmari Mannsåker wrote: > I don't know anything about the MSVC build process, but I figured I > could do a general Perl code review. Thanks for looking at this. Perl review is very useful as it's certainly not my native tongue, as you might have noticed. > >

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread David Rowley
On Wed, 28 Jul 2021 at 02:33, Tom Lane wrote: > > David Rowley writes: > > 0001: Removes an include directory for dblink. This appears like it's > > not needed. It was added in ee3b4188a (Jan 2010), but an earlier > > commit, 320c7eb8c (June 2008) seems to have made it pointless. It's > > still a

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread Alvaro Herrera
On 2021-Jul-27, Dagfinn Ilmari Mannsåker wrote: > Alvaro Herrera writes: > > + if (grep { $_ eq $ref} @{ $self->{references} } == 0) > > I disagree. Using grep in boolean context is perfectly idiomatic perl. > What would be more idiomatic is List::Util::any, but that's not availble >

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread Dagfinn Ilmari Mannsåker
Alvaro Herrera writes: > On 2021-Jul-28, David Rowley wrote: > >> 0003: Is a tidy up patch to make the 'includes' field an array rather >> than a string > > In this one, you can avoid turning one line into four with map, > > - $p->AddIncludeDir($pl_proj->{includes}); > + foreach my $inc (

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread Andrew Dunstan
On 7/27/21 11:01 AM, Alvaro Herrera wrote: > On 2021-Jul-28, David Rowley wrote: > >> 0003: Is a tidy up patch to make the 'includes' field an array rather >> than a string > In this one, you can avoid turning one line into four with map, > > - $p->AddIncludeDir($pl_proj->{includes}); > +

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread Alvaro Herrera
On 2021-Jul-28, David Rowley wrote: > 0003: Is a tidy up patch to make the 'includes' field an array rather > than a string In this one, you can avoid turning one line into four with map, - $p->AddIncludeDir($pl_proj->{includes}); + foreach my $inc (@{ $pl_proj->{includes} }) +

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread Tom Lane
David Rowley writes: > 0001: Removes an include directory for dblink. This appears like it's > not needed. It was added in ee3b4188a (Jan 2010), but an earlier > commit, 320c7eb8c (June 2008) seems to have made it pointless. It's > still a mystery to me why ee3b4188a would have been required in th

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread Dagfinn Ilmari Mannsåker
David Rowley writes: > On Thu, 15 Jul 2021 at 04:01, vignesh C wrote: >> The patch does not apply on Head anymore, could you rebase and post a >> patch. I'm changing the status to "Waiting for Author". > > I've rebased this patch and broken it down into 6 individual patches. I don't know anythi

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-27 Thread David Rowley
On Thu, 15 Jul 2021 at 04:01, vignesh C wrote: > The patch does not apply on Head anymore, could you rebase and post a > patch. I'm changing the status to "Waiting for Author". I've rebased this patch and broken it down into 6 individual patches. 0001: Removes an include directory for dblink. Th

Re: Reduce the number of special cases to build contrib modules on windows

2021-07-14 Thread vignesh C
On Mon, Apr 19, 2021 at 5:18 PM David Rowley wrote: > > On Wed, 3 Mar 2021 at 22:37, David Rowley wrote: > > I've attached a rebased patch. > > I've rebased this again. > > I also moved away from using hash tables for storing references and > libraries. I was having some problems getting psql to

Re: Reduce the number of special cases to build contrib modules on windows

2021-04-19 Thread David Rowley
On Tue, 20 Apr 2021 at 09:28, Andrew Dunstan wrote: > > > On 4/19/21 12:24 PM, Alvaro Herrera wrote: > >> diff --git a/src/tools/msvc/MSBuildProject.pm > >> b/src/tools/msvc/MSBuildProject.pm > >> index ebb169e201..68606a296d 100644 > >> --- a/src/tools/msvc/MSBuildProject.pm > >> +++ b/src/tools

Re: Reduce the number of special cases to build contrib modules on windows

2021-04-19 Thread Andrew Dunstan
On 4/19/21 12:24 PM, Alvaro Herrera wrote: >> diff --git a/src/tools/msvc/MSBuildProject.pm >> b/src/tools/msvc/MSBuildProject.pm >> index ebb169e201..68606a296d 100644 >> --- a/src/tools/msvc/MSBuildProject.pm >> +++ b/src/tools/msvc/MSBuildProject.pm >> @@ -310,11 +310,12 @@ sub WriteItemDefin

Re: Reduce the number of special cases to build contrib modules on windows

2021-04-19 Thread Alvaro Herrera
> diff --git a/src/tools/msvc/MSBuildProject.pm > b/src/tools/msvc/MSBuildProject.pm > index ebb169e201..68606a296d 100644 > --- a/src/tools/msvc/MSBuildProject.pm > +++ b/src/tools/msvc/MSBuildProject.pm > @@ -310,11 +310,12 @@ sub WriteItemDefinitionGroup > my $targetmachine = > $s

Re: Reduce the number of special cases to build contrib modules on windows

2021-04-19 Thread David Rowley
On Wed, 3 Mar 2021 at 22:37, David Rowley wrote: > I've attached a rebased patch. I've rebased this again. I also moved away from using hash tables for storing references and libraries. I was having some problems getting psql to compile due to the order of the dependencies being reversed due to

Re: Reduce the number of special cases to build contrib modules on windows

2021-03-03 Thread David Rowley
Thank you for having another look at this. On Tue, 12 Jan 2021 at 20:18, Michael Paquier wrote: > > On Wed, Dec 30, 2020 at 10:07:29AM +1300, David Rowley wrote: > > -#ifdef LOWER_NODE > > +/* > > + * Below we ignore the fact that LOWER_NODE is defined when compiling with > > + * MSVC. The reaso

Re: Reduce the number of special cases to build contrib modules on windows

2021-01-11 Thread Michael Paquier
On Wed, Dec 30, 2020 at 10:07:29AM +1300, David Rowley wrote: > -#ifdef LOWER_NODE > +/* > + * Below we ignore the fact that LOWER_NODE is defined when compiling with > + * MSVC. The reason for this is that earlier versions of the MSVC build > + * scripts failed to define LOWER_NODE. More recent

Re: Reduce the number of special cases to build contrib modules on windows

2020-12-29 Thread David Rowley
On Wed, 30 Dec 2020 at 10:03, David Rowley wrote: > > On Wed, 23 Dec 2020 at 18:46, Michael Paquier wrote: > > I have tested your patch, and this is causing compilation failures for > > hstore_plpython, jsonb_plpython and ltree_plpython. So > > AddTransformModule is missing something here when c

Re: Reduce the number of special cases to build contrib modules on windows

2020-12-29 Thread David Rowley
On Wed, 23 Dec 2020 at 18:46, Michael Paquier wrote: > I have begun a new thread about this point as that's a separate > topic. I did not see other places in need of a similar cleanup: > https://www.postgresql.org/message-id/x+lqpflyk7jgz...@paquier.xyz Thanks. I'll look at that shortly. > > I

Re: Reduce the number of special cases to build contrib modules on windows

2020-12-22 Thread Michael Paquier
On Tue, Dec 22, 2020 at 11:24:40PM +1300, David Rowley wrote: > On Wed, 11 Nov 2020 at 13:44, Michael Paquier wrote: >> It seems to me that your patch is doing the right thing for adminpack >> and that its Makefile has no need to include a reference to libpq >> source path, no? > > Yeah. Likely

Re: Reduce the number of special cases to build contrib modules on windows

2020-12-22 Thread David Rowley
On Wed, 11 Nov 2020 at 13:44, Michael Paquier wrote: > > On Wed, Nov 11, 2020 at 11:01:57AM +1300, David Rowley wrote: > > I'm still working through some small differences in some of the > > .vcxproj files. I've been comparing these by copying *.vcxproj out to > > another directory with patched a

Re: Reduce the number of special cases to build contrib modules on windows

2020-11-10 Thread Michael Paquier
On Wed, Nov 11, 2020 at 11:01:57AM +1300, David Rowley wrote: > I'm still working through some small differences in some of the > .vcxproj files. I've been comparing these by copying *.vcxproj out to > another directory with patched and unpatched then diffing the > directory. See attached txt file

Re: Reduce the number of special cases to build contrib modules on windows

2020-11-10 Thread David Rowley
On Tue, 10 Nov 2020 at 03:07, Alvaro Herrera wrote: > > On 2020-Nov-06, David Rowley wrote: > > > +# Handle makefile rules for when file to be added to the project > > +# does not exist. Returns 1 when the original file add should be > > +# skipped. > > +sub FindAndAddAdditionalFiles > > +{ > > +

Re: Reduce the number of special cases to build contrib modules on windows

2020-11-09 Thread Alvaro Herrera
On 2020-Nov-06, David Rowley wrote: > +# Handle makefile rules for when file to be added to the project > +# does not exist. Returns 1 when the original file add should be > +# skipped. > +sub FindAndAddAdditionalFiles > +{ > + my $self = shift; > + my $fname = shift; > + my ($ext) =

Re: Reduce the number of special cases to build contrib modules on windows

2020-11-05 Thread David Rowley
Thank you for looking at this. On Tue, 3 Nov 2020 at 09:49, Andres Freund wrote: > > diff --git a/src/tools/msvc/Mkvcbuild.pm b/src/tools/msvc/Mkvcbuild.pm > > index 90594bd41b..491a465e2f 100644 > > --- a/src/tools/msvc/Mkvcbuild.pm > > +++ b/src/tools/msvc/Mkvcbuild.pm > > @@ -32,16 +32,13 @@ m

Re: Reduce the number of special cases to build contrib modules on windows

2020-11-02 Thread Andres Freund
Hi, On 2020-11-02 20:34:28 +1300, David Rowley wrote: > It might be nice if we could reduce some of those special cases so > that: > > a) We reduce the amount of work specific to windows when we add new > contrib modules, and; > b) We can work towards a better way for people to build their own >