Code Monkey home page Code Monkey logo

mozilla-publicsuffix's People

Contributors

gquipster avatar mbroadhead avatar stwlam avatar tomhukins avatar yaneti avatar

Watchers

 avatar  avatar  avatar

mozilla-publicsuffix's Issues

IO::File->new() is being handled by IO::Handle->new(), and croaking, with IO-1.25

While installing v0.1.18, I encountered the following most unusual error:

$ ./Build.PL
Check for a new version of the Public Suffix List? [N ]
N
usage: new IO::File at ./Build.PL line 66.

The first thing I noticed is that there's no "use IO::File", but I just assumed that something else must be loading it indirectly. However, if you trace through the execution with the debugger, you will see:

DB<1> s
IO::Handle::new(/efs/dist/perl5/IO/1.25/.exec/x86-64.rhel.6/5.16/lib/perl5/IO/Handle.pm:311):
311: my $class = ref($[0]) || $[0] || "IO::Handle";
DB<1>
IO::Handle::new(/efs/dist/perl5/IO/1.25/.exec/x86-64.rhel.6/5.16/lib/perl5/IO/Handle.pm:312):
312: @_ == 1 or croak "usage: new $class";

At the point where IO::File->new() is called. A quick inspection of %INC, shows that only the following IO::* modules have been loaded at this point.

'IO.pm' => '/efs/dist/perl5/IO/1.25/.exec/x86-64.rhel.6/5.16/lib/perl5/IO.pm'
'IO/Handle.pm' => '/efs/dist/perl5/IO/1.25/.exec/x86-64.rhel.6/5.16/lib/perl5/IO/Handle.pm'
'IO/Socket.pm' => '/efs/dist/perl5/IO/1.25/.exec/x86-64.rhel.6/5.16/lib/perl5/IO/Socket.pm'
'IO/Socket/INET.pm' => '/efs/dist/perl5/IO/1.25/.exec/x86-64.rhel.6/5.16/lib/perl5/IO/Socket/INET.pm'
'IO/Socket/UNIX.pm' => '/efs/dist/perl5/IO/1.25/.exec/x86-64.rhel.6/5.16/lib/perl5/IO/Socket/UNIX.pm'

Note that I am using the latest version of IO (1.25), which turns out to be where this breaks.

