Skip to content

Upgrade to cpanm #6

@karlglazebrook

Description

@karlglazebrook

The build script currently uses the classic cpan tool for installing CPAN modules, which has several well-known issues that have caused real pain during the v2.096+ work:

Problems with cpan

  1. Aggressive prereq resolutioncpan doesn't recognise modules installed outside its own catalogue (e.g. via make install), so it can decide to "satisfy" a requirement by re-installing the latest version of a module we've carefully built ourselves. This caused PDL to be silently upgraded from 2.096 to 2.104 during the v2.096 build because PDL::GSL::SF listed PDL as a build prereq.

  2. No support for local tarballscpan -i /path/to/file.tar.gz mangles the local path into a bogus CPAN URL (treating leading characters as the "author letter"), making it impossible to pin to a specific local file.

  3. Default mirror (cpan.org) drops old versionscpan -i ETJ/PDL-GSL-2.096.tar.gz 404s because cpan.org only keeps the latest version of each distro. The -M <mirror> flag is documented but broken in practice — does not reliably override the mirror.

  4. Test environment quirkscpan runs tests in ways that can deadlock on non-TTY environments (e.g. lib/perl5db.t from the Perl test suite when stdin/stdout are redirected).

Workaround currently in place

We worked around the issues by adding an install_local_tarballs shell function that does manual tar / perl Makefile.PL / make / make test / make install for the pinned PDL family modules, and curl-fetching them ourselves to a local directory. This works but adds ~20 lines of glue.

Proposed solution

Switch to cpanm (App::cpanminus). It handles all the above properly:

  • cpanm /path/to/local.tar.gz works as expected
  • --no-deps / --notest are first-class options
  • cpanm AUTHOR/Dist-X.YZ.tar.gz correctly fetches via the metacpan mirror that keeps old versions
  • Doesn't mess with already-installed modules

Bootstrap is one line:

curl -L https://cpanmin.us | perl - App::cpanminus

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions