GNU bug report logs -
#14891
GNU Automake 1.14 FAIL: 5
Previous Next
Reported by: Dennis Clarke <dclarke <at> blastwave.org>
Date: Wed, 17 Jul 2013 12:48:02 UTC
Severity: minor
Tags: moreinfo, wontfix
Done: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #11 received at 14891 <at> debbugs.gnu.org (full text, mbox):
On 07/17/2013 01:47 PM, Dennis Clarke wrote:
>
> FAIL: t/preproc-errmsg.sh
> FAIL: t/primary-prefix-invalid-couples.tap 280 - ...
>
These are not Solaris issues AFAIK, but are due to an incompatible
change in perl 5.18. The patch below should take care of it.
Can you confirm it works?
Thanks,
Stefano
---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ---- 8< ----
From 92a253fb8092a71b8c99b3d20073d584c239bf1c Mon Sep 17 00:00:00 2001
Message-Id: <92a253fb8092a71b8c99b3d20073d584c239bf1c.1374429593.git.stefano.lattarini <at> gmail.com>
From: Stefano Lattarini <stefano.lattarini <at> gmail.com>
Date: Sun, 21 Jul 2013 17:58:05 +0100
Subject: [PATCH] automake: account for perl hash order randomization
Try to explicitly order the keys of some perl hashes when looping
on them to do sanity/correctness checks and possibly display warning
messages; this should ensure a more reproducible output. Not really
a big deal, but I prefer to keep the order of such output reproducible
if possible.
Issue revealed by spurious testsuite failures with perl 5.18, as
reported in automake bug#14891. See also:
<http://search.cpan.org/dist/perl-5.18.0/pod/perldelta.pod#Hash_randomization>
<http://onionstand.blogspot.ie/2012/12/are-you-relying-on-hash-keys-being.html>
* lib/Automake/Variable.pm (variables): Explicitly order the values of
the returned Automake::Variable instances.
(variables_dump): Simplify, using the knowledge that 'variables()' now
sorts its output.
* t/preproc-errmsg.sh: Adjust.
Signed-off-by: Stefano Lattarini <stefano.lattarini <at> gmail.com>
---
lib/Automake/Variable.pm | 14 +++++++-------
t/preproc-errmsg.sh | 4 ++--
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/lib/Automake/Variable.pm b/lib/Automake/Variable.pm
index f1559f5..4751563 100644
--- a/lib/Automake/Variable.pm
+++ b/lib/Automake/Variable.pm
@@ -317,21 +317,21 @@ use vars '%_variable_dict', '%_primary_dict';
sub variables (;$)
{
my ($suffix) = @_;
+ my @vars = ();
if ($suffix)
{
if (exists $_primary_dict{$suffix})
{
- return values %{$_primary_dict{$suffix}};
- }
- else
- {
- return ();
+ @vars = values %{$_primary_dict{$suffix}};
}
}
else
{
- return values %_variable_dict;
+ @vars = values %_variable_dict;
}
+ # The behaviour of the 'sort' built-in is undefined in scalar
+ # context, hence we need an ad-hoc handling for such context.
+ return wantarray ? sort { $a->name cmp $b->name } @vars : scalar @vars;
}
=item C<Automake::Variable::reset>
@@ -1080,7 +1080,7 @@ For debugging.
sub variables_dump ()
{
my $text = "all variables:\n{\n";
- foreach my $var (sort { $a->name cmp $b->name } variables)
+ foreach my $var (variables())
{
$text .= $var->dump;
}
diff --git a/t/preproc-errmsg.sh b/t/preproc-errmsg.sh
index 704562d..87bcf81 100644
--- a/t/preproc-errmsg.sh
+++ b/t/preproc-errmsg.sh
@@ -58,11 +58,11 @@ Makefile.am:2: 'sub/local.mk' included from here
sub/local.mk:3: 'sub-two.a' is not a standard library name
sub/local.mk:3: did you mean 'libsub-two.a'?
Makefile.am:2: 'sub/local.mk' included from here
-Makefile.am:1: variable 'x1_SOURCES' is defined but no program or
-Makefile.am:1: library has 'x1' as canonical name (possible typo)
sub/local.mk:4: variable 'sub_x2_SOURCES' is defined but no program or
sub/local.mk:4: library has 'sub_x2' as canonical name (possible typo)
Makefile.am:2: 'sub/local.mk' included from here
+Makefile.am:1: variable 'x1_SOURCES' is defined but no program or
+Makefile.am:1: library has 'x1' as canonical name (possible typo)
END
# We need to break these substitutions into multiple sed invocations
--
1.8.3.1.605.g85318f5
This bug report was last modified 10 years and 216 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.