Bug#826993: libcss-dom-perl: FTBFS on stable: t/charset.t test failure
Dominic Hargreaves
dom at earth.li
Sat Jun 11 10:54:10 UTC 2016
On Sat, Jun 11, 2016 at 02:09:54AM +0200, gregor herrmann wrote:
> Control: fixed -1 0.16-1
> Control: forwarded -1 https://rt.cpan.org/Public/Bug/Display.html?id=107221
> Control: tag -1 + upstream fixed-upstream patch
>
> On Sat, 11 Jun 2016 00:31:51 +0100, Dominic Hargreaves wrote:
>
> > Source: libcss-dom-perl
> > Version: 0.15-1
> > Severity: serious
> > Justification: FTBFS
> >
> > This package FTBFS on stable:
> >
> > # "utf-16" is encoded in UCS-2-LE but is not UCS-2-LE-based
> > Can't call method "cssText" on an undefined value at t/charset.t line 144.
> > # Looks like you planned 23 tests but ran 9.
> > # Looks like your test exited with 2 just after 9.
> > t/charset.t ..........................
> > Dubious, test returned 2 (wstat 512, 0x200)
> > Failed 14/23 subtests
> >
> > The full build log can be found here:
> >
> > http://perl.debian.net/rebuild-logs/jessie/libcss-dom-perl_0.15-1/libcss-dom-perl_0.15-1_amd64-20160610-0308.build
>
> Some quick tests show:
> - 0.15-1 fails in stable, testing, and unstable chroots
> - 0.16-1 passes in stable, testing, and unstable chroots
>
> The diff between 0.15 and 0.16 shows:
>
> +0.16 29 November, 2015
> + • Work around an incompatible change in Encode 2.77 (RT
> + #107221, #107043).
>
> diff --git a/lib/CSS/DOM/Parser.pm b/lib/CSS/DOM/Parser.pm
> index 7c2156e..8eb5c1d 100644
> --- a/lib/CSS/DOM/Parser.pm
> +++ b/lib/CSS/DOM/Parser.pm
> @@ -1,6 +1,6 @@
> package CSS::DOM::Parser;
>
> -$VERSION = '0.15';
> +$VERSION = '0.16';
>
> use strict; use warnings; no warnings qw 'utf8 parenthesis';
> use re 'taint';
> @@ -578,7 +578,7 @@ sub _decode { my $at; for(''.shift) {
> ) {
> my $origenc = my $enc = Encode::decode('utf16le', $2);
> my $dec = eval{Encode::decode($enc, $1, 9)};
> - defined $dec or $dec
> + !defined $dec || $dec !~ /^\@/ and $dec
> = eval{Encode::decode($enc.='-le', $1, 9)};
> if(defined $dec) {
> $dec eq "\@charset \"$origenc\";"
> @@ -638,7 +638,7 @@ sub _decode { my $at; for(''.shift) {
> ) {
> my $origenc = my $enc = Encode::decode('utf32le', $2);
> my $dec = eval{Encode::decode($enc, $1, 9)};
> - defined $dec or $dec
> + !defined $dec || $dec !~ /^\@/ and $dec
> = eval{Encode::decode($enc.='-le', $1, 9)};
> if(defined $dec) {
> $dec eq "\@charset \"$origenc\";"
>
>
> With this change, the tests pass in stable.
> (Unsurprisingly, since this is the only difference between 0.15 and 0.16.)
>
>
> (What surprises me is how a fix for Encode 2.77 works, if perl 5.20.2
> ships Encode 2.60. And libencode-perl isn't installed; but that would
> be 2.63 in stable.)
Right, but Encode in core is patched and that does indeed introduce
the breakage in CSS::DOM:
https://sources.debian.net/src/perl/5.20.2-3%2Bdeb8u5/debian/patches/fixes/encode-unicode-bom.diff/
https://rt.cpan.org/Ticket/Display.html?id=107043#txn-1563760
This appeared in 5.20.2-3+deb8u3 in January.
The same patch is in the separate package:
https://sources.debian.net/src/libencode-perl/2.63-1%2Bdeb8u1/debian/patches/dont-die-without-bom.patch/
which appeared in December.
Dominic.
More information about the pkg-perl-maintainers
mailing list