PDLPorters / PDLPorters/SciPDL

Upgrade to cpanm

Open
#6 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Shell
Stars
3
Forks
0
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the build script and its install_local_tarballs function, then review the current curl, tar, Makefile.PL, make, and make test flow. Compare that flow with the proposed cpanm bootstrap and options. Done means the build uses cpanm for pinned local or archived modules without the existing manual installation glue.

Written by the indexing model from the issue text.

Assessment

Tech stack
perl, shell
Domain
build-system
Issue type
Refactor
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
64/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.