Tatsuhiko Miyagawa's Blog

Perl QA Hackathon 2015 Day 1

April 16, 2015

The hackathon is at betahaus in Berlin.

I started the day thinking it would be cool to see everyone’s activities in a dashboard.

It’s 2015 and there should be better software or website than Planet or Plagger to give a list of RSS feeds and then display a nice timeline. I ended up with Inoreader’s public RSS bundle to create a dashboard where you can see the list of commits on github in a variety of views. You can add your github username to the Wiki page.

cpanm, PerlPowerTools and plenv

There was an issue on cpanm where the program hangs forever when you use with plenv. I helped debugging the issue, and pointed out that the user might have installed PerlPowerTools, since I had the exact issue a couple of months ago. I opened an issue on PPT as well so that it won’t install its executables into a directory in PATH, at least not by default, since it’s too easy to break a system by typing cpanm PerlPowerTools.

CPAN::Common::Index

I started the work to convert cpanm to use xdg’s CPAN::Common::Index. There are three different logic used in cpanm to search for a module in indexes: CPAN mirror (remote URL or local .txt file with — mirror-index), CPAN Meta DB and MetaCPAN API. The former two (Mirror and Local) are already covered by CPAN::Common::Index, so I started implementing MetaCPAN backend which is for now a complete copy and paste from cpanm internal.

With that, there’s an ongoing branch to convert all the index search to using CPAN::Common::Index. More than 220 lines of code will get deleted!

Travis CI run for the branch is green (except occasional failure with 5.12 timeout, which has always been an issue), but it’s interesting to note a potential issue with 5.8 when it gets merged regarding “fatpacking”.

Fatpacking cpanm

When releasing cpanm I always fatback the executable (you can see it by running perldoc -m cpanm) so that you’ll be able to bootstrap with perl without any third party modules installed. It has a good side effect of being able to run without errors even when one of cpanm’s dependencies get a broken release on CPAN.

Now, CPAN::Common::Index uses a fair amount of modules in its dependencies, including modules like IO::Uncompress::Gunzip, Scalar::Util or mro/MRO::Compat conditionally. And that aren’t very fatback friendly because some of them are arch specific, and are conditional.

I found an issue with FatPacker specifically for the mro.pm/MRO::Compat in 5.8. MRO::Compat provides a shim entry in %INC for mro.pm, and that has confused FatPacker when it tries to gather the list of packlists containing mro.pm. It just randomly fails when the trace command emits mro.pm before MRO/Compat.pm. Because %INC is a hash its output is always random.

I reported it on IRC and mst suggested a fix to ignore non-matching %INC entry from the trace output, which would work for me, and hopefully should get merged.

Aside from this issue, there has always been a request to ship cpanm as more “regular” module, so that users can upgrade its dependencies outside cpanm. That’s always a good idea on paper, but like said above, it’s important to being able to run cpanm even when its dependencies got broken, since otherwise you can’t safely downgrade it! It’s a tricky problem, but I’d love to see a good middle ground, like shipping them both, and solve the fatpack issue for 5.8 altogether.

PAUSE

At the sponsored dinner I sat next to ANDK and got a great conversation on PAUSE and CPAN. I’ve always been annoyed by the fact that the PAUSE indexer is “too kind” to broken uploads. I suggested to him that PAUSE should stop guessing packages with uploads without a proper META file in it. He is in favor of the idea and is open to a pull request, when someone would want to tackle.

PAUSE is always difficult to test because its reliance of external software, and some ideas to improve that would be providing a Vagrant file to replicate the current virtual machine (Red Hat 6 and perl 5.16.3), and then migrating the web architecture to use PSGI rather than mod_perl. The latter seems like a big task, and I heard charsbar is up for it.

After the dinner I went to c-base. The space is so cool, but my eyes could not let me stay there for more than an hour because of a bit too much smoke in there.