Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9a9f25e

Browse files
committed
Fix MSVC build script's check for obsolete node support functions.
Commit 964d01a was a few bricks shy of a load here: the script checked whether gen_node_support.pl itself had been updated since it was last run, but not whether any of its input files had been updated. Fix that. While here, scrape the list of input files from the Makefiles rather than having a duplicate copy, as we do for most other lists of source files. In passing, improve gen_node_support.pl's error report for an incorrect file list. Per gripe from Amit Kapila. Discussion: https://postgr.es/m/CAA4eK1KQk4vP-3mTAz26h-PRUZaGu8Fc=q-ZKSajsAthH0A15w@mail.gmail.com
1 parent 71cac85 commit 9a9f25e

File tree

2 files changed

+23
-29
lines changed

2 files changed

+23
-29
lines changed

src/backend/nodes/gen_node_support.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ sub elem
174174

175175

176176
## check that we have the expected number of files on the command line
177-
die "wrong number of input files, expected @all_input_files\n"
177+
die "wrong number of input files, expected:\n@all_input_files\ngot:\n@ARGV\n"
178178
if ($#ARGV != $#all_input_files);
179179

180180
## read input

src/tools/msvc/Solution.pm

Lines changed: 22 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -797,36 +797,30 @@ EOF
797797
close($chs);
798798
}
799799

800-
if (IsNewer(
801-
'src/backend/nodes/node-support-stamp',
802-
'src/backend/nodes/gen_node_support.pl'))
800+
my $nmf = Project::read_file('src/backend/nodes/Makefile');
801+
$nmf =~ s{\\\r?\n}{}g;
802+
$nmf =~ /^node_headers\s*:?=(.*)$/gm
803+
|| croak "Could not find node_headers in Makefile\n";
804+
my @node_headers = split /\s+/, $1;
805+
@node_headers = grep { $_ ne '' } @node_headers;
806+
my @node_files = map { "src/include/$_" } @node_headers;
807+
808+
my $need_node_support = 0;
809+
foreach my $nodefile (@node_files)
803810
{
804-
# XXX duplicates node_headers list in src/backend/nodes/Makefile
805-
my @node_headers = qw(
806-
nodes/nodes.h
807-
nodes/primnodes.h
808-
nodes/parsenodes.h
809-
nodes/pathnodes.h
810-
nodes/plannodes.h
811-
nodes/execnodes.h
812-
access/amapi.h
813-
access/sdir.h
814-
access/tableam.h
815-
access/tsmapi.h
816-
commands/event_trigger.h
817-
commands/trigger.h
818-
executor/tuptable.h
819-
foreign/fdwapi.h
820-
nodes/extensible.h
821-
nodes/lockoptions.h
822-
nodes/replnodes.h
823-
nodes/supportnodes.h
824-
nodes/value.h
825-
utils/rel.h
826-
);
827-
828-
my @node_files = map { "src/include/$_" } @node_headers;
811+
if (IsNewer('src/backend/nodes/node-support-stamp', $nodefile))
812+
{
813+
$need_node_support = 1;
814+
last;
815+
}
816+
}
817+
$need_node_support = 1
818+
if IsNewer(
819+
'src/backend/nodes/node-support-stamp',
820+
'src/backend/nodes/gen_node_support.pl');
829821

822+
if ($need_node_support)
823+
{
830824
system("perl src/backend/nodes/gen_node_support.pl --outdir src/backend/nodes @node_files");
831825
open(my $f, '>', 'src/backend/nodes/node-support-stamp')
832826
|| confess "Could not touch node-support-stamp";

0 commit comments

Comments
 (0)