Bug 7666

Summary: Non-standard build/test handling may cause build/test failures
Product: Spamassassin Reporter: eserte12
Component: Building & PackagingAssignee: SpamAssassin Developer Mailing List <dev>
Status: NEW ---    
Severity: normal CC: eserte12, kmcgrail
Priority: P2    
Version: 3.4.2   
Target Milestone: Undefined   
Hardware: All   
OS: All   
Attachments: Dockerfile

Description eserte12 2018-12-06 20:12:07 UTC
Created attachment 5635 [details]

The attached Dockerfile shows two problems with the current 3.4.2 release, a build and a test problem.

* the test problem: a possible setup of CPAN Testers smoke machines is to *test* a distribution without installing it. CPAN.pm normally makes sure that the dependencies are all available in PERL5LIB, so for a test script it looks like the dependencies are already installed. However, it seems that the SpamAssassin test scripts strip out these paths from PERL5LIB, and this leads to test failures like this: http://www.cpantesters.org/cpan/report/b4308f14-f984-11e8-b607-f782ef07057d
More test similar test failures may be seen on http://fast-matrix.cpantesters.org/?dist=Mail-SpamAssassin%203.4.2;os=linux;reports=1#sl=6,1 (actually all reports by SREZIC should have the same problem)

* the build problem: if the deactivated CMD line in the attached Dockerfile is used instead, then the build fails immediately because of missing prereqs. This is non-standard behavior. A normal CPAN distribution would warn on the missing prerequisites, but still write the Makefile and also the MYMETA.* files. CPAN.pm then would inspect either the Makefile or the MYMETA.* files, install the necessary dependencies, and go on with building and testing.
Comment 1 Kevin A. McGrail 2018-12-06 22:57:38 UTC
Any suggest fix?
Comment 2 eserte12 2018-12-16 12:04:19 UTC
(In reply to Kevin A. McGrail from comment #1)
> Any suggest fix?

For the build problem: I think the exit here:
is wrong. At least it's wrong when it comes to missing perl module dependencies --- exiting means that no Makefile would be created, and CPAN.pm cannot continue with automatic dependency installation.

However, the exit 0 might be still OK if required binaries are missing --- CPAN.pm cannot install these automatically. Currently there are none (all binary dependencies are optional), but maybe the code should be prepared to deal with this situation.

For the test problem: probably running spamassassin with -T (taint mode) is causing the existing PERL5LIB to be ineffective. I just learned about the TEST_PERL_TAINT environment variable, and indeed, when setting


in the Dockerfile before the CMD line, then the test suite runs much better (still there are some test failures, but much less).

Maybe SATest.pm could add a series on -I options (build from PERL5LIB) if tainting is enabled.