Skip Menu |
 

This queue is for tickets about the Encode CPAN distribution.

Report information
The Basics
Id: 86974
Status: resolved
Priority: 0/
Queue: Encode

People
Owner: Nobody in particular
Requestors: khw [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)

Attachments
0002-Deterministically-order-includes-in-generated-files.patch



Subject: Patch to output #includes in deterministic order
MIME-Version: 1.0
X-Mailer: MIME-tools 5.504 (Entity 5.504)
X-RT-Interface: Web
Message-ID: <rt-4.0.13-26399-1373997762-1061.0-0-0 [...] rt.cpan.org>
X-RT-Original-Encoding: utf-8
Content-Type: multipart/mixed; boundary="----------=_1373997762-26399-2"
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 0
Content-Disposition: inline
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: binary
Content-Length: 710
Download (untitled) / with headers
text/plain 710b
Since hash retrieval randomization in Perl v5.18, Encode generated files such as CN/CN.xs have their header files #included in random order. This would hardly seem to matter, but it does for one reason, and that is that it sometimes is useful to compare two versions of Perl build directory structures to see what is different between them. For example, I use this on occasion to try to figure what what could be causing a bug, when other approaches have failed. The random ordering of these header #includes shows up in the compare as differences, which distracts from finding the actual meaningful differences. So please consider applying the attached patch the next time you release a new Encode version
Subject: 0002-Deterministically-order-includes-in-generated-files.patch
MIME-Version: 1.0
Content-Type: text/x-diff; name="0002-Deterministically-order-includes-in-generated-files.patch"
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline; filename="0002-Deterministically-order-includes-in-generated-files.patch"
Content-Transfer-Encoding: binary
Content-Length: 6849
From 1234b752237dd3d3da43e3ff0a782a2155213371 Mon Sep 17 00:00:00 2001 From: Karl Williamson <public@khwilliamson.com> Date: Tue, 16 Jul 2013 11:25:54 -0600 Subject: [PATCH 2/2] Deterministically order #includes in generated files This causes the #include files in generated files such as TW/TW.xs to always be in the same order. This makes it easier to find the meaningful differences when comparing two versions of what Encode generates. --- cpan/Encode/Byte/Makefile.PL | 4 ++-- cpan/Encode/CN/Makefile.PL | 4 ++-- cpan/Encode/EBCDIC/Makefile.PL | 4 ++-- cpan/Encode/Encode/Makefile_PL.e2x | 10 +++++----- cpan/Encode/JP/Makefile.PL | 4 ++-- cpan/Encode/KR/Makefile.PL | 4 ++-- cpan/Encode/Symbol/Makefile.PL | 4 ++-- cpan/Encode/TW/Makefile.PL | 4 ++-- 8 files changed, 19 insertions(+), 19 deletions(-) diff --git a/cpan/Encode/Byte/Makefile.PL b/cpan/Encode/Byte/Makefile.PL index 60caf38..e368ac8 100644 --- a/cpan/Encode/Byte/Makefile.PL +++ b/cpan/Encode/Byte/Makefile.PL @@ -108,7 +108,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -137,7 +137,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; diff --git a/cpan/Encode/CN/Makefile.PL b/cpan/Encode/CN/Makefile.PL index 6d54404..323b47e 100644 --- a/cpan/Encode/CN/Makefile.PL +++ b/cpan/Encode/CN/Makefile.PL @@ -84,7 +84,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -113,7 +113,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; diff --git a/cpan/Encode/EBCDIC/Makefile.PL b/cpan/Encode/EBCDIC/Makefile.PL index 0e2a13c..1c78c6a 100644 --- a/cpan/Encode/EBCDIC/Makefile.PL +++ b/cpan/Encode/EBCDIC/Makefile.PL @@ -65,7 +65,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -94,7 +94,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; diff --git a/cpan/Encode/Encode/Makefile_PL.e2x b/cpan/Encode/Encode/Makefile_PL.e2x index ece5883..9fe60ef 100644 --- a/cpan/Encode/Encode/Makefile_PL.e2x +++ b/cpan/Encode/Encode/Makefile_PL.e2x @@ -83,7 +83,7 @@ sub post_initialize if $^O eq 'MacOS' && $self->{SOURCE} !~ /\b$name\.c\b/; # $self->{'H'} = [$self->catfile($self->updir,'encode.h')]; my %xs; - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { push (@{$self->{'C'}},"$table.c"); # Do NOT add $table.h etc. to H_FILES unless we own up as to how they # get built. @@ -101,7 +101,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -130,7 +130,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; @@ -144,14 +144,14 @@ sub postamble my $dir = "."; # $self->catdir('Encode'); my $str = "# $name\$(OBJ_EXT) depends on .h and .exh files not .c files - but all written by enc2xs\n"; $str .= "$name.c : $name.xs "; - foreach my $table (keys %tables) + foreach my $table (sort keys %tables) { $str .= " $table.c"; } $str .= "\n\n"; $str .= "$name\$(OBJ_EXT) : $name.c\n\n"; - foreach my $table (keys %tables) + foreach my $table (sort keys %tables) { my $numlines = 1; my $lengthsofar = length($str); diff --git a/cpan/Encode/JP/Makefile.PL b/cpan/Encode/JP/Makefile.PL index a75685e..c6a725f 100644 --- a/cpan/Encode/JP/Makefile.PL +++ b/cpan/Encode/JP/Makefile.PL @@ -84,7 +84,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -113,7 +113,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; diff --git a/cpan/Encode/KR/Makefile.PL b/cpan/Encode/KR/Makefile.PL index e95d039..49c0319 100644 --- a/cpan/Encode/KR/Makefile.PL +++ b/cpan/Encode/KR/Makefile.PL @@ -82,7 +82,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -111,7 +111,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; diff --git a/cpan/Encode/Symbol/Makefile.PL b/cpan/Encode/Symbol/Makefile.PL index 23ca1f4..2c94aab 100644 --- a/cpan/Encode/Symbol/Makefile.PL +++ b/cpan/Encode/Symbol/Makefile.PL @@ -70,7 +70,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -99,7 +99,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; diff --git a/cpan/Encode/TW/Makefile.PL b/cpan/Encode/TW/Makefile.PL index 99c94bf..f90861f 100644 --- a/cpan/Encode/TW/Makefile.PL +++ b/cpan/Encode/TW/Makefile.PL @@ -80,7 +80,7 @@ sub post_initialize #define U8 U8 #include "encode.h" END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.h"\n]; } print XS <<"END"; @@ -109,7 +109,7 @@ PROTOTYPES: DISABLE BOOT: { END - foreach my $table (keys %tables) { + foreach my $table (sort keys %tables) { print XS qq[#include "${table}.exh"\n]; } print XS "}\n"; -- 1.8.1.3
MIME-Version: 1.0
In-Reply-To: <rt-4.0.13-26399-1373997762-1061.0-0-0 [...] rt.cpan.org>
X-Mailer: MIME-tools 5.504 (Entity 5.504)
Content-Disposition: inline
X-RT-Interface: Web
References: <rt-4.0.13-26399-1373997762-1061.0-0-0 [...] rt.cpan.org>
Content-Type: text/plain; charset="utf-8"
Message-ID: <rt-4.0.13-3546-1373998385-1009.86974-0-0 [...] rt.cpan.org>
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
X-RT-Encrypt: 0
X-RT-Sign: 0
Content-Length: 967
Download (untitled) / with headers
text/plain 967b
Thank you. applied in the repository. https://github.com/dankogai/p5-encode/commit/e800b1d3cc678e29ae6e95c3f3916b65439fd99c Dan the Maintainer Thereof On Tue Jul 16 14:02:42 2013, khw wrote: Show quoted text
> Since hash retrieval randomization in Perl v5.18, Encode generated > files such as CN/CN.xs have their header files #included in random > order. This would hardly seem to matter, but it does for one > reason, and that is that it sometimes is useful to compare two > versions of Perl build directory structures to see what is > different between them. For example, I use this on occasion to try > to figure what what could be causing a bug, when other approaches > have failed. > > The random ordering of these header #includes shows up in the compare > as differences, which distracts from finding the actual meaningful > differences. > > So please consider applying the attached patch the next time you > release a new Encode version


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.