master fails to build on Windows
Hi
I was building the sources I got from https://www.postgresql.org/
ftp/snapshot/dev/ on Windows x64 and got the whole bunch of errors
like "*Cannot
open include file: 'catalog/pg_type_d.h"* , *"Cannot open include file:
'catalog/pg_tablespace_d.h'" . *I've attached the log.
The renaming was done as part of following commit, but the location where
*_d.h are present is not included in INCLUDE. Example: pg_type.h is present
at *src/include/catalog/ *and pg_type_d.h is present at
*src/backend/catalog/*. I added the required path in MSBuildProject.pm and
the build is passed. Here is the diff:
298c298
< <AdditionalIncludeDirectories>$self->{prefixincludes}src/
include;src/include/port/win32;src/include/port/win32_msvc;$includes\%(
AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
---
<AdditionalIncludeDirectories>$self->{prefixincludes}src/
include;src/backend;src/include/port/win32;src/include/port/win32_msvc;$
includes\%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
commit 9c0a0de4c91b2dc911220d769cf2c5f754cfcb90
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: Sun Apr 8 13:59:52 2018 -0400
--
Sandeep Thakkar
Attachments:
On 5/18/18, Sandeep Thakkar <sandeep.thakkar@enterprisedb.com> wrote:
Hi
I was building the sources I got from https://www.postgresql.org/
ftp/snapshot/dev/ on Windows x64 and got the whole bunch of errors
like "*Cannot
open include file: 'catalog/pg_type_d.h"* , *"Cannot open include file:
'catalog/pg_tablespace_d.h'" . *I've attached the log.
I'm thinking the include/catalog/pg_*_d.h headers got dist-cleaned
when creating the snapshot, and the build script doesn't know to copy
them over. If you're able to test, does the attached patch fix the
issue? (This may not be the right permanent fix, but hopefully it will
confirm my suspicion)
-John Naylor
Attachments:
msvc-copy-bki-to-include-dir.patchtext/x-patch; charset=US-ASCII; name=msvc-copy-bki-to-include-dir.patchDownload
diff --git a/src/tools/msvc/Solution.pm b/src/tools/msvc/Solution.pm
index 4ad1f8f..a33e68e 100644
--- a/src/tools/msvc/Solution.pm
+++ b/src/tools/msvc/Solution.pm
@@ -501,7 +501,12 @@ EOF
|| confess "Could not touch bki-stamp";
close($f);
chdir('../../..');
+ }
+ if (IsNewer(
+ 'src/include/catalog/header-stamp',
+ 'src/backend/catalog/bki-stamp'))
+ {
# Copy generated headers to include directory.
opendir(my $dh, 'src/backend/catalog/')
|| die "Can't opendir src/backend/catalog/ $!";
@@ -516,6 +521,9 @@ EOF
copyFile(
'src/backend/catalog/schemapg.h',
'src/include/catalog/schemapg.h');
+ open(my $chs, '>', 'src/include/catalog/header-stamp')
+ || confess "Could not touch header-stamp";
+ close($chs);
}
open(my $o, '>', "doc/src/sgml/version.sgml")
diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat
index a041ef2..6545442 100755
--- a/src/tools/msvc/clean.bat
+++ b/src/tools/msvc/clean.bat
@@ -49,6 +49,7 @@ if exist src\include\storage\lwlocknames.h del /q src\include\storage\lwlockname
if exist src\include\utils\probes.h del /q src\include\utils\probes.h
if exist src\include\catalog\schemapg.h del /q src\include\catalog\schemapg.h
if exist src\include\catalog\pg_*_d.h del /q src\include\catalog\pg_*_d.h
+if exist src\include\catalog\header-stamp del /q src\include\catalog\header-stamp
if exist doc\src\sgml\version.sgml del /q doc\src\sgml\version.sgml
if %DIST%==1 if exist src\backend\utils\fmgroids.h del /q src\backend\utils\fmgroids.h
John Naylor <jcnaylor@gmail.com> writes:
On 5/18/18, Sandeep Thakkar <sandeep.thakkar@enterprisedb.com> wrote:
I was building the sources I got from https://www.postgresql.org/
ftp/snapshot/dev/ on Windows x64 and got the whole bunch of errors
like "*Cannot
open include file: 'catalog/pg_type_d.h"* , *"Cannot open include file:
'catalog/pg_tablespace_d.h'" . *I've attached the log.
I'm thinking the include/catalog/pg_*_d.h headers got dist-cleaned
when creating the snapshot, and the build script doesn't know to copy
them over. If you're able to test, does the attached patch fix the
issue? (This may not be the right permanent fix, but hopefully it will
confirm my suspicion)
Mmm, yeah, this is clearly an oversight. I think we (or at least I)
figured it was okay to skip the separate stamp file and test
for the install-the-headers step because the Windows scripts didn't
have a way to blow away the include/ headers without deleting the
underlying backend/ headers --- but looking closer at clean.bat,
that's quite wrong. clean.bat will do it by default :-(. So I think
the snapshot was probably fine, but Sandeep ran clean.bat and then
things weren't fine.
It seems like clean.bat's default behavior doesn't correspond very well
to any of the three cleaning levels that the Makefiles understand,
while its "dist" behavior seems to be "make maintainer-clean", not
"make distclean" as one might expect. Maybe that's something to
improve someday, but right now is probably not the time.
In the meantime, I think your patch is a good idea whether or not
this is the right explanation for Sandeep's problem. The closer
the Windows and Unix build rules are, the better.
regards, tom lane
On Fri, May 18, 2018 at 5:19 PM, John Naylor <jcnaylor@gmail.com> wrote:
On 5/18/18, Sandeep Thakkar <sandeep.thakkar@enterprisedb.com> wrote:
Hi
I was building the sources I got from https://www.postgresql.org/
ftp/snapshot/dev/ on Windows x64 and got the whole bunch of errors
like "*Cannot
open include file: 'catalog/pg_type_d.h"* , *"Cannot open include file:
'catalog/pg_tablespace_d.h'" . *I've attached the log.I'm thinking the include/catalog/pg_*_d.h headers got dist-cleaned
when creating the snapshot, and the build script doesn't know to copy
them over. If you're able to test, does the attached patch fix the
issue? (This may not be the right permanent fix, but hopefully it will
confirm my suspicion)yes, the patch fixes the issue. Thanks.
-John Naylor
--
Sandeep Thakkar
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company