Opened 11 years ago

Last modified 14 months ago

#42582 new defect

p5-libapreq2: fails to build for any perl version except the default one (Can't locate ModPerl/MM.pm)

Reported by: st.graef@… Owned by: macports-tickets@…
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc: ryan@…, ryandesign (Ryan Carsten Schmidt), cooljeanius (Eric Gallager), mojca (Mojca Miklavec), roberto@…, murrayE
Port: p5-libapreq2 mod_perl2 p5-html-mason p5-http-server-simple-mason

Description (last modified by neverpanic (Clemens Lang))

:info:build Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-libapreq2/p5.14-libapreq2/work/libapreq2-2.13" && /usr/bin/make -j4 -w all 
:info:build Exit code: 2
:error:build org.macports.build for port p5.14-libapreq2 returned: command execution failed
:debug:build Error code: CHILDSTATUS 17851 2
:debug:build Backtrace: command execution failed
    while executing
"system -nice 0 $fullcmdstring"
    ("eval" body line 1)
    invoked from within
"eval system $notty $nice \$fullcmdstring"
    invoked from within
"command_exec build"
    (procedure "portbuild::build_main" line 8)
    invoked from within
"$procedure $targetname"
:info:build Warning: targets not executed for p5.14-libapreq2: org.macports.activate org.macports.build org.macports.destroot org.macports.install
:notice:build Please see the log file for port p5.14-libapreq2 for details:
    /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-libapreq2/p5.14-libapreq2/main.log

Attachments (3)

mod_perl2-main.log (17.5 KB) - added by murrayeisenberg@… 11 years ago.
Failed forced build of mod_per2 with perl5.16
p5-mod_perl2.Portfile (1.7 KB) - added by mojca (Mojca Miklavec) 10 years ago.
A sample Portfile for p5-mod_perl2
main_murray_2021-02-02.log (70.3 KB) - added by murrayE 4 years ago.
main.log - added by murray 2021-02-02

Download all attachments as: .zip

Change History (41)

comment:1 Changed 11 years ago by neverpanic (Clemens Lang)

Description: modified (diff)
Priority: HighNormal

Please use WikiFormatting when posting in Trac and don't set priority to high, since that is reserved for MacPorts Developers as mentioned in the ticket guidelines prominently linked from the "new ticket" page.

You will have to attach /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_perl_p5-libapreq2/p5.14-libapreq2/main.log before anybody will be able to help you.

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryan@… ryandesign@… added
Port: mod_perl2 added

I also get this build failure; more specifically:

Can't locate ModPerl/MM.pm in @INC (@INC contains: /opt/local/lib/perl5/site_perl/5.14.2/darwin-thread-multi-2level /opt/local/lib/perl5/site_perl/5.14.2 /opt/local/lib/perl5/vendor_perl/5.14.2/darwin-thread-multi-2level /opt/local/lib/perl5/vendor_perl/5.14.2 /opt/local/lib/perl5/5.14.2/darwin-thread-multi-2level /opt/local/lib/perl5/5.14.2 /opt/local/lib/perl5/site_perl /opt/local/lib/perl5/vendor_perl .) at Makefile.PL line 2.

Indeed MM.pm is not in those locations; mod_perl2 installed it in the following location on my system:

/opt/local/lib/perl5/site_perl/5.12.4/darwin-thread-multi-2level/ModPerl/MM.pm

This is because mod_perl2 uses "perl", and my "perl" is from the perl5 port installed with the +perl5_12 variant, because that was the default at the time.

Ideally, the modules mod_perl2 provides should be split out into separate module subports for each supported version of perl, so that ports like p5-libapreq2 can depend on the correct perl version of the module.

comment:3 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

So, the problem is that mod_perl2 builds itself differently depending on what variant of the perl5 port is installed. It shouldn't do that.

The workaround for now is to reinstall perl5 with a variant matching your desired version of perl, for example:

sudo port install perl5 +perl5_14

Then rebuild mod_perl2:

sudo port -ns upgrade --force mod_perl2

Then you should be able to install that perl version of p5-libapreq2:

sudo port clean p5.14-libapreq2
sudo port install p5.14-libapreq2

comment:4 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: murrayeisenberg@… added

Has duplicate #42738.

comment:5 Changed 11 years ago by murrayeisenberg@…

I'm currently using perl5.18 (sudo port install perl5 +Perl5_18) and tried the suggested work-around

sudo port -ns upgrade --force mod_perl2

but the build for that fails, too. So does:

sudo port uninstall mod_perl2
sudo port install mod_perl2

Thus I'm still stymied with getting p5-libapreq2 installed.

comment:6 Changed 11 years ago by murrayeisenberg@…

In desperation, I uninstalled apr apr-util, apache2 +preforkmpm, php55-apache2handler, and mod_perl2; then re-installed them -- just in case the perl version was involved: I'm using perl5.18 as the default (it's what perl -version shows).

But I'm still unable to install p5-libapreq2 and unable to use the suggested workaround of forcing the upgrade of mod_perl2.

What do do next?

comment:7 Changed 11 years ago by murrayeisenberg@…

Note that file mod_perl2.pm and directory ModPerlis installed in

 /opt/local/lib/perl5/site_perl/5.12.4/darwin-thread-multi-2level 

rather than in the corresponding 5.18.2 directory -- even though the default perl version is 5.18 (according to perl -version). Could this explain why the suggested workaround

sudo port -ns upgrade --force mod_perl2

fails, and why my attempt to install p5-libapreq2 also fails?

If so, how get remedy tis?

Last edited 11 years ago by murrayeisenberg@… (previous) (diff)

comment:8 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

"sudo port -ns upgrade --force mod_perl2" should rebuild mod_perl2 for whatever perl you've made default. For me, mod_perl2 fails to build when perl5.18 is default. Also, you cannot install p5-libapreq2 for perl5.18 because no p5.18-libapreq2 subport exists yet.

comment:9 Changed 11 years ago by murrayeisenberg@…

Re: " you cannot install p5-libapreq2 for perl5.18 because no p5.18-libapreq2 subport exists yet."

So does that mean I should uninstall all the other perl modules I installed with 5.18 and re-install them with 5.16?

(All, or nearly all, of these modules are prerequisites for a non-MacPorts installation of WeBWorK that I'm trying to do.)

comment:10 in reply to:  8 Changed 11 years ago by murrayeisenberg@…

Replying to ryandesign@…:

"sudo port -ns upgrade --force mod_perl2" should rebuild mod_perl2 for whatever perl you've made default. For me, mod_perl2 fails to build when perl5.18 is default. Also, you cannot install p5-libapreq2 for perl5.18 because no p5.18-libapreq2 subport exists yet.

On 08/03/2014 01:03, Murray Eisenberg wrote: Apparently at present, libapreq2 will not work with perl 5.18. Is that correct?

(I'm using the MacPorts port of perl 5.18 under Mac OS X and install perl modules, including those for apache2 support, using MacPorts. And I'm told that the libapreq2 port available there has no perl 5.18-compatible sub-port because libapreq2 itself is not yet compatible with perl 5.18.)

If so, this is to request a perl 5.18-compatible version of libapreq2.

[What's involved in creating that? (I'm not a Perl programmer but just need libapreq2 -- actually, a MacPorts port of it -- for use with an Apache server application.)

I received the following response when on the apreq-dev-help@… list I requested a perl 5.18-compatible version of libapreq2, so that a MacPorts port could then be possible:

I didn't see any problems with perl-5.18 and libapreq2.

However, a trivial attempt to install mod_perl with Perl 5.18 (httpd-2.2.10) crashed. If you want to use the perl-glue for libapreq2 and mod_perl, that can be a problem. I have no idea if it's a compatibility issue, or due to my not having compiled mod_perl in several years now, and having borked something in my rusty toolchain.

Have you asked about this on the mod_perl users list at all?

I'm unsure what question to ask of the mod_perl users list or, more generally, how to resolve the issue.

comment:11 Changed 11 years ago by murrayeisenberg@…

I asked about this on mailing list apreq-dev@…. Got response from Steve Hay:

On 08/03/2014 01:03, Murray Eisenberg wrote:

(I'm using the MacPorts port of perl 5.18 under Mac OS X and install perl modules, including those for apache2 support, using MacPorts. And I'm told that the libapreq2 port available there has no perl 5.18- compatible sub-port because libapreq2 itself is not yet compatible with perl 5.18.)

No, that's not true.

I uploaded a binary Windows build of mod_perl-2.0.8 and libapreq2-2.13 components, built against perl-5.18.0, in October last year:

http://people.apache.org/~stevehay/

And I've just tried a build of the following right now:

httpd-2.2.27 perl-5.18.2 libwww-perl-6.05 mod_perl-2.0.8 libapreq2-2.13

and everything passes all tests except for libapreq2's glue\perl\t\apreq\cgi.t failing on line 197 with "Odd number of elements in hash assignment".

But I do note that MacPorts uses mod_perl2 @2.0.7_1, not 2.0.8.

comment:12 Changed 11 years ago by murrayeisenberg@…

After reverting perl5 to 5.16 ...

sudo port upgrade --enforce-variants perl5 -perl5_18 +perl5_16

... I tried to force reinstallation of mod_perl2 so that I could then (at long last) install p5-libapreq2:

sudo port -ns upgrade --force mod_perl2

But the build of mod_perl2 failed. See attached log.

Changed 11 years ago by murrayeisenberg@…

Attachment: mod_perl2-main.log added

Failed forced build of mod_per2 with perl5.16

comment:13 Changed 11 years ago by murrayeisenberg@…

Problem building p5-libapreq2 and mod_perl2 with perl5.16 solved with

sudo port upgrade --enforce-variants perl5 -perl5_18 +perl5_16
sudo port -ns upgrade --force mod_perl2

after I included the step I forget, namely, to clean mod_perl2.

(It would still be preferable to be able to use p5-libapreq2 with perl5.18.)

comment:14 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

The log you attached is incomplete. Always clean and try again before attaching a log.

I did not say libapreq2 was not compatible with perl5.18; I only said it had no p5.18 subport. This is because the last time the p5-libapreq2 port was touched was 16 months before the perl5.18 port existed in MacPorts. I do not know if libapreq2 would work with perl5.18. It cannot be tested because p5-libapreq2 depends on mod_perl2 and as was already discussed above mod_perl2 does not build with perl5.18. Also, p5-libapreq2 has dependencies on p5-extutils-xsbuilder, p5-parse-recdescent, and p5-tie-ixhash, which do not have p5.18 subports either. I expect this is again because nobody has tried, rather than because of an actual incompatibility. Remember that we have 1000 perl ports, 70% of which do not have a maintainer. I have added p5.18 subports to these perl modules now in r118327, r118328, r118329; they built fine, but I did not test whether they work correctly, because I don't know how.

comment:15 in reply to:  14 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Replying to ryandesign@…:

mod_perl2 does not build with perl5.18.

In r118330 I have updated mod_perl2 to version 2.0.8 which does build with perl5.18.

comment:16 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

In r118331 I added a p5.18 subport to p5-libapreq2.

comment:17 Changed 11 years ago by cooljeanius (Eric Gallager)

Cc: egall@… added

Cc Me!

comment:18 Changed 10 years ago by mojca (Mojca Miklavec)

Cc: mojca@… added

Cc Me!

comment:19 Changed 10 years ago by mojca (Mojca Miklavec)

We need to "rename" the ticket. This line in mod_perl2 is problematic in any case:

depends_lib         path:bin/perl:perl5 port:apache2

and mod_perl2 has a dependency on a particular version of perl. I got the following error for example (r123510):

Could not open /opt/local/lib/perl5/5.16.1/darwin-thread-multi-2level/CORE/libperl.dylib: Error opening or reading file (referenced from /opt/local/apache2/libexec/mod_perl.so)

We need at least variants, but probably a more clever solution is needed anyway.

comment:20 Changed 10 years ago by mojca (Mojca Miklavec)

Port: p5-libapreq2 added; p5.14-libapreq2 removed
Version: 2.2.1

comment:21 Changed 10 years ago by mojca (Mojca Miklavec)

Summary: Building p5.14-libapreq2 fails (upgrade)p5-libapreq2: fails to build for any perl version except the default one (Can't locate ModPerl/MM.pm)

There are some other tickets open. For example #28610 which is exactly the same issue. One of these tickets should be marked as duplicate.

Other tickets include #30935 and #42927, but I'm not 100% sure if these are also related.

comment:22 Changed 10 years ago by mf2k (Frank Schima)

Cc: roberto@… added
Port: p5-libapreq2, mod_perl2p5-libapreq2 mod_perl2

Let's keep the newer one. Cc reporter of duplicate #28610.

comment:23 Changed 10 years ago by murrayeisenberg@…

Currently I have active mod_perl2 @2.0.8_1 as well as p5.18-libapreq2 @2.130.0_3. But build of p5.18-libapreq2 @ 2.130.0_4 fails. How fix? Log follows.

[log deleted]
Last edited 10 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:24 Changed 10 years ago by murrayeisenberg@…

Cc: murrayeisenberg@… removed

Cc Me!

comment:25 Changed 10 years ago by mojca (Mojca Miklavec)

The only reasonable answer I can give is to instal p5.16-libapreq2 instead of p5.18-libapreq2. Or help us fix the ports.

I tried to create a port p5-mod_perl2. The port could easily split into "generic" part with

/opt/local/apache2/include/*

and Perl version-specific part including

/opt/local/bin/mp2bug-5.20
/opt/local/libexec/perl5.20/mp2bug
/opt/local/lib/perl5/vendor_perl/5.20/darwin-thread-multi-2level/*
/opt/local/share/perl5.20/man/man3/*

But there is one single dirty detail, namely the file mod_perl.so:

> otool -L /opt/local/apache2/modules/mod_perl.so
/opt/local/apache2/modules/mod_perl.so:
	/opt/local/lib/perl5/5.16.3/darwin-thread-multi-2level/CORE/libperl.dylib (compatibility version 5.16.0, current version 5.16.3)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
	/usr/lib/libutil.dylib (compatibility version 1.0.0, current version 1.0.0)

I have no clue what to do with that particular file. And I don't know how apache uses that file, to be honest.

I need to ask both Ryans for help.

Changed 10 years ago by mojca (Mojca Miklavec)

Attachment: p5-mod_perl2.Portfile added

A sample Portfile for p5-mod_perl2

comment:26 Changed 10 years ago by mojca (Mojca Miklavec)

Can you please take a look at my preliminary test for p5-mod_perl2? I attached a Portfile.

(murrayeisenberg: can you please remove the long log from your entry? I would ask you to upload it as a separate file, but it's "exactly the same log/problem" as initially reported, so it doesn't bring any new information. It just makes navigating this page in the browser less comfortable.)

comment:27 Changed 10 years ago by mojca (Mojca Miklavec)

And the next question. What exactly is the benefit of having support for multiple versions of p5-libapreq2? It installs

/opt/local/apache2/modules/mod_apreq2.a
/opt/local/apache2/modules/mod_apreq2.la
/opt/local/apache2/modules/mod_apreq2.so

(among other files) but I fail to see how we could even theoretically support multiple versions of Perl in this scenario. At least not for the part that deals with Apache. If it's usable as a standalone module (independent of mod_apreq2.so) outside of Apache, we could surely split it into multiple packages.

comment:28 Changed 10 years ago by ryandesign (Ryan Carsten Schmidt)

Has duplicate #44915.

comment:29 Changed 10 years ago by mojca (Mojca Miklavec)

Port: p5-html-mason p5-http-server-simple-mason added

(At least) two other ports are affected by this problem: p5-html-mason and p5-http-server-simple-mason.

comment:30 Changed 10 years ago by mojca (Mojca Miklavec)

See also #46450.

comment:31 in reply to:  26 Changed 10 years ago by dbevans (David B. Evans)

Replying to mojca@…:

Can you please take a look at my preliminary test for p5-mod_perl2? I attached a Portfile.

(murrayeisenberg: can you please remove the long log from your entry? I would ask you to upload it as a separate file, but it's "exactly the same log/problem" as initially reported, so it doesn't bring any new information. It just makes navigating this page in the browser less comfortable.)

I don't think this approach (multiple versions of mod_perl2 based on perl version) will work because, being a plugin for apache2, only one version can be used at a time and apache2 expects it to be in its module directory.

comment:32 Changed 10 years ago by dbevans (David B. Evans)

Currently mod_perl2 only supports perl5.16 and, to support any other, it has to be recompiled with the appropriate perl library. See ticket #46749, concerning adding variants to allow the users to decide which version of perl they might like to use.

No matter which perl version is used for mod_perl2, libapreq2 and its dependents must use the same version of perl to build since they want ModPerl/MM.pm which is only installed for the current mod_perl2 perl version. To my mind, this means that these dependent ports must incorporate a way to make sure that for any given perl version they have the corresponding version of mod_perl2 installed. PortGroup active_variants would be one way to do this (assuming mod_perl2 had distinct variants).

In the interim, I have removed all but the p5.16 branch of libapreq2 in r132515 to match the current state of mod_perl2. I believe all dependents of libapreq2 also only support p5.16 at this time (p5-html-mason and its dependents).

I suggest that this closes the immediate issue of this ticket although the additional issue of providing support for multiple versions of perl in mod_perl2 and its dependents remains.

comment:33 Changed 10 years ago by mojca (Mojca Miklavec)

I would suggest to fix the issue at least to the extent that will allow users to install mod_perl2 +perl5_20 and p5.20-libapreq2 even if Perl 5.16 is still considered to be the default version for general public.

comment:34 Changed 9 years ago by mojca (Mojca Miklavec)

I added the variants that allow installing p5.22-libapreq2 in r142038. At least that lets the brave users install the port against a more recent version of Perl. I added some active_variants constraints, but some more conflicts should be added for the moment.

Honestly I'm not even sure if we are able to fix the problem in a way that will allow installing multiple versions simultaneously.

Here are some failed tests though (I didn't investigate them further):

:info:test t/apreq/cookie2.t .... ok
:info:test # Failed test 1 in t/apreq/inherit.t at line 15
:info:test # Failed test 2 in t/apreq/inherit.t at line 16
:info:test # Failed test 3 in t/apreq/inherit.t at line 17
:info:test # Failed test 4 in t/apreq/inherit.t at line 19
:info:test t/apreq/inherit.t ....
:info:test Failed 4/4 subtests
:info:test t/apreq/request.t .... ok
:info:test t/apreq/upload.t ..... ok
:info:test
:info:test Test Summary Report
:info:test -------------------
:info:test t/apreq/inherit.t  (Wstat: 0 Tests: 4 Failed: 4)
:info:test   Failed tests:  1-4
:info:test Files=11, Tests=288, 22 wallclock secs ( 0.96 usr  0.10 sys +  7.07 cusr  1.18 csys =  9.31 CPU)
:info:test Result: FAIL
:info:test Failed 1/11 test programs. 4/288 subtests failed.

I did a few further modifications of mod_perl2 in r142037 and r142039 (necessary to make p5.22 work).

comment:35 Changed 4 years ago by murrayE

Using MacPorts 2.6.99 under macOS Big Sur 11.1 with Xcode CLT 12.4, I installed mod_perl2 @2.0.11_0+perl5_28. Now I am trying to install p5.28-libapreq2 and get a build error.

Not sure what the error is, so whole main.log is attached.

It's been 5 years since last comment to this ticket. What is the current status?

(Needless to say, p5-libapreq2 is crucial for using with apache2.)

Changed 4 years ago by murrayE

Attachment: main_murray_2021-02-02.log added

main.log - added by murray 2021-02-02

comment:36 Changed 4 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: murrayE added

Murray, the problem in your log is unrelated to this ticket. I see undefined symbols and I see the use of libtool, so you are probably experiencing the well-known macOS 11+ libtool-related bug, although I thought I had fixed it in #60794. Please file a new ticket.

comment:37 Changed 4 years ago by murrayE

Version 0, edited 4 years ago by murrayE (next)

comment:38 Changed 14 months ago by murrayE

After selfupdate and upgrading outdated, p5.34-libapreq2 @2.130.0_6 installed OK for arm6

Note: See TracTickets for help on using tickets.