pg_xlogdump MSVC build script oddities

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andrew Dunstan <andrew(at)dunslane(dot)net>
Subject: pg_xlogdump MSVC build script oddities
Date: 2015-03-19 18:25:41
Message-ID: 550B14A5.7060708@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

When a frontend program needs to compile a file from another directory,
Mkvcbuild.pm usually does something like this:

> $pgdumpall->AddFile('src\bin\pg_dump\keywords.c');
> $pgdumpall->AddFile('src\backend\parser\kwlookup.c');

But for pg_xlogdump, it does this:

> foreach my $xf (glob('src/backend/access/rmgrdesc/*desc.c'))
> {
> my $bf = basename $xf;
> copy($xf, "contrib/pg_xlogdump/$bf");
> $pg_xlogdump->AddFile("contrib\\pg_xlogdump\\$bf");
> }
> copy(
> 'src/backend/access/transam/xlogreader.c',
> 'contrib/pg_xlogdump/xlogreader.c');

I.e. usually we instruct MSBuild to compile the source file from where
it is, but for pg_xlogdump, we copy the source file. Is there a reason
for this?

This was done by this commit:

> commit a64e33f030f3ba379a0d3e22fe6bcda9dc3bbc60
> Author: Andrew Dunstan <andrew(at)dunslane(dot)net>
> Date: Mon Feb 25 12:00:53 2013 -0500
>
> Redo MSVC build implementation for pg_xlogdump.
>
> The previous commit didn't work on MSVC editions earlier than
> Visual Studio 2011, apparently. This works by copying files into the
> contrib directory, and making provision to clean them up, which should
> work on all editions.

Which followed this one:

> commit 786170d74f30bc8d3017149dc444f3f3e29029a7
> Author: Andrew Dunstan <andrew(at)dunslane(dot)net>
> Date: Sun Feb 24 20:28:42 2013 -0500
>
> Provide MSVC build setup for pg_xlogdump.

But that earlier commit didn't use the straight AddFile approach either.

I'm guessing that the current state of affairs is just an oversight. I
tried changing it so that xlogreader.c is built into pg_xlogdump without
copying, and it seemed to work. But I'm using a very recent version of
MSVC - perhaps it won't work on pre-VS2011 versions.

Unless someone has some insights on this, I'm going to commit the
attached, and see what the buildfarm thinks of it.

- Heikki

Attachment Content-Type Size
pg_xlogdump-msvc-cleanup-1.patch application/x-patch 1.5 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-03-19 18:42:14 Re: parallel mode and parallel contexts
Previous Message Robert Haas 2015-03-19 18:13:59 Re: parallel mode and parallel contexts