PerlAlien / Alien-Build

Build external dependencies for use in CPAN
16 stars 25 forks source link

Test t/alien_build_plugin_pkgconfig_commandline.t fails on Windows 10, MSYS2 #210

Closed hakonhagland closed 3 years ago

hakonhagland commented 4 years ago

System info: Windows 10, MSYS2, perl version 5.32.0.

$ make test
PERL_DL_NONLAZY=1 "/usr/bin/perl.exe" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00_diag.t .......................................... 1/? #
#
#
# HARNESS_ACTIVE=1
# HARNESS_VERSION=3.42
# LANG=en_US.UTF-8
# PERL5LIB=/home/hakon/perl/cpan-source/debug/Alien-Build-2.26/blib/lib:/home/hakon/perl/cpan-source/debug/Alien-Build-2.26/blib/arch
# PERL_DL_NONLAZY=1
# PERL_USE_UNSAFE_INC=1
# SHELL=/usr/bin/bash
#
#
#
# PERL5LIB path
# /home/hakon/perl/cpan-source/debug/Alien-Build-2.26/blib/lib
# /home/hakon/perl/cpan-source/debug/Alien-Build-2.26/blib/arch
#
#
#
# perl                     5.032000
# Acme::Alien::DontPanic   -
# Alien::Base::ModuleBuild -
# Alien::Libbz2            -
# Alien::cmake3            -
# Alien::gzip              -
# Alien::xz                -
# Archive::Tar             2.36
# Archive::Zip             -
# Capture::Tiny            0.48
# Devel::Hide              -
# Env::ShellWords          -
# ExtUtils::CBuilder       0.280234
# ExtUtils::MakeMaker      7.44
# ExtUtils::ParseXS        3.40
# FFI::CheckLib            0.27
# FFI::Platypus            -
# File::Listing            6.04
# File::Listing::Ftpcopy   -
# File::Which              1.23
# File::chdir              0.1010
# HTML::Parser             3.72
# HTTP::Tiny               0.076
# IO::Compress::Bzip2      2.093
# IO::Socket::SSL          2.068
# IO::Uncompress::Bunzip2  2.093
# IO::Zlib                 1.10
# JSON::PP                 4.04
# LWP                      6.46
# LWP::Protocol::https     6.09
# List::Util               1.55
# Mojo::DOM58              -
# Mojolicious              -
# Net::FTP                 3.11
# Net::SSLeay              1.89_01
# Path::Tiny               0.114
# PkgConfig                0.23026
# PkgConfig::LibPkgConf    -
# Readonly                 -
# Sort::Versions           1.62
# Test2::API               1.302175
# Test2::V0                0.000130
# Text::ParseWords         3.30
# URI                      1.76
# YAML                     -
#
#
#
# $VAR1 = {
#           'compiler_type' => 'unix',
#           'pkg-config' => {
#                             'pkgconf' => undef,
#                             'pkg-config' => '/usr/bin/pkg-config'
#                           },
#           'system_type' => 'unix',
#           'cmake_generator' => 'Unix Makefiles'
#         };
# pkg-config negotiate pick = PkgConfig::CommandLine
#
#
# [config.site]
# # file automatically generated by /home/hakon/perl/cpan-source/debug/Alien-Build-2.26/blib/lib/Alien/Build/Plugin/Build/Autoconf.pm
# libdir='${prefix}/lib'
#
#
#
t/00_diag.t .......................................... ok
t/01_use.t ........................................... ok
t/alien_base.t ....................................... ok
t/alien_base__system_installed.t ..................... skipped: test requires Alien::Base::ModuleBuild
t/alien_base_pkgconfig.t ............................. ok
t/alien_base_wrapper.t ............................... ok
t/alien_build.t ...................................... ok
t/alien_build_commandsequence.t ...................... ok
t/alien_build_commandsequence__cd.t .................. ok
t/alien_build_interpolate.t .......................... ok
[...]
t/alien_build_plugin_fetch_wget.t .................... ok
t/alien_build_plugin_gather_isolatedynamic.t ......... ok
t/alien_build_plugin_meta.t .......................... ok
t/alien_build_plugin_pkgconfig_commandline.t ......... 5/?     # Failed test at t/alien_build_plugin_pkgconfig_commandline.t line 346.
    # +--------+---------------------+----+---------------------+----------+
    # | PATH   | GOT                 | OP | CHECK               | LNs      |
    # +--------+---------------------+----+---------------------+----------+
    # |        | HASH(0x8012f7cf0)   |    | <HASH>              | 338, 345 |
    # |        |                     |    |                     |          |
    # | {libs} | -L/test/lib -lfoo - | eq | -L/test/lib -lfoo\N | 340      |
    # |        | lbar -lbaz\N{U+20}  |    | {U+20}              |          |
    # +--------+---------------------+----+---------------------+----------+

