From 630b4f375da441c6f9c14183403e7987d2d987f8 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 22 Jun 2017 16:42:53 -0500 Subject: [PATCH 1/4] Fix 'make test-results' rule for Windows --- configure/RULES_BUILD | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure/RULES_BUILD b/configure/RULES_BUILD index 76765ed91..d678898c6 100644 --- a/configure/RULES_BUILD +++ b/configure/RULES_BUILD @@ -348,7 +348,7 @@ testspec: $(TESTSCRIPTS) test-results: tapfiles ifneq ($(TAPFILES),) ifdef RUNTESTS_ENABLED - prove --failures --ext .tap --exec cat --color $(TAPFILES) + prove --failures --ext .tap --exec "$(CAT)" --color $(TAPFILES) endif endif From a69bd833fc6e29a145c7475c72bea85a32897385 Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 22 Jun 2017 16:45:00 -0500 Subject: [PATCH 2/4] More msi.plt retries for Jenkins builds on Windows --- src/ioc/dbtemplate/test/msi.plt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ioc/dbtemplate/test/msi.plt b/src/ioc/dbtemplate/test/msi.plt index 230a2c18b..9b76d5f66 100644 --- a/src/ioc/dbtemplate/test/msi.plt +++ b/src/ioc/dbtemplate/test/msi.plt @@ -33,9 +33,16 @@ ok(msi('-S../t6-substitute.txt ../t6-template.txt'), slurp('../t6-result.txt')); # Output option -o my $out = 't7-output.txt'; -unlink $out; -msi("-I.. -o $out ../t1-template.txt"); -ok(slurp($out), slurp('../t1-result.txt')); +my $count = 5; # Try up to 5 times... +my $result; +do { + unlink $out; + msi("-I.. -o $out ../t1-template.txt"); + $result = slurp($out); + print "# file from '$msi $args' empty, retrying\n" + if $result eq ''; +} while ($result eq '') && (--$count > 0); +ok($result, slurp('../t1-result.txt')); # Dependency generation, include/substitute model ok(msi('-I.. -D -o t8.txt ../t1-template.txt'), slurp('../t8-result.txt')); From b9d2712738e71ae25e7b0cecdaa1b0941dc2d4fb Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 22 Jun 2017 17:07:56 -0500 Subject: [PATCH 3/4] Argh!!! --- src/ioc/dbtemplate/test/msi.plt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ioc/dbtemplate/test/msi.plt b/src/ioc/dbtemplate/test/msi.plt index 9b76d5f66..bd663070f 100644 --- a/src/ioc/dbtemplate/test/msi.plt +++ b/src/ioc/dbtemplate/test/msi.plt @@ -39,7 +39,7 @@ do { unlink $out; msi("-I.. -o $out ../t1-template.txt"); $result = slurp($out); - print "# file from '$msi $args' empty, retrying\n" + print "# msi output file empty, retrying\n" if $result eq ''; } while ($result eq '') && (--$count > 0); ok($result, slurp('../t1-result.txt')); From 745109e4233cfa31b801fded36ef749ffb709d0e Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 22 Jun 2017 18:38:07 -0500 Subject: [PATCH 4/4] Add loop detection to Release.pm GNUmake will *usually* spot recursive "include" loops first, but not if the loop is in another module that we're just checking. In that case Release.pm eats file descriptors until they run out without this fix. --- src/tools/EPICS/Release.pm | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/tools/EPICS/Release.pm b/src/tools/EPICS/Release.pm index ab12076b0..bceed2ed7 100644 --- a/src/tools/EPICS/Release.pm +++ b/src/tools/EPICS/Release.pm @@ -17,22 +17,24 @@ sub readReleaseFiles { $Rmacros->{'EPICS_HOST_ARCH'} = $hostarch if $hostarch; return unless (-e $relfile); - &readRelease($relfile, $Rmacros, $Rapps); + + my %done; + &readRelease($relfile, $Rmacros, $Rapps, \%done); if ($hostarch) { my $hrelfile = "$relfile.$hostarch"; - &readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile); + &readRelease($hrelfile, $Rmacros, $Rapps, \%done) if (-e $hrelfile); $hrelfile .= '.Common'; - &readRelease($hrelfile, $Rmacros, $Rapps) if (-e $hrelfile); + &readRelease($hrelfile, $Rmacros, $Rapps, \%done) if (-e $hrelfile); } if ($arch) { my $crelfile = "$relfile.Common.$arch"; - &readRelease($crelfile, $Rmacros, $Rapps) if (-e $crelfile); + &readRelease($crelfile, $Rmacros, $Rapps, \%done) if (-e $crelfile); if ($hostarch) { my $arelfile = "$relfile.$hostarch.$arch"; - &readRelease($arelfile, $Rmacros, $Rapps) if (-e $arelfile); + &readRelease($arelfile, $Rmacros, $Rapps, \%done) if (-e $arelfile); } } } @@ -41,10 +43,16 @@ sub readReleaseFiles { # Parse a configure/RELEASE* file and anything it includes # sub readRelease { - my ($file, $Rmacros, $Rapps) = @_; - # $Rmacros is a reference to a hash, $Rapps a ref to an array + my ($file, $Rmacros, $Rapps, $Rdone) = @_; + # $Rmacros and $Rdone are hash-refs, $Rapps an array-ref + + if (exists $Rdone->{$file}) { + die "Release.pm: Recursive loop found in RELEASE files,\n" . + "discovered in $file\n"; + } open(my $IN, '<', $file) or croak "Can't open $file: $!\n"; + $Rdone->{$file}++; while (<$IN>) { chomp; s/ \r $//x; # Shouldn't need this, but sometimes... @@ -69,7 +77,7 @@ sub readRelease { my ($op, $path) = m/^ \s* (-? include) \s+ (.*)/x; $path = expandMacros($path, $Rmacros); if (-e $path) { - &readRelease($path, $Rmacros, $Rapps); + &readRelease($path, $Rmacros, $Rapps, $Rdone); } elsif ($op eq "include") { carp "EPICS/Release.pm: Include file '$path' not found\n"; }