Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 296219 - www-apache/mod_perl uses ancient ways of detecting what USE flags were used on dev-lang/perl
Summary: www-apache/mod_perl uses ancient ways of detecting what USE flags were used o...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal
Assignee: Apache Team - Bugzilla Reports
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-08 17:30 UTC by Viktor S
Modified: 2010-01-12 14:28 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
changes for mod_perl ebuild (modperldiff,1.44 KB, text/plain)
2009-12-09 21:02 UTC, Viktor S
Details
mod_perl ebuild diff (modperldiff,1.62 KB, text/plain)
2009-12-09 22:47 UTC, Viktor S
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Viktor S 2009-12-08 17:30:46 UTC
mod_perl uses this ancient call:

pkg_setup() {
        has_apache_threads_in dev-lang/perl ithreads
}

... which makes the build fail at compile-time and not before compilation like all other sane packages does nowadays :)

Proposal:

DEPEND dev-lang/perl[ithreads]

instead and convert the ebuild to EAPI2. Thank you!

Reproducible: Always
Comment 1 Dug Stokes 2009-12-09 01:03:50 UTC
# eix -U ithreads
[I] dev-lang/perl
     Available versions:  5.8.8-r5 ~5.8.8-r6 5.8.8-r8 [M]~5.10.1 {berkdb build debug doc elibc_FreeBSD gdbm ithreads perlsuid}
     Installed versions:  5.8.8-r8(16:20:31 12/08/09)(berkdb gdbm -build -debug -doc -elibc_FreeBSD -ithreads -perlsuid)
     Homepage:            http://www.perl.org/
     Description:         Larry Wall's Practical Extraction and Report Language

[I] sys-devel/libperl
     Available versions:  (1)  5.8.8-r2!t [M]~5.10.1
        {berkdb debug gdbm ithreads}
     Installed versions:  5.8.8-r2(1)!t(17:16:07 12/08/09)(berkdb gdbm -debug -ithreads)
     Homepage:            http://www.gentoo.org/
     Description:         Larry Wall's Practical Extraction and Report Language

Found 2 matches.

# emerge -uDNav www-apache/mod_perl

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild     U ] www-apache/mod_perl-2.0.4-r1 [2.0.3-r2] 0 kB
[ebuild  N    ] dev-perl/Apache-Reload-0.10  0 kB

Total: 2 packages (1 upgrade, 1 new), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] yes

>>> Verifying ebuild manifests

>>> Starting parallel fetch

>>> Emerging (1 of 2) www-apache/mod_perl-2.0.4-r1
 * mod_perl-2.0.4.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                               [ ok ]
 * checking ebuild checksums ;-) ...                                                                                   [ ok ]
 * checking auxfile checksums ;-) ...                                                                                  [ ok ]
 * checking miscfile checksums ;-) ...                                                                                 [ ok ]

 * You need to enable USE flag 'ithreads' in dev-lang/perl to
 * build a thread-safe version of www-apache/mod_perl for use
 * with www-servers/apache
 *
 * ERROR: www-apache/mod_perl-2.0.4-r1 failed.
 * Call stack:
 *                  ebuild.sh, line   49:  Called pkg_setup
 *   mod_perl-2.0.4-r1.ebuild, line   32:  Called has_apache_threads_in 'dev-lang/perl' 'ithreads'
 *       depend.apache.eclass, line  296:  Called die
 * The specific snippet of code:
 *              die "Need missing USE flag '${myflag}' in ${myforeign}"
 *  The die message:
 *   Need missing USE flag 'ithreads' in dev-lang/perl
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/die.env'.
 *

>>> Failed to emerge www-apache/mod_perl-2.0.4-r1, Log file:

>>>  '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'

 * Messages for package www-apache/mod_perl-2.0.4-r1:

 * You need to enable USE flag 'ithreads' in dev-lang/perl to
 * build a thread-safe version of www-apache/mod_perl for use
 * with www-servers/apache
 *
 * ERROR: www-apache/mod_perl-2.0.4-r1 failed.
 * Call stack:
 *                  ebuild.sh, line   49:  Called pkg_setup
 *   mod_perl-2.0.4-r1.ebuild, line   32:  Called has_apache_threads_in 'dev-lang/perl' 'ithreads'
 *       depend.apache.eclass, line  296:  Called die
 * The specific snippet of code:
 *              die "Need missing USE flag '${myflag}' in ${myforeign}"
 *  The die message:
 *   Need missing USE flag 'ithreads' in dev-lang/perl
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/die.env'.
 *


 *              die "Need missing USE flag '${myflag}' in ${myforeign}"
 *  The die message:
 *   Need missing USE flag 'ithreads' in dev-lang/perl
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/die.env'.
 *