# Failed test 'system available, okay'
# at t/alien_build_plugin_pkgconfig_commandline.t line 353.
t/alien_build_plugin_pkgconfig_commandline.t ......... 7/?         # Failed test at t/alien_build_plugin_pkgconfig_commandline.t line 428.
        # +---------------+---------------+----+---------------+----------+
        # | PATH          | GOT           | OP | CHECK         | LNs      |
        # +---------------+---------------+----+---------------+----------+
        # |               | HASH(0x800eb5 |    | <HASH>        | 402, 427 |
        # |               | a08)          |    |               |          |
        # |               |               |    |               |          |
        # | {libs}        | -L/test/lib - | eq | -L/test/lib - | 403      |
        # |               | lxor -lxor1\N |    | lxor\N{U+20}  |          |
        # |               | {U+20}        |    |               |          |
        # |               |               |    |               |          |
        # | {alt}         | HASH(0x8014c5 |    | <HASH>        | 425      |
        # |               | 1a0)          |    |               |          |
        # |               |               |    |               |          |
        # | {alt}{xor}    | HASH(0x8014bf |    | <HASH>        | 416      |
        # |               | 510)          |    |               |          |
        # |               |               |    |               |          |
        # | {alt}{xor}{li | -L/test/lib - | eq | -L/test/lib - | 410      |
        # | bs}           | lxor -lxor1\N |    | lxor\N{U+20}  |          |
        # |               | {U+20}        |    |               |          |
        # +---------------+---------------+----+---------------+----------+
    # Failed test 'all found in system'
    # at t/alien_build_plugin_pkgconfig_commandline.t line 430.

# Failed test 'system multiple'
# at t/alien_build_plugin_pkgconfig_commandline.t line 432.
t/alien_build_plugin_pkgconfig_commandline.t ......... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/9 subtests
t/alien_build_plugin_pkgconfig_libpkgconf.t .......... skipped: Test requires PkgConfig::LibPkgConf
t/alien_build_plugin_pkgconfig_makestatic.t .......... ok
[...]

Note: there are more failed tests, but they seem unrelated so I will post them in separate issues.

hakonhagland commented 4 years ago

This seems to be related to this issue. For example

> PKG_CONFIG_PATH=corpus/lib/pkgconfig pkg-config --libs foo
-L/test/lib -lfoo -lbar -lbaz

whereas it should give output -L/test/lib -lfoo

plicease commented 4 years ago

This seems to be a bug in msys version of pkg-config. I wonder if pkgconf is better behaved?

hakonhagland commented 4 years ago

Apparently pkgconf is not available on my system:

> pkgconf
bash: pkgconf: command not found
plicease commented 4 years ago

I think it can be installed with pacman

hakonhagland commented 4 years ago

This does not work:

$ pacman -S pkgconf
error: target not found: pkgconf
plicease commented 3 years ago

I'm closing this as I believe this to be a bug in pkg-config.

hakonhagland commented 3 years ago

I just found that they have recently switched from pkg-config to pkgconf, see this pull request. So I updated my MSYS2 installation, and now pkg-config works correctly!

Also after applying the patch in PR #246, all tests for Alien-Build on MSYS2 now passes here!