Mailing List Archive

[PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set
Debian and Ubuntu packaged versions of Apache2 don't define PREFIX,
so 'make test' output is filled with warnings like
APXS (/usr/bin/apxs2) query for PREFIX failed

The attached proposed patch to Apache-Test fixes this, hopefully in a
non-intrusive way. Hope this is the right place to send this? It's not
quite clear to me how the CPAN RT ticket queues relate to this list.
--
Niko Tyni ntyni@debian.org
Re: [PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set [ In reply to ]
On Tue, Jun 18, 2013 at 09:43:10PM +0300, Niko Tyni wrote:
> Debian and Ubuntu packaged versions of Apache2 don't define PREFIX,
> so 'make test' output is filled with warnings like
> APXS (/usr/bin/apxs2) query for PREFIX failed

OK - devil's advocate time. That's a packaging bug, so the test
*should* fail. Convince me otherwise?

Regards, Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set [ In reply to ]
On Mon, Jun 24, 2013 at 4:37 AM, Joe Orton <jorton@redhat.com> wrote:
> On Tue, Jun 18, 2013 at 09:43:10PM +0300, Niko Tyni wrote:
>> Debian and Ubuntu packaged versions of Apache2 don't define PREFIX,
>> so 'make test' output is filled with warnings like
>> APXS (/usr/bin/apxs2) query for PREFIX failed
>
> OK - devil's advocate time. That's a packaging bug, so the test
> *should* fail. Convince me otherwise?

So the .deb build packages would need to do this?

perl Makefile.PL PREFIX=/path/to/prefix

Or something like that?

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set [ In reply to ]
On Mon, Jun 24, 2013 at 12:37:56PM +0100, Joe Orton wrote:
> On Tue, Jun 18, 2013 at 09:43:10PM +0300, Niko Tyni wrote:
> > Debian and Ubuntu packaged versions of Apache2 don't define PREFIX,
> > so 'make test' output is filled with warnings like
> > APXS (/usr/bin/apxs2) query for PREFIX failed
>
> OK - devil's advocate time. That's a packaging bug, so the test
> *should* fail. Convince me otherwise?

Thanks for looking at this. Side note: the tests don't fail, they are
just filled with warnings. So the PREFIX information doesn't seem to be
all that necessary?

First, the apxs docs at
http://httpd.apache.org/docs/2.2/programs/apxs.html
actually include a list of allowed -q parameters; quoting:

The query parameters can be one or more of the following strings: CC,
CFLAGS, CFLAGS_SHLIB, INCLUDEDIR, LD_SHLIB, LDFLAGS_SHLIB, LIBEXECDIR,
LIBS_SHLIB, SBINDIR, SYSCONFDIR, TARGET.

This doesn't include PREFIX. So why does Apache-Test think it's allowed to
query that at all? :) Is the availability of PREFIX documented somewhere?

Second, I see this in the Apache-Test changelog:

=item 1.06 - November 10, 2003
[...]
use apxs PREFIX to resolve relative httpd.conf directives
ServerRoot is not present [Mike Cramer]

Why is PREFIX more appropriate than SYSCONFDIR for this purpose? Does
Apache actually look in PREFIX before SYSCONFDIR when resolving relative
file names? (I suppose I can check this if you think it really matters.)

Third, if we do consider the lack of PREFIX a bug in the Debian apache2
package, it's a long standing one. I can reproduce it on Debian lenny,
squeeze and wheezy, so it's been this way at least since 2009, probably
longer (I didn't test older releases.) I suspect that many more Ubuntu
releases have the same bug, but I only tried the latest one, 13.04.

I'd expect it to be in the interest of Apache-Test to work on as many
platforms as possible, even slightly buggy ones. The workaround I'm
proposing for the bug isn't very onerous. Is it really the job of
Apache-Test to guard the purity of Apache installations and loudly
complain on those it doesn't deem worthy?
--
Niko Tyni ntyni@debian.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set [ In reply to ]
On Mon, Jun 24, 2013 at 11:52:24PM +0300, Niko Tyni wrote:

> Second, I see this in the Apache-Test changelog:
>
> =item 1.06 - November 10, 2003
> [...]
> use apxs PREFIX to resolve relative httpd.conf directives
> ServerRoot is not present [Mike Cramer]
>
> Why is PREFIX more appropriate than SYSCONFDIR for this purpose? Does
> Apache actually look in PREFIX before SYSCONFDIR when resolving relative
> file names? (I suppose I can check this if you think it really matters.)

Ah, I was thinking about hunting for relative configuration file names,
but I guess it's more about the log directories and stuff like that?
I can see SYSCONFDIR isn't ideal either for those but I still
think it's better than nothing as a last resort.
--
Niko Tyni ntyni@debian.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set [ In reply to ]
On Mon, Jun 24, 2013 at 09:51:06AM -0700, Fred Moyer wrote:
> On Mon, Jun 24, 2013 at 4:37 AM, Joe Orton <jorton@redhat.com> wrote:
> > On Tue, Jun 18, 2013 at 09:43:10PM +0300, Niko Tyni wrote:
> >> Debian and Ubuntu packaged versions of Apache2 don't define PREFIX,
> >> so 'make test' output is filled with warnings like
> >> APXS (/usr/bin/apxs2) query for PREFIX failed
> >
> > OK - devil's advocate time. That's a packaging bug, so the test
> > *should* fail. Convince me otherwise?
>
> So the .deb build packages would need to do this?
>
> perl Makefile.PL PREFIX=/path/to/prefix

No, I think that's a different PREFIX altogether, the one
that mod_perl and/or Apache-Test will get installed to.

The problem here is that Apache-Test is trying to find a ServerRoot for
resolving relative file names and is using the Apache2 PREFIX for that.
I don't think that can currently be overridden at the Apache-Test
configuration stage.
--
Niko Tyni ntyni@debian.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set [ In reply to ]
On Tue, Jun 25, 2013 at 12:16:04AM +0300, Niko Tyni wrote:
> Ah, I was thinking about hunting for relative configuration file names,
> but I guess it's more about the log directories and stuff like that?
> I can see SYSCONFDIR isn't ideal either for those but I still
> think it's better than nothing as a last resort.

The ServerRoot directive in the default httpd.conf is set to ${prefix}
by the httpd buildsystem, there is a direct equivalence there, I think
it's certainly correct for apxs to query the PREFIX variable. Yes, lots
of stuff isn't documented, that's a good reason to improve the docs not
to drop stuff from packages ;)

How about a patch to avoid running apxs unless it proves necessary, if
the only problem is the stderr warnings in this case?

Regards, Joe

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: [PATCH] Apache-Test: Fall back to SYSCONFDIR if PREFIX is not set [ In reply to ]
On Wed, Jun 26, 2013 at 05:18:54PM +0100, Joe Orton wrote:

> The ServerRoot directive in the default httpd.conf is set to ${prefix}
> by the httpd buildsystem, there is a direct equivalence there, I think
> it's certainly correct for apxs to query the PREFIX variable. Yes, lots
> of stuff isn't documented, that's a good reason to improve the docs not
> to drop stuff from packages ;)

Right. Thanks for bearing with me, and sorry for not doing my
homework properly.

> How about a patch to avoid running apxs unless it proves necessary, if
> the only problem is the stderr warnings in this case?

I'm attaching three patches, hope something there seems useful to you.

The first two of them both implement your suggestion in different
(but mutually compatible) ways.

The third patch is one more try at putting a Debian/Ubuntu specific
workaround in: it now falls back the compiled in HTTPD_ROOT value,
which should be equivalent to PREFIX on non-buggy systems and which is
already parsed from 'httpd -V' output.

Thanks again,
--
Niko Tyni ntyni@debian.org