rsimoes / mozilla-publicsuffix Goto Github PK
View Code? Open in Web Editor NEWGet a domain name's public suffix via Mozilla's Public Suffix List
Home Page: https://metacpan.org/release/Mozilla-PublicSuffix
Get a domain name's public suffix via Mozilla's Public Suffix List
Home Page: https://metacpan.org/release/Mozilla-PublicSuffix
On https://metacpan.org/release/Mozilla-PublicSuffix/ looks like latest version is 1.0.6 however here there is no git tag for that version ๐ค
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
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",
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.
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.
For www.aport.co.uk it returns aport.co.uk but should return co.uk.
I do not test with other domains.
Best.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.