However, this means that your code will start to break if anyone else upgrades (oh, the joys of living on the bleeding edge). If you use the IO modules that are included with perl5.16, then everything works (no, I don't have 5.18 and 5.20 built yet -- but unless they include the latest IO, they probably work, too).

With the perl5.16 core modules, this works, because somehow IO::File gets loaded indirectly. Clearly, something in the IO distro changed, and IO::File is no longer getting loaded when it used to, causing scripts like your Build.PL which were implicitly dependent on this behavior to break.

Would you accept a simple patch to future proof your releases against other people upgrading? It's really this trivial:

diff -rc ../Mozilla-PublicSuffix-v0.1.18-orig/Build.PL ./Build.PL
*** ../Mozilla-PublicSuffix-v0.1.18-orig/Build.PL Wed Mar 19 15:24:55 2014
--- ./Build.PL Sat Jun 21 19:02:18 2014


*** 9,14 ****
--- 9,15 ----
use Module::Build;
use Tie::File;
use URI;

  • use IO::File;

    my $builder = Module::Build->new(
    dist_name => "Mozilla-PublicSuffix",

01-psuffix fails

cpanm (App::cpanminus) 1.5017 on perl 5.014002 built for x86_64-linux
Work directory is /home/libdevel/.cpanm/work/1346264286.32406
You have make /usr/bin/make
You have LWP 6.04
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching Mozilla::PublicSuffix on cpanmetadb ...
--> Working on Mozilla::PublicSuffix
Fetching https://domain.tld/authors/id/R/RS/RSIMOES/Mozilla-PublicSuffix-v0.1.7.tar.gz
-> OK
Unpacking Mozilla-PublicSuffix-v0.1.7.tar.gz
Entering Mozilla-PublicSuffix-v0.1.7
Checking configure dependencies from META.yml
Checking if you have HTTP::Tiny 0 ... Yes (0.012)
Checking if you have Module::Build 0.3601 ... Yes (0.4003)
Configuring Mozilla-PublicSuffix-v0.1.7
Running Build.PL
Check for a new version of the Public Suffix List? [Y ]Y 
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Mozilla-PublicSuffix' version 'v0.1.7'
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Test::More 0 ... Yes (0.98)
Checking if you have Test::Exception 0 ... Yes (0.31)
Checking if you have File::Find 0 ... Yes (1.19)
Checking if you have File::Temp 0 ... Yes (0.22)
Checking if you have Module::Build 0.3601 ... Yes (0.4003)
Checking if you have Regexp::Common 0 ... Yes (2011121001)
Checking if you have URI::_idna 0 ... Yes (undef)
Building and testing Mozilla-PublicSuffix-v0.1.7
Building Mozilla-PublicSuffix
t/author-critic.t ............ skipped: these tests are for testing by the author
t/author-pod-spell.t ......... skipped: these tests are for testing by the author
t/author-test-eol.t .......... skipped: these tests are for testing by the author
t/release-cpan-changes.t ..... skipped: these tests are for release candidate testing

#   Failed test at t/01-psuffix.t line 57.
#          got: 'kyoto.jp'
#     expected: undef

#   Failed test at t/01-psuffix.t line 58.
#          got: 'kyoto.jp'
#     expected: 'c.kyoto.jp'

#   Failed test at t/01-psuffix.t line 59.
#          got: 'kyoto.jp'
#     expected: 'c.kyoto.jp'

#   Failed test at t/01-psuffix.t line 60.
#          got: 'kyoto.jp'
#     expected: 'c.kyoto.jp'

#   Failed test at t/01-psuffix.t line 61.
#          got: 'kyoto.jp'
#     expected: 'pref.kyoto.jp'

#   Failed test at t/01-psuffix.t line 62.
#          got: 'kyoto.jp'
#     expected: 'pref.kyoto.jp'

#   Failed test at t/01-psuffix.t line 63.
#          got: 'kyoto.jp'
#     expected: 'city.kyoto.jp'

#   Failed test at t/01-psuffix.t line 64.
#          got: 'kyoto.jp'
#     expected: 'city.kyoto.jp'
# Looks like you failed 8 tests of 62.
t/01-psuffix.t ............... 
Dubious, test returned 8 (wstat 2048, 0x800)
Failed 8/62 subtests 
t/release-dist-manifest.t .... skipped: these tests are for release candidate testing
t/release-distmeta.t ......... skipped: these tests are for release candidate testing
t/release-kwalitee.t ......... skipped: these tests are for release candidate testing
t/release-meta-json.t ........ skipped: these tests are for release candidate testing
t/00-compile.t ............... ok
t/release-minimum-version.t .. skipped: these tests are for release candidate testing
t/release-mojibake.t ......... skipped: these tests are for release candidate testing
t/release-no-tabs.t .......... skipped: these tests are for release candidate testing
t/release-pod-coverage.t ..... skipped: these tests are for release candidate testing
t/release-pod-linkcheck.t .... skipped: these tests are for release candidate testing
t/release-pod-syntax.t ....... skipped: these tests are for release candidate testing
t/release-portability.t ...... skipped: these tests are for release candidate testing
t/release-synopsis.t ......... skipped: these tests are for release candidate testing
t/release-test-version.t ..... skipped: these tests are for release candidate testing
t/release-unused-vars.t ...... skipped: these tests are for release candidate testing

Test Summary Report
-------------------
t/01-psuffix.t             (Wstat: 2048 Tests: 62 Failed: 8)
  Failed tests:  40-47
  Non-zero exit status: 8
Files=20, Tests=63,  0 wallclock secs ( 0.06 usr  0.04 sys +  0.36 cusr  0.11 csys =  0.57 CPU)
Result: FAIL
Failed 1/20 test programs. 8/63 subtests failed.
-> FAIL Installing Mozilla::PublicSuffix failed. See /home/libdevel/.cpanm/build.log for details.

v0.1.12 fails tests for 5.14 and 5.16

I just installed the latest release of Mozilla-PublicSuffix, and discovered that it fails the test suite for perl 5.14 and 5.16. I believe there's an issue with how you replace the

my %rules = qw();

line with the embedded metadata, and the presence of UTF-8 characters in that file. Because you assert:

use warnings 'FATAL' => 'all';

the tests for 5.14 and 5.16 both fail with this error:

Odd number of elements in hash assignment at lib/Mozilla/PublicSuffix.pm line 42.

If I patch the code to just use:

use warnings;

then you still get that error, but the tests at least pass. Looking at PublicSuffix.pm after the metadata has been embedded, it looks correct, but I suspect that one of the strings intended to be a key in the %rules hash has a character being interpreted as white space, and that is throwing the length of that list off by one.

I've patched the code to drop the use of qw(), and instead quote the key/value pairs in the auto-generated metadata. I'd attach it here, but github doesn't appear to allow me to add attachments to new issues, so I'll email it to you with the github issue number as soon as I post this.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.