>>> Failed to emerge www-apache/mod_perl-2.0.4-r1, Log file:

>>>  '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'

 * Messages for package www-apache/mod_perl-2.0.4-r1:

 * You need to enable USE flag 'ithreads' in dev-lang/perl to
 * build a thread-safe version of www-apache/mod_perl for use
 * with www-servers/apache
 *
 * ERROR: www-apache/mod_perl-2.0.4-r1 failed.
 * Call stack:
 *                  ebuild.sh, line   49:  Called pkg_setup
 *   mod_perl-2.0.4-r1.ebuild, line   32:  Called has_apache_threads_in 'dev-lang/perl' 'ithreads'
 *       depend.apache.eclass, line  296:  Called die
 * The specific snippet of code:
 *              die "Need missing USE flag '${myflag}' in ${myforeign}"
 *  The die message:
 *   Need missing USE flag 'ithreads' in dev-lang/perl
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/die.env'.
 *

Comment 2 Dug Stokes 2009-12-09 01:26:04 UTC
By turning on the USE flag for 'ithreads';

# emerge -uDNav mod_perl

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R   ] sys-devel/libperl-5.8.8-r2  USE="berkdb gdbm ithreads* -debug" 0 kB
[ebuild   R   ] dev-lang/perl-5.8.8-r8  USE="berkdb gdbm ithreads* -build -debug -doc -perlsuid" 0 kB
[ebuild     U ] www-apache/mod_perl-2.0.4-r1 [2.0.3-r2] 0 kB
[ebuild  N    ] dev-perl/Apache-Reload-0.10  0 kB

Total: 4 packages (1 upgrade, 1 new, 2 reinstalls), Size of downloads: 0 kB

Would you like to merge these packages? [Yes/No] yes

...

>>> Emerging (3 of 4) www-apache/mod_perl-2.0.4-r1
 * mod_perl-2.0.4.tar.gz RMD160 SHA1 SHA256 size ;-) ...                                                               [ ok ]
 * checking ebuild checksums ;-) ...                                                                                   [ ok ]
 * checking auxfile checksums ;-) ...                                                                                  [ ok ]
 * checking miscfile checksums ;-) ...                                                                                 [ ok ]
>>> Unpacking source...
>>> Unpacking mod_perl-2.0.4.tar.gz to /var/tmp/portage/www-apache/mod_perl-2.0.4-r1/work
 * Applying mod_perl-2.0.1-sneak-tmpdir.patch ...                                                                       [ ok ]
 * Applying CVE-2009-0796.patch ...                                                                                     [ ok ]
>>> Source unpacked in /var/tmp/portage/www-apache/mod_perl-2.0.4-r1/work
>>> Compiling source in /var/tmp/portage/www-apache/mod_perl-2.0.4-r1/work/mod_perl-2.0.4 ...
Reading Makefile.PL args from @ARGV
   MP_TRACE = 1
   MP_DEBUG = 1
   MP_USE_DSO = 1
   MP_APXS = /usr/sbin/apxs2
no conflicting prior mod_perl version found - good.
Configuring Apache/2.2.14 mod_perl/2.0.4 Perl/v5.8.9
[  error] Using Perl 5.8.9 w/o ithreads and 'worker' mpm httpd.
[  error] Failed requirements:
[  error]   - Perl built with ithreads (build perl with -Dusethreads)

 *
 * ERROR: www-apache/mod_perl-2.0.4-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2768:  Called die
 * The specific snippet of code:
 *       perl Makefile.PL PREFIX="${D}"/usr MP_TRACE=1 MP_DEBUG=1 MP_USE_DSO=1 MP_APXS=${APXS} INSTALLDIRS=vendor < /dev/null || die;
 *  The die message:
 *   (no error message)
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/environment'.
 *

>>> Failed to emerge www-apache/mod_perl-2.0.4-r1, Log file:

>>>  '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'

 * Messages for package sys-devel/libperl-5.8.8-r2:

 *
 * PLEASE NOTE: You are compiling perl-5.8 with
 * interpreter-level threading enabled.
 * Threading is not supported by all applications
 * that compile against perl. You use threading at
 * your own discretion.
 *

 * Messages for package dev-lang/perl-5.8.8-r8:

 * PLEASE NOTE: You are compiling perl-5.8.8 with
 * interpreter-level threading enabled.
 * Threading is not supported by all applications
 * that compile against perl. You use threading at
 * your own discretion.

 * Messages for package www-apache/mod_perl-2.0.4-r1:

 *
 * ERROR: www-apache/mod_perl-2.0.4-r1 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2768:  Called die
 * The specific snippet of code:
 *       perl Makefile.PL PREFIX="${D}"/usr MP_TRACE=1 MP_DEBUG=1 MP_USE_DSO=1 MP_APXS=${APXS} INSTALLDIRS=vendor < /dev/null || die;
 *  The die message:
 *   (no error message)
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/www-apache/mod_perl-2.0.4-r1/temp/environment'.
 *
Comment 3 Viktor S 2009-12-09 21:02:58 UTC
Created attachment 212570 [details]
changes for mod_perl ebuild

Above is the diff for the ebuild. It now properly depends on perl which should make emerge alert the user properly if perl was not built with ithreads.


Re: your buildfailures Dug:
Something is very broken here and I'm not sure what, but it seems like the Makefile.PL is the culprit here. Alternatively your perl installation is broken. I'm in the process of setting up an x86 chroot on my machine so I'll test this whenever that is done. Meanwhile you could do a emerge -C dev-lang/perl && emerge --depclean && revdep-rebuild && emerge dev-lang/perl, that might solve your problems but it's not sure.
Comment 4 Dug Stokes 2009-12-09 21:50:38 UTC
(In reply to comment #3)
> Re: your buildfailures Dug:
> do a emerge -C dev-lang/perl && emerge --depclean && revdep-rebuild
> && emerge dev-lang/perl, that might solve your problems but it's not sure.

Thanks, that really did help a lot! In the end I've ended up removing mod_perl, but is great to see a patch for this, especially so quicky. Thanks all!
Comment 5 Viktor S 2009-12-09 22:47:52 UTC
Created attachment 212578 [details]
mod_perl ebuild diff

Thanks to the people in #gentoo-sunrise this ebuild actually compiles. :p This works 100% on a clean x86 chroot with perl built with ithreads.
Comment 6 Viktor S 2009-12-09 22:59:20 UTC
Configuring Apache/2.2.14 mod_perl/2.0.4 Perl/v5.8.9

Wait a minute Dug ... How does this happen? Have you manually installed Perl somewhere? Because this should read:

Configuring Apache/2.2.14 mod_perl/2.0.4 Perl/v5.8.8
Comment 7 Dug Stokes 2009-12-09 23:31:32 UTC
(In reply to comment #6)
> Configuring Apache/2.2.14 mod_perl/2.0.4 Perl/v5.8.9
> 
> Wait a minute Dug ... How does this happen? Have you manually installed Perl
> somewhere? Because this should read:
> 
> Configuring Apache/2.2.14 mod_perl/2.0.4 Perl/v5.8.8
> 

Are you sure? I only synced the day before yesterday, an "eix -l dev-lang/perl" says 5.8.8, and http://www.gentoo-portage.com/dev-lang/perl agrees.

Just did an sync again, and eix says:

# eix -l dev-lang/perl
[I] dev-lang/perl
     Available versions:
                        5.8.8-r5 "alpha amd64 arm hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc ~sparc-fbsd x86 ~x86-fbsd" [berkdb build debug doc elibc_FreeBSD gdbm ithreads perlsuid]
                ~       5.8.8-r6 "~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~sparc-fbsd ~x86 ~x86-fbsd" [berkdb build debug doc elibc_FreeBSD gdbm ithreads perlsuid]
                        5.8.8-r8 "~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ~ppc64 ~s390 ~sh sparc x86 ~sparc-fbsd ~x86-fbsd" [berkdb build debug doc elibc_FreeBSD gdbm ithreads perlsuid]
                [M]~    5.10.1 "~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~ppc ~s390 ~sh ~sparc ~x86" [berkdb build debug doc gdbm ithreads]
     Installed versions:  5.8.8-r8(01:47:38 12/09/09)(berkdb gdbm -build -debug -doc -elibc_FreeBSD -ithreads -perlsuid)
     Homepage:            http://www.perl.org/
     Description:         Larry Wall's Practical Extraction and Report Language


have I done something stupid?
Comment 8 Viktor S 2009-12-10 06:58:47 UTC
At least that's how it read on my x86 chroot where mod_perl installs just fine.

Calculating dependencies... done!
[ebuild   R   ] dev-lang/perl-5.8.8-r8  USE="gdbm ithreads -berkdb -build -debug -doc -perlsuid" 0 kB

Anyhow, if you want this solved, please open another bug. The most probable thing though at this point seems to be that your Perl-install is broken somehow. The mod_perl ebuild is now fixed so that installing it will require ithreads in dev-lang/perl before it even starts to emerge packages.
Comment 9 Benedikt Böhm (RETIRED) gentoo-dev 2009-12-10 08:28:21 UTC
(In reply to comment #0)
> DEPEND dev-lang/perl[ithreads]

this is wrong, it forces everyone who uses mod_perl to use ithreads, which is a major PITA. nobody wants to use ithreads. the ebuild is fine as-is.
Comment 10 Viktor S 2009-12-10 15:48:58 UTC
(In reply to comment #9)
> (In reply to comment #0)
> > DEPEND dev-lang/perl[ithreads]
> 
> this is wrong, it forces everyone who uses mod_perl to use ithreads, which is a
> major PITA. nobody wants to use ithreads. the ebuild is fine as-is.
> 

That is what the current ebuild does too, only that it fails at compile time instead of before even trying to emerge the packages. If mod_perl is going to force users to use ithreads in perl (and it seems like it is, no?), it might aswell do it explicitly and not let them build all the deps *before* informing the user of this?
Comment 11 Viktor S 2009-12-10 16:32:06 UTC
Further reading gives:

Vanilla apache (in gentoo) is built with threads. This is a good thing, mostly. It also forces users to either choose between a non-threaded MPM (generally bad, esp for mod_perl) or having to build perl with ithreads.

I really think we need a better way to solve this. EAPI2 doesn't seem to be able to depend on 2 packages built with specific USE flags, so maybe put something about this in einfo for apache at least?
Comment 12 Benedikt Böhm (RETIRED) gentoo-dev 2009-12-10 17:25:20 UTC
(In reply to comment #11)
> Vanilla apache (in gentoo) is built with threads.

no profile enables the thread USE flag globally, so you must have enabled it manually

> This is a good thing, mostly.

depends on your needs

> It also forces users to either choose between a non-threaded MPM (generally
> bad, esp for mod_perl) or having to build perl with ithreads.

i'm not really familar with the perl stuff, but i think the check is there for a reason. if you have a threaded MPM you need ithreads in perl, if you have a forked MPM you don't need it

> I really think we need a better way to solve this. EAPI2 doesn't seem to be
> able to depend on 2 packages built with specific USE flags, so maybe put
> something about this in einfo for apache at least?

the has_apache_threads_in function from depend.apache.eclass already tells you:

eerror "You need to enable USE flag '${myflag}' in ${myforeign} to"
eerror "build a thread-safe version of ${CATEGORY}/${PN} for use"
eerror "with www-servers/apache"
Comment 13 Viktor S 2009-12-10 18:21:51 UTC
After talking to people;

DEPEND="|| ( ( foo[baz] bar[zap] ) ( foo[-baz] bar[-zap] ) )"

Would work and solve all of our problems? In this way, if apache is built with threads, we can depend on perl with ithreads, and if apache is built w/o threads, we depend on "regular" perl? I can do the ebuild diff if this sounds reasonable to you? :)
Comment 14 Viktor S 2010-01-10 02:55:00 UTC
Come on Benedikt, failing at preparation (or at -pv even) surely is better than failing at compile time! Can't we use the last suggestion, that would save people time and make the ebuild EAPI2, which can't be a bad thing!
Comment 15 Benedikt Böhm (RETIRED) gentoo-dev 2010-01-11 07:54:06 UTC
You have to specify a comment on this change. Please explain your change.
Comment 16 Benedikt Böhm (RETIRED) gentoo-dev 2010-01-11 07:54:18 UTC
it's fixed, thanks.
Comment 17 Viktor S 2010-01-11 12:20:55 UTC
Thank you too! :-)
Comment 18 Martin von Gagern 2010-01-12 14:28:12 UTC
Broke things for me: bug #300730 prevents apache[-threads] with perl[ithreads].