Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

syntax checking of annotator.pl broke cassandane tests in Fedora #96

Open
landgraf opened this issue Oct 13, 2020 · 3 comments
Open

syntax checking of annotator.pl broke cassandane tests in Fedora #96

landgraf opened this issue Oct 13, 2020 · 3 comments

Comments

@landgraf
Copy link

In Fedora (as well as RHEL and I assume other distributions) cassandane tests are run against cyrus-imapd which was built but not installed.
Since commit ab91497 this no longer works and failed with error:
Base class package "Cyrus::Annotator::Daemon" is empty.
(Perhaps you need to 'use' the module which defines that package first,
or make that module available in @inc (@inc contains: /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-1.fc34.x86_64/usr/share/perl5/vendor_perl /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-1.fc34.x86_64/usr/lib64/perl5/vendor_perl /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-1.fc34.x86_64/usr/share/perl5/5.32 /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-1.fc34.x86_64/usr/lib64/perl5/5.32 /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5).
at ./utils/annotator.pl line 45.

@elliefm
Copy link
Contributor

elliefm commented Oct 16, 2020

utils/annotator.pl always fails a perl -c check like this if the Cyrus perl modules aren't installed. We used to simply not syntax check it at all, but now we use the Cyrus paths configured in cassandane.ini to locate the Cyrus installation so that we can.

I guess if cassandane.ini is configured to use a Cyrus source tree rather than an install tree, then the install-time perl hooks haven't run. The perl files in the source tree are not the same thing as what's actually installed.

The first line of make output in this case should be something like "warning: Cyrus perl paths not found on disk. Is Cyrus installed?" -- do you see that?

@landgraf
Copy link
Author

landgraf commented Oct 19, 2020

The first line of make output in this case should be something like "warning: Cyrus perl paths not found on disk. Is Cyrus installed?" -- do you see that?

Yes, I do.

+ pushd cassandane
+ make
warning: Cyrus perl paths not found on disk.  Is Cyrus installed?
make[1]: Entering directory '/builddir/build/BUILD/cyrus-imapd-3.2.4/cassandane-e417da617e38e80035c777dc4ac1e191e21ad269/utils'
gcc -g -O0 -Wall -Wextra -fPIC   -c -o lemming.o lemming.c
gcc -g -O0 -Wall -Wextra -fPIC    -o lemming lemming.o
gcc -g -O0 -Wall -Wextra -fPIC   -c -o gdbtramp.o gdbtramp.c
gcc -g -O0 -Wall -Wextra -fPIC    -o gdbtramp gdbtramp.o
gcc -g -O0 -Wall -Wextra -fPIC   -c -o crash.o crash.c
gcc -g -O0 -Wall -Wextra -fPIC    -o crash crash.o
gcc -g -O0 -Wall -Wextra -fPIC   -c -o syslog_probe.o syslog_probe.c
gcc -g -O0 -Wall -Wextra -fPIC    -o syslog_probe syslog_probe.o
gcc -g -O0 -Wall -Wextra -fPIC   -c -o syslog.o syslog.c
gcc -g -O0 -Wall -Wextra -fPIC    -shared -o syslog.so syslog.o -ldl
make[1]: Leaving directory '/builddir/build/BUILD/cyrus-imapd-3.2.4/cassandane-e417da617e38e80035c777dc4ac1e191e21ad269/utils'
./genmail3.pl syntax OK
./imap-append.pl syntax OK
./jenkins-xml-summary.pl syntax OK
./listmail.pl syntax OK
./pop3showafter.pl syntax OK
./split-by-thread.pl syntax OK
./sprinkle.pl syntax OK
./start-instance.pl syntax OK
./testrunner.pl syntax OK
Base class package "Cyrus::Annotator::Daemon" is empty.
    (Perhaps you need to 'use' the module which defines that package first,
    or make that module available in @INC (@INC contains: /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-2.fc34.x86_64/usr/share/perl5/vendor_perl /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-2.fc34.x86_64/usr/lib64/perl5/vendor_perl /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-2.fc34.x86_64/usr/share/perl5/5.32 /builddir/build/BUILDROOT/cyrus-imapd-3.2.4-2.fc34.x86_64/usr/lib64/perl5/5.32 /usr/local/lib64/perl5/5.32 /usr/local/share/perl5/5.32 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5).
 at ./utils/annotator.pl line 45.
BEGIN failed--compilation aborted at ./utils/annotator.pl line 45.
make: *** [Makefile:63: utils/annotator.pl_syntax] Error 255
error: Bad exit status from /var/tmp/rpm-tmp.6pLd7s (%build)

@elliefm
Copy link
Contributor

elliefm commented Oct 21, 2020

So, since the Cyrus directory here is a source tree rather than an install tree, and the utils/annotator.pl can never compile successfully because the perl modules it wants are not in an installed state, then I guess it must also be suppressing all the Annotator tests in cassandane.ini? Because it seems like they could never pass in this configuration.

I've had a think about how I might detect this case and skip syntax-checking the annotator.pl file after all, but given that this is a Makefile, it's gonna be messy and precarious at best...

Can you have the package patch Cassandane with something like this before it runs make?

diff --git a/Makefile b/Makefile
index 3802137..e7b7070 100644
--- a/Makefile
+++ b/Makefile
@@ -46,7 +46,7 @@ all clean install::
 
 all:: syntax
 
-SCRIPTS := $(shell find . -type f -name '*.pl' | sort)
+SCRIPTS := $(shell find . -type f -name '*.pl' | grep -v 'utils\/annotator.pl' | sort)
 
 MODULES := $(shell find . -type f -name '*.pm' | sort)
 

It won't fix anything (it can't), but it will restore the previous behaviour of skipping the syntax checks of utils/annotator.pl, since you already know it can't possibly succeed in this setup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants