Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-08-22 Thread Mark Hedges
Eric Covener wrote Tue, 07 Mar 2017 08:18:46 -0800:
>> It seems we should have the framework process the bin/envvars (in the normal
>> path,  or /etc/apache2 in this case)... but that should be based on
>> retrieving the
>> pathname of bin/envvars from apxs, and apxs doesn't have this info (it also
>> does
>> not have two distinct entitites for the progname and config file name,
>> requiring
>> that both be overridden if the progname is changed.)
>
>Having a bit of trouble sorting out these two, but they don't seem to
>affect the conf filename
>
>Apache-Test/lib/Apache/TestConfig.pm
>  httpd   => 'server to use for testing (default is $bindir/httpd)',
>  target  => 'name of server binary (default is apxs -q TARGET)',
>
>e.g. this works for me:
>
>perl Makefile.PL  -apxs ~/SRC/httpd-trunk/built/bin/apxs -httpd
>~/SRC/httpd-trunk/built/bin/apachectl

Hi all,

I had hired the original poster to look into this for me, to get
Apache2::Controller working and packaged in Debian.  I have time to
give it my attention now.  I'd like to help to fix it in the way you
think is best.  Perhaps this means providing a patch for the Debian
and Ubuntu libapache2-mod-perl2 maintainers to make it work.  I'd
really like to help make it work in source, if that is possible, since
it will reduce the number of places something needs to be changed.

I'm sorry I'm a bit rusty.  I have not had my head under the hood in a
while, but maybe with a little guidance I can help figure this out.

I realize the instructions above were for testing the Apache::Test source.

The -apxs and -httpd flags do not seem to work when I try them with
the Apache2::Controller source.  I recall there were environment
variables for setting the paths to apxs and httpd, but I do not
remember what they were called.  Would that help?

Please offer suggestions on what to do here.  I will also investigate
the source of the original poster's patch to Apache::Test in the
meantime.  If there is a way to tell it to do the right thing without
patching, that would be ideal.

Thank you.

Mark Hedges

-
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org



Re: Problems using Apache::Test on Debian (and Ubuntu)

2017-08-22 Thread Mark Hedges
Joachim Zobel wrote Wed, 21 Jun 2017 21:40:28 -0700:

> Hi.

> Just wanted to point out that as a workaround running as root worked for me 
> (on debian stretch using cpan2deb).

> Sincerely,

> Joachim

I appreciate the feedback Joachim.  I am working on this problem now,
trying to get Apache2::Controller to test in Debian.

Can you provide more details about your workaround?  I tried `cpan2deb
Apache2::Controller` as root on a pristine stretch installation, but
it did not run the Apache::Test suite:

===
...
Needs the following debian packages during building:
libmodule-build-perl (>= 0.42), libapache2-mod-perl2 (>= 1.12),
libwww-perl, libhttp-cookies-perl, libmath-bigint-gmp-perl,
libnet-openid-server-perl, libhttp-server-simple-perl, liburi-perl
Using maintainer: root 
Found docs: README.txt README.TODO
Using rules: /usr/share/dh-make-perl/rules.dh.tiny
Module::Build needs libmodule-build-perl
Module::Build needs perl
xdelta: warning: no matches found in from file, patch will apply without it
xdelta: warning: no matches found in from file, patch will apply without it
pristine-tar: committed
libapache2-controller-perl_1.1.1.orig.tar.gz.delta to branch
pristine-tar
make: Entering directory '/tmp/wtf/Apache2-Controller-v1.1.1'
dh clean
   dh_testdir
   dh_auto_clean
   dh_clean
make: Leaving directory '/tmp/wtf/Apache2-Controller-v1.1.1'
make: Entering directory '/tmp/wtf/Apache2-Controller-v1.1.1'
dh build
   dh_testdir
   dh_update_autotools_config
   dh_auto_configure
perl -I. Build.PL --installdirs vendor --config "optimize=-g -O2
-fdebug-prefix-map=/tmp/wtf/Apache2-Controller-v1.1.1=.
-fstack-protector-strong -Wformat -Werror=format-security -Wdate-time
-D_FORTIFY_SOURCE=2" --config "ld=x86_64-linux-gnu-gcc -g -O2
-fdebug-prefix-map=/tmp/wtf/Apache2-Controller-v1.1.1=.
-fstack-protector-strong -Wformat -Werror=format-security
-Wl,-z,relro"
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Apache2-Controller' version 'v1.1.1'
   dh_auto_build
perl Build
Building Apache2-Controller
   dh_auto_test
perl Build test --verbose 1
/usr/bin/perl -I /tmp/wtf/Apache2-Controller-v1.1.1/blib/lib -I
/tmp/wtf/Apache2-Controller-v1.1.1/blib/arch t/TEST -clean
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl
/tmp/wtf/Apache2-Controller-v1.1.1/t/TEST -clean
/usr/bin/perl -I /tmp/wtf/Apache2-Controller-v1.1.1/blib/lib -I
/tmp/wtf/Apache2-Controller-v1.1.1/blib/arch t/TEST -bugreport
-verbose=1
[warning] setting ulimit to allow core files
ulimit -c unlimited; /usr/bin/perl
/tmp/wtf/Apache2-Controller-v1.1.1/t/TEST -bugreport -verbose=1
apache2: Could not open configuration file /etc/apache2/httpd.conf: No
such file or directory
[  error] Apache cannot spawn child processes as root, therefore the
test suite must be run as a non-privileged user.
   create-stamp debian/debhelper-build-stamp
make: Leaving directory '/tmp/wtf/Apache2-Controller-v1.1.1'
make: Entering directory '/tmp/wtf/Apache2-Controller-v1.1.1'
dh binary
   create-stamp debian/debhelper-build-stamp
   dh_testroot
   dh_prep
   dh_auto_install
perl Build install --destdir
/tmp/wtf/Apache2-Controller-v1.1.1/debian/libapache2-controller-perl
--create_packlist 0
Building Apache2-Controller
Installing 
/tmp/wtf/Apache2-Controller-v1.1.1/debian/libapache2-controller-perl/usr/share/perl5/Apache2/Controller.pm
...
===

As you can see, we ran into the same errors here that the original
message thread poster noted:

apache2: Could not open configuration file /etc/apache2/httpd.conf: No
such file or directory
[  error] Apache cannot spawn child processes as root, therefore the
test suite must be run as a non-privileged user.

If you were able to get the Apache::Test suite to run in any library
that uses mod_perl2 and Apache::Test, can you please share the details
of what you did?

Incidentally, this seems like a broader problem in the vendor, both
Debian and Ubuntu.  If their system is building packages from source
packages as root, any packaged CPAN library that uses Apache::Test is
not actually being tested in the build stage, even though it looks
like it works because the process completes successfully.  It should
really bail there at the [error] stage and say "I can't do this."

Thanks.

Mark

-
To unsubscribe, e-mail: dev-unsubscr...@perl.apache.org
For additional commands, e-mail: dev-h...@perl.apache.org