Adding support for perl 5.14.0 to EFS

This blog entry will be a little long. I’m going to document the process for getting a new perl compiler added to the environment, which involves a bit of bootstrapping. In the process, I’ll be highlighting a few places where a new utility would help automate some of the hoops we have to jump through. While this is specific to perl, a very similar approach would have to be taken for adding a new version of gcc, or even python.

  • perl5/core/5.14

The first thing we have to do is build the new perl5/core release. Unfortunately, we still have to patch the perl core to add error checking for the use of sitecustomize.pl, so before you can even build the releases, you first have to generate a patched tarball, using the code in the efs-perl git repo. For 5.14, this turned out to be essentially the same patch as used for 5.12, although I got sidetracked by the fact that miniperl uses a “buildcustomize.pl” file, that is very similar to sitecustomize.pl. I mistakenly added the same error checking to the use of buildcustomize.pl, and discovered that the 5.14.0 build process, which autogenerates this file, generates one that doesn’t evaluate to a true value, and thus can NOT be error checked. See the efs-perl commit logs for more information, if you care. You probably don’t.

Once you have the patched tarball, then perl5/core/5.14.0-buildXXX can be built and deployed using the same efsdeploy scripts used for 5.12. Here’s how to do this, step by step:

# Create the release, cloning the src from a recent working build to get the efsdeploy configs
efs create release perl5 core 5.14.0-build001 --clonesrc 5.12.3-build001
# Edit efsdeploy.conf, update the depends->perl_runtime_register value from 5.12 to 5.14
# Copy the patched efs-perl-5.14.0.tar.gz into src, edit efsdeploy.conf to use it
efsdeploy source:up
efs create releasealias perl5 core 5.14 5.14.0
efs dist releasealias perl5 core 5.14

The next step is to get EFS-Perl working for the new release.

  • perl5/EFS-Perl/1.003

Now we have an interesting problem. The first thing we need in order to be able to build CPAN modules for 5.14 is a functionality set of EFS::Perl modules. This means we have to build a new release of the current perl5/EFS-Perl release, which is 1.003. However, perl5/EFS-Perl releases have several dependencies on perl5 MPRs that we can’t rebuild until we’ve built EFS-Perl. So, how do we pull this off? We cheat. First, we have to understand the nature of the dependencies. Here’s the depends section from the EFS-Perl efsdeploy.conf:

[depends]
    perl_runtime = \
        perl5/TermReadKey/2.30
 
    perl_test = \
        perl5/Module-Install/1.00 \
        perl5/Test-Perl-Critic/1.02 \
        perl5/Test-Pod-Coverage/1.08 \
        perl5/Test-Pod/1.44

TermReadKey is used by the perldebug script, which just a wrapper script for running the perl debugging with readline completion working. It is not needed by the code EFS::Perl modules themselves at runtime. Without the test dependencies, we simply can’t run the test suite.

If you wanted to rebuild those dependencies first, you’re looking at the tip of a very large iceberg, because those are just the direct dependencies. In order to build those five releases, you actually have to rebuild about 10 times that number of actual perl5 releases, and since we don’t yet have EFS-Perl implemented, you can’t use efsdeploy.

ISSUE: To make this easier in the future, we should seriously consider removing these test dependencies.

The workaround is to first build perl5/EFS-Perl/1.003-build003 (the current one is build002), without the dependencies. This means the tests will fail, but that’s OK. This is an interim step.