Twitter iPhone pliant OnePlus 11 PS5 Disney+ Orange Livebox Windows 11

Erreur compilation/installation d'un module Perl

2 réponses
Avatar
ferrere
Bonjour,

je rencontre un petit problème lors de l'installation de module Perl
Apache::AuthCAS dans un environnement Ubuntu/Apache2.

Sur cette distribution, mod_perl.pm n'existe pas sous cette forme mais
sous la forme mod_perl2.pm, le module Const.pm se trouve dans
/usr/lib/perl5/Apache2/ et non pas dans /usr/lib/perl5/Apache/, etc.

Bref un problème de dépendances.

Voila de que donne le 'make test' :

> perl -MCPAN -e shell
> cpan> install Apache::AuthCAS

Running install for module Apache::AuthCAS
Running make for D/DC/DCASTRO/Apache-AuthCAS-0.4.tar.gz
CPAN: Digest::MD5 loaded ok
Checksum for
/home/xxxxx/.cpan/sources/authors/id/D/DC/DCASTRO/Apache-AuthCAS-0.4.tar.gz
ok
Scanning cache /home/xxxxx/.cpan/build for sizes
Apache-AuthCAS-0.4/
Apache-AuthCAS-0.4/Apache-AuthCAS.spec
Apache-AuthCAS-0.4/Changes
Apache-AuthCAS-0.4/LICENSE
Apache-AuthCAS-0.4/MANIFEST
Apache-AuthCAS-0.4/Makefile.PL
Apache-AuthCAS-0.4/README
Apache-AuthCAS-0.4/lib/
Apache-AuthCAS-0.4/lib/Apache/
Apache-AuthCAS-0.4/lib/Apache/AuthCAS.pm
Apache-AuthCAS-0.4/schema.sql
Apache-AuthCAS-0.4/schema_drop.sql
Apache-AuthCAS-0.4/t/
Apache-AuthCAS-0.4/t/00basic.t
Removing previously used /home/xxxxx/.cpan/build/Apache-AuthCAS-0.4

CPAN.pm: Going to build D/DC/DCASTRO/Apache-AuthCAS-0.4.tar.gz


Checking for required modules:

Net::SSLeay is installed... yes
DBI is installed... yes

Checking if your kit is complete...
Looks good
Writing Makefile for Apache::AuthCAS
cp lib/Apache/AuthCAS.pm blib/lib/Apache/AuthCAS.pm
Manifying blib/man3/Apache::AuthCAS.3pm
/usr/bin/make -- OK
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00basic....Can't locate mod_perl.pm in @INC (@INC contains:
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/lib
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/arch /etc/perl
/usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
/usr/local/lib/site_perl .) at
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm
line 13.
BEGIN failed--compilation aborted at
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm
line 13.
Compilation failed in require at t/00basic.t line 4.
BEGIN failed--compilation aborted at t/00basic.t line 4 (#1)
(F) You said to do (or require, or use) a file that couldn't be
found. Perl looks for the file in all the locations mentioned in @INC,
unless the file name included the full path to the file. Perhaps you
need to set the PERL5LIB or PERL5OPT environment variable to say where
the extra library is, or maybe the script needs to add the library name
to @INC. Or maybe you just misspelled the name of the file. See
perlfunc/require and lib.

Uncaught exception from user code:
Can't locate mod_perl.pm in @INC (@INC contains:
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/lib
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/arch /etc/perl
/usr/local/lib/perl/5.8.7 /usr/local/share/perl/5.8.7 /usr/lib/perl5
/usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8
/usr/local/lib/site_perl .) at
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm
line 13.
BEGIN failed--compilation aborted at
/home/xxxxx/.cpan/build/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm
line 13.
Compilation failed in require at t/00basic.t line 4.
BEGIN failed--compilation aborted at t/00basic.t line 4.
at t/00basic.t line 4
# Failed test 1 in t/00basic.t at line 3
# t/00basic.t line 3 is: END { ok($loaded) }
t/00basic....dubious
Test returned status 2 (wstat 512, 0x200)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/00basic.t 2 512 1 1 100.00% 1
Failed 1/1 test scripts, 0.00% okay. 1/1 subtests failed, 0.00% okay.
make: *** [test_dynamic] Erreur 2
/usr/bin/make test -- NOT OK
Running make install
make test had returned bad status, won't install without force




J'ai bien tenté de faire les manips à la main en rajoutant un lien
symbolique : mod_perl sur mod_perl2.pm et en modifiant le fichier AuthCAS.pm
Mais j'ai d'autres erreurs :
perl Makefile.pm
make
make test


PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00basic....Bareword "Apache::OK" not allowed while "strict subs" in
use at /home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 418.
Bareword "Apache::OK" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 436.
Bareword "Apache::FORBIDDEN" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 700.
Bareword "Apache::OK" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 695.
Bareword "Apache::OK" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 589.
Compilation failed in require at t/00basic.t line 4.
BEGIN failed--compilation aborted at t/00basic.t line 4 (#1)
(F) With "strict subs" in use, a bareword is only allowed as a
subroutine identifier, in curly brackets or to the left of the "=>"
symbol. Perhaps you need to predeclare a subroutine?

Uncaught exception from user code:
Bareword "Apache::OK" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 418.
Bareword "Apache::OK" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 436.
Bareword "Apache::FORBIDDEN" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 700.
Bareword "Apache::OK" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 695.
Bareword "Apache::OK" not allowed while "strict subs" in use at
/home/xxxxx/Apache-AuthCAS-0.4/blib/lib/Apache/AuthCAS.pm line 589.
Compilation failed in require at t/00basic.t line 4.
BEGIN failed--compilation aborted at t/00basic.t line 4.
at t/00basic.t line 4
# Failed test 1 in t/00basic.t at line 3
# t/00basic.t line 3 is: END { ok($loaded) }
t/00basic....dubious
Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/00basic.t 9 2304 1 1 100.00% 1
Failed 1/1 test scripts, 0.00% okay. 1/1 subtests failed, 0.00% okay.
make: *** [test_dynamic] Erreur 9

A mon sens, le problème vient de l'appel aux modules perls d'apache et à
la version d'apache (Apache 2) installé sur la machine.

Je vois deux possibilités :
1) Les éléments du fichier de compilation (Makefile) sont suffisant pour
modifier les nom dépendances (modules)
2) Le makefile n'est d'aucun secours et c'est le code qu'il faut
modifier pour le 'porter' vers la nouvelle version d'apache

Comme je ne connais pas grand chose à Perl, je ne suis pas en mesure
d'aller réellement modifier le code.


Cordialement,

Frédéric

2 réponses

Avatar
Paul Gaborit
À (at) Wed, 29 Mar 2006 17:49:26 +0200,
ferrere écrivait (wrote):
je rencontre un petit problème lors de l'installation de module Perl
Apache::AuthCAS dans un environnement Ubuntu/Apache2.

Sur cette distribution, mod_perl.pm n'existe pas sous cette forme mais
sous la forme mod_perl2.pm, le module Const.pm se trouve dans
/usr/lib/perl5/Apache2/ et non pas dans /usr/lib/perl5/Apache/, etc.
[...]

J'ai bien tenté de faire les manips à la main en rajoutant un lien
symbolique : mod_perl sur mod_perl2.pm et en modifiant le fichier


Ne faites pas ce lien. 'mod_perl2' n'est pas 'mod_perl' !!!

La documentation de Apache::AuthCAS donne peut-être une
solution. Petit extrait :

This module should work in both mod_perl 1 and 2. For Apache
2/mod_perl 2, the Apache::compat may need to be loaded in your
mod_perl startup script. This can be done by adding:

use Apache::compat;

into the script included by the PerlRequire directive in your Apache
configuration. For instance, if your Apache configuration includes
the line:

PerlRequire /usr/local/sbin/modperl_startup.pl

then the "use" line mentioned above should be added to this
file. Consult the mod_perl documentation for more information
regarding mod_perl startup scripts.

Mais l'auteur semble l'avoir oublié dans son script de test...

Donc deux essais à faire :

1- ajouter dans le script de test t/00basic.t la ligne suivante :

use Apache::compat;

avant le 'use Apache::AuthCAS'.

et vois si les tests passent (et dans ce cas installer le module).

2- installer de force ('force install Apache::AuthCAS' sous CPAN) et
testez ensuite si ça marche avec mod_perl2 en faisant ce qu'indique la
doc ci-dessus.

Si rien de tout cela ne marche... écrire gentiment à l'auteur pour
avoir quelques explications.

PS: je n'ai rien testé du tout...

--
Paul Gaborit - <http://perso.enstimac.fr/~gaborit/>
Perl en français - <http://perl.enstimac.fr/>

Avatar
ferrere


Donc deux essais à faire :

1- ajouter dans le script de test t/00basic.t la ligne suivante :

use Apache::compat;

avant le 'use Apache::AuthCAS'.

et vois si les tests passent (et dans ce cas installer le module).

2- installer de force ('force install Apache::AuthCAS' sous CPAN) et
testez ensuite si ça marche avec mod_perl2 en faisant ce qu'indique la
doc ci-dessus.

Si rien de tout cela ne marche... écrire gentiment à l'auteur pour
avoir quelques explications.

PS: je n'ai rien testé du tout...



Rien de tout cela marche, je m'en vais donc écrire à l'auteur.
En outre, c'est use Apache2::compat que j'ai du mettre car
Apache::compat n'existe pas.

make test
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e"
"test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00basic....Bareword "Apache2::ServerUtil::server_root" not allowed
while "strict subs" in use at /usr/lib/perl5/Apache2/compat.pm line 346.
BEGIN not safe after errors--compilation aborted at
/usr/lib/perl5/Apache2/compat.pm line 429.
Compilation failed in require at t/00basic.t line 4.
BEGIN failed--compilation aborted at t/00basic.t line 4.
# Failed test 1 in t/00basic.t at line 3
# t/00basic.t line 3 is: END { ok($loaded) }
t/00basic....dubious
Test returned status 9 (wstat 2304, 0x900)
DIED. FAILED test 1
Failed 1/1 tests, 0.00% okay
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/00basic.t 9 2304 1 1 100.00% 1
Failed 1/1 test scripts, 0.00% okay. 1/1 subtests failed, 0.00% okay.
make: *** [test_dynamic] Erreur 9


Encore merci pour votre aide


Cordialement,

--

Frédéric