Perl Successful Module Installation Fails Pipelines Build

Issue #15753 invalid
Matthew Goodnight
created an issue

I am able to successfully install a fairly common Perl module according to cpanm but this somehow signals Pipelines that this script command had failed. I am attaching a screenshot that shows a successful installation and subsequent build fail (redacted my company's private CPAN mirror and marked the output lines that indicate success). The docker image I'm using is perl:5.24.

Comments (3)

  1. Matt Ryall staff

    Thanks for the report, Matthew.

    This is really a problem with cpanm. Like any build tool, Pipelines uses the exit status of your commands to determine success/failure of the build, and we use set -e so any command exiting with a non-zero status immediately fails the build.

    If cpanm is returning a non-zero exit code even when successful, you should raise this with the maintainers and get it fixed.

    But in the meantime, to get it working with Pipelines, you can work around this with some shell magic. Wrap your command in an if statement, or put || true at the end:

    cpanm -n local::lib || true

    Note that this will continue to pass even when the command does fail. There's really no way around this. Ensuring cpanm returns the correct exit code is the only proper fix for this problem.

    I'm going to close this ticket as invalid, because it isn't a bug in Pipelines but in the cpanm tool.

  2. Log in to comment