Fix fmgroids.h not regenerated after "clean" (not "clean dist") on Windows
Hi all
There's an issue with MSVC builds on Windows where clean.bat deletes
src\include\utils\fmgroids.h (as it should) but build.pl doesn't
re-create it reliably.
It's created fine on the first build because Gen_fmgrtab.pl is called if
src\backend\utils\fmgrtab.c is missing, which it is on first build.
Generating it also generates src\backend\utils\fmgroids.h, which is
copied to src\include. However, this copy isn't repeated after clean
deletes src\include\utils\fmgroids.h .
"clean dist" is fine, since it deletes fmgrtab.c too, causing the whole
thing to be re-generated.
The attached patch fixes the issue.
--
Craig Ringer
Attachments:
0001-Win32-replace-fmgroids.h-if-removed-by-clean.bat.patchtext/plain; charset=windows-1252; name=0001-Win32-replace-fmgroids.h-if-removed-by-clean.bat.patchDownload
>From 29aa537a8e5ef50f620e104eb98bca74538b5ac7 Mon Sep 17 00:00:00 2001
From: Craig Ringer <ringerc@ringerc.id.au>
Date: Thu, 6 Dec 2012 03:25:17 -0800
Subject: [PATCH] Win32: replace fmgroids.h if removed by clean.bat
Fix a win32 build issue
clean.bat was removing src/include/utils/fmgroids.h
but build.bat wasn't replacing it if it'd already re-generated
fmgrtab from pg_proc.h. Ensure that src/include/utils/fmgroids.h
is always copied over if it's missing.
---
src/tools/msvc/Solution.pm | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index d7dbc5d..850a1df 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -275,6 +275,9 @@ s{PG_VERSION_STR "[^"]+"}{__STRINGIFY(x) #x\n#define __STRINGIFY2(z) __STRINGIFY
system(
"perl -I ../catalog Gen_fmgrtab.pl ../../../src/include/catalog/pg_proc.h");
chdir('..\..\..');
+ }
+ if (IsNewer('src\include\utils\fmgroids.h', 'src\backend\utils\fmgroids.h'))
+ {
copyFile('src\backend\utils\fmgroids.h',
'src\include\utils\fmgroids.h');
}
--
1.7.11.msysgit.0
On Wed, Dec 12, 2012 at 8:07 AM, Craig Ringer <craig@2ndquadrant.com> wrote:
Hi all
There's an issue with MSVC builds on Windows where clean.bat deletes
src\include\utils\fmgroids.h (as it should) but build.pl doesn't
re-create it reliably.It's created fine on the first build because Gen_fmgrtab.pl is called if
src\backend\utils\fmgrtab.c is missing, which it is on first build.
Generating it also generates src\backend\utils\fmgroids.h, which is
copied to src\include. However, this copy isn't repeated after clean
deletes src\include\utils\fmgroids.h ."clean dist" is fine, since it deletes fmgrtab.c too, causing the whole
thing to be re-generated.The attached patch fixes the issue.
Looks good to me. Applied and backpatched to 9.2 - the logic appears
slightly different before that.
--
Magnus Hagander
Me: http://www.hagander.net/
Work: http://www.redpill-linpro.com/
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers