On Fri, Dec 07, 2012 at 11:15:21PM -0800, Brian Manning wrote:
> Hi,
>
> I am one of the maintainers for the Perl module ExtUtils::PkgConfig,
> which is available on CPAN.
>
> We have been getting failure reports from CPAN's automated testing
> system for ExtUtils::PkgConfig on OpenBSD[1].
>
> I did some digging last night, and I found out that the replacement
> /usr/bin/pkg-config does not honor the --max-version command line
> switch, which the tests in ExtUtils::PkgConfig exercise as part of the
> test suite for that module.
>
> I've included a patch to the version of pkg-config currently in
> OpenBSD's CVS tree (1.75)[2] that fixes the issue. I'm going to guess
> it was a copy/paste issue that introduced the bug.
>
> I've tested this patch on the installed version of /usr/bin/pkg-config
> on OpenBSD 5.2 and the currently released version of
> ExtUtils::PkgConfig from CPAN (1.13), and all of the tests for that
> Perl module now pass.
>
> To reproduce the bug:
> 1) Install OpenBSD 5.2 on a computer with an Internet connection
> 2) Run the CPAN module and 'look' at ExtUtils::PkgConfig
> 2a) # perl -MCPAN -e shell
> 2b) cpan[#]> look ExtUtils::PkgConfig
> 3) Create the Makefile and run make/make test
> 3a) # perl Makefile.PL
> 3b) # time make
> 3c) # time make test
> 4) Watch test #3 fail (because it is trying to call pkg-config
> --max-version, which currently does nothing)
>
> To fix the bug:
> 1) Apply this patch to /usr/bin/pkg-config:
> @@ -215,7 +215,7 @@
> exit $rc;
> }
>
> -if ($mode{minversion}) {
> +if ($mode{maxversion}) {
> my $v = $mode{maxversion};
> for my $pkg (@$top_config) {
> $rc = 1 unless versionmatch($configs{$pkg}, '<=', $v);
>
> To verify the bug fix:
> 1) Go back to the unpacked ExtUtils::PkgConfig directory, and run
> 'make test' again, all of the tests should pass
>
> Thanks,
>
> Brian
>
> [1]
> http://www.cpantesters.org/cpan/report/d2fbd25c-3bec-11e2-8669-e1a096fec937
> [2] http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/pkg-config/pkg-config
Thanks for your analysis and fix Brian; it's been committed.
--
Cheers,
Jasper
"Stay Hungry. Stay Foolish"