If you build www/p5-libapreq2 on an empty system, the resulting perl modules are not linked against libapreq2.so. The second time you build this port, ie, when libapreq2.so is in /usr/local/bin, it properly builds the perl module. This is a problem when building packages using poudriere for example, as the resulting package for p5-libapreq2 does produce a perl library that works. Specifically: ... build on new system ... # ldd $WRKSRC/glue/perl/blib/arch/auto/APR/Request/Request.so glue/perl/blib/arch/auto/APR/Request/Request.so: libthr.so.3 => /lib/libthr.so.3 (0x80120c000) libc.so.7 => /lib/libc.so.7 (0x80081a000) # perl -MAPR::Request::Apache2 -e 'print $APR::Request::Apache2::VERSION,"\n"' Can't load '/usr/local/lib/perl5/site_perl/5.16/mach/auto/APR/Request/Request.so' for module APR::Request: /usr/local/lib/perl5/site_perl/5.16/mach/auto/APR/Request/Request.so: Undefined symbol "apreq_hook_disable_uploads" at /usr/local/lib/perl5/5.16/mach/DynaLoader.pm line 190. at /usr/local/lib/perl5/site_perl/5.16/mach/APR/Request/Apache2.pm line 26. Compilation failed in require at /usr/local/lib/perl5/site_perl/5.16/mach/APR/Request/Apache2.pm line 26. BEGIN failed--compilation aborted at /usr/local/lib/perl5/site_perl/5.16/mach/APR/Request/Apache2.pm line 26. Compilation failed in require. BEGIN failed--compilation aborted. ... build on system with a copy of libapreq2 (aka this port) already installed ... # ldd $WRKSRC/glue/perl/blib/arch/auto/APR/Request/Request.so glue/perl/blib/arch/auto/APR/Request/Request.so: libapreq2.so.11 => /usr/local/lib/libapreq2.so.11 (0x80120c000) libaprutil-1.so.0 => /usr/local/lib/libaprutil-1.so.0 (0x80141a000) libapr-1.so.0 => /usr/local/lib/libapr-1.so.0 (0x80163f000) libcrypt.so.5 => /lib/libcrypt.so.5 (0x801870000) libexpat.so.6 => /usr/local/lib/libexpat.so.6 (0x801a8f000) libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x801cb3000) libthr.so.3 => /lib/libthr.so.3 (0x801faf000) libc.so.7 => /lib/libc.so.7 (0x80081a000) # perl -MAPR::Request::Apache2 -e 'print $APR::Request::Apache2::VERSION,"\n"' 2.13 How-To-Repeat: cd /usr/ports/www/p5-libapreq2 make deinstall make clean make install perl -MAPR::Request::Apache2 -e 1 ... will give above error ... ldd /usr/local/lib/perl5/site_perl/5.16/mach/auto/APR/Request/Request.so ... will show no extra libs linked ... make clean make make reinstall perl -MAPR::Request::Apache2 -e 1 ... will work ... ldd /usr/local/lib/perl5/site_perl/5.16/mach/auto/APR/Request/Request.so ... will show all the extra libs linked ... Fix: I think it needs to specify LD_RUN_PATH when linking.
I spent the last hour diving through this, and I'm 100% sure this is due to a fail in the stage directory process. At install time, immediately after libapreq2.so is installed, it re-links the perl module against the /usr/local/bin copy of it. However, that file does not exist since it is safely tucked away into the stage directory.
I have some patches in preparation for www/libapreq2, they should cover this. TODO: finalize them, provide here for testing.
Created attachment 144078 [details] Patch to libapreq2 As promised, my prepared patch. But: I think it does not solve the issue you describe. And I think I can reproduce it. I build it with poudriere bulk -f ~/pkg-libapreq2 -j 10amd64 and used ldd to check the generated Request.so. Can you try to verify that the patch does not fix the issue ?
Created attachment 144793 [details] patch to www/libapreq2 New patches which seperate the build of libapreq2 and p5-libapreq2. Please test whether it still fails to link the proper libs.
Created attachment 144794 [details] patch to www/p5-libapreq2
Created attachment 144795 [details] svn diff for www/libapreq2 svn diff, complete this time...
Created attachment 144796 [details] svn diff for www/p5-libapreq2 complete svn diff this time
This appears committed now. I just tested it. By building libapreq2 first, it does indeed solve this chicken/egg problem and the resulting binary package does successfully run. The only issue I have with it is that it still lists p5-ExtUtils-XSBuilder as a run-time dependency, which I do not believe it should do. My personal preference is to keep the surface area of my software installations as small as possible to reduce any possible attack vectors. Thanks!
It seems to now add two more run-time dependencies, which are not necessary at all: gmake and autoconf, and does not explicitly list per5 as a dependeny anymore.
Created attachment 144881 [details] patch to reduce run-deps for Can you have a look at the patch attached and see if it reduces the run-deps ? A second patch for www/libapreq2 follows soon.
Created attachment 144882 [details] patch to maybe reduce deps See above.
Created attachment 144887 [details] revised p5-libapreq2 patch I posted a revised patch to p5-libapreq2 that adds perl as a runtime dependency, to bring it back in line to how it was before the restructuring.
A commit references this bug: Author: pi Date: Wed Jul 23 05:19:08 UTC 2014 New revision: 362622 URL: http://svnweb.freebsd.org/changeset/ports/362622 Log: www/p5-libapreq2: reduce/fix dependencies PR: 191161 Submitted by: vivek@khera.org Changes: head/www/p5-libapreq2/Makefile