SA Bugzilla – Bug 7413
sa_compile.t fails to run as non-privileged user under make disttest
Last modified: 2022-04-26 03:05:57 UTC
t/sa_compile.t fails on make disttest when you run make disttest as a non-privileged user. Error output looks like: t/sa_compile.t .................... 'cd /home/kmcgrail/relbuild/Mail-SpamAssassin-3.4.2/t/log/d.sa_compile/build/x && make install 2>&1' failed: exit 2 at t/SATest.pm line 991. t/sa_compile.t .................... Dubious, test returned 2 (wstat 512, 0x200) Failed 5/5 subtests ... t/sa_compile.t (Wstat: 512 Tests: 0 Failed: 0) Non-zero exit status: 2 Parse errors: Bad plan. You planned 5 tests but ran 0. Files=166, Tests=3026, 409 wallclock secs ( 1.39 usr 0.28 sys + 148.09 cusr 20.40 csys = 170.16 CPU) Result: FAIL running just prove -v t/sa-compile.t worked. Also, running make disttest does not fail as root but the sa_compile.t test is skipped. Not sure why it's skipped... This is the first release that I have had re2c on the box doing the builds so I don't think this is new or a 3.4.2 blocker.
I have replicated this on MacOS 10.11.6 and by running 'make disttest TEST_VERBOSE=1 TEST_FILES=t/sa_compile.t ' got more details from the failure that imply it to be a universal issue: Manifying 8 pod documents Manifying 73 pod documents !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ERROR: Can't create '/opt/local/lib/perl5/site_perl/5.24' Do not have write permissions on '/opt/local/lib/perl5/site_perl/5.24' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! at -e line 1. make[2]: *** [pure_site_install] Error 13 'cd /Users/dad/spamassassin-342/Mail-SpamAssassin-3.4.2/t/log/d.sa_compile/build/x && make install 2>&1' failed: exit 2 at t/SATest.pm line 991. Dubious, test returned 2 (wstat 512, 0x200) Failed 5/5 subtests IOW: 'make disttest' is trying to install SA "for real" rather than in some test directory. Seems unwise...
Thanks, Bill. Do you see it as a blocker?
(In reply to Kevin A. McGrail from comment #2) > Thanks, Bill. Do you see it as a blocker? Absolutely not. I'm not even sure it's a bug, since I suspect that 'make disttest' makes no sense without explicitly setting PREFIX and DESTDIR.
(In reply to Bill Cole from comment #3) > (In reply to Kevin A. McGrail from comment #2) > > Thanks, Bill. Do you see it as a blocker? > > Absolutely not. I'm not even sure it's a bug, since I suspect that 'make > disttest' makes no sense without explicitly setting PREFIX and DESTDIR. Well, it does. Also, this may really be a blocker because 'make disttest' either fails or puts bogus compiled rules files under the unmodified PREFIX. I have also determined that this is NOT dependent on PREFIX, but rather on the permissions of PREFIX. It was masked on my systems by the fact that I was using a non-root account with write access to /usr/local but not /opt/local. The root cause is that sa-compile builds a Makefile.PL of its own from which it calles MakeMaker to build a Makefile that it then uses to build and install the compiled rules and associated files. With both 'make test' and 'make disttest' sa-compile handles relocation of the install points of body_0.bundle, body_0.pm, and bases_body_0.pl correctly, however 'make test' drops a man page (Mail::SpamAssassin::CompiledRegexps::body_0.3pm) and a perllocal.pod file in paths under a temp directory ($TMPDIR/<mktemp directory>/ignored/) and leaves them there while 'make disttest' tries to put them under the "real" PREFIX.
Created attachment 5569 [details] Add explicit paths to 'make' invocations in sa-compile so that make disttest passes. This patch works but should not be needed. I am not satisfied with it.
This appears to be fixed as a side-effect of the fix to bug #7294