Bug 7666 - Non-standard build/test handling may cause build/test failures
Summary: Non-standard build/test handling may cause build/test failures
Status: NEW
Alias: None
Product: Spamassassin
Classification: Unclassified
Component: Building & Packaging (show other bugs)
Version: 3.4.2
Hardware: All All
: P2 normal
Target Milestone: Undefined
Assignee: SpamAssassin Developer Mailing List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-06 20:12 UTC by eserte12
Modified: 2018-12-16 12:04 UTC (History)
2 users (show)



Attachment Type Modified Status Actions Submitter/CLA Status
Dockerfile text/plain None eserte12@yahoo.de [NoCLA]

Note You need to log in before you can comment on or make changes to this bug.
Description eserte12 2018-12-06 20:12:07 UTC
Created attachment 5635 [details]
Dockerfile

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:
https://metacpan.org/source/KMCGRAIL/Mail-SpamAssassin-3.4.2/Makefile.PL#L328
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

    ENV TEST_PERL_TAINT=no

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.