PerlAlien / Alien-Libxml2

Install the C libxml2 library on your system
4 stars 3 forks source link

Test fail with combination of xml2-config and pkg-config #23

Closed plicease closed 4 years ago

plicease commented 4 years ago

Received a test fail report in closed issue here for macOS 10.15.7 https://github.com/PerlAlien/Alien-Libxml2/issues/11#issuecomment-713658647

My mac is currently 10.15.6, and it is working for me. The cflags I get are different from what is reported.

❌ helix% xml2-config --cflags
-I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include
plicease commented 4 years ago

@MichaelGrundie the test diagnostic should include the header directory used by Alien::Libxml2. In addition to providing the full test output, if you can investigate if the libxml/parser.h file is readable relative to that path.

MichaelGrundie commented 4 years ago
Running make test for PLICEASE/Alien-Libxml2-0.16.tar.gz
"/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" -MAlien::Build::MM=cmd -e test
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
PERL_DL_NONLAZY=1 "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" "-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_GB.UTF-8
# LC_TERMINAL=iTerm2
# LC_TERMINAL_VERSION=3.3.12
# PERL5LIB=/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/blib/lib:/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/blib/arch:
# PERL5OPT=
# PERL5_CPANPLUS_IS_RUNNING=86928
# PERL5_CPAN_IS_RUNNING=86928
# PERLBREW_HOME=/Users/michaelgrundie/.perlbrew
# PERLBREW_MANPATH=/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/man
# PERLBREW_PATH=/Users/michaelgrundie/perl5/perlbrew/bin:/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin
# PERLBREW_PERL=perl-5.16.0
# PERLBREW_ROOT=/Users/michaelgrundie/perl5/perlbrew
# PERLBREW_SHELLRC_VERSION=0.88
# PERLBREW_VERSION=0.88
# PERL_DL_NONLAZY=1
# PERL_MM_USE_DEFAULT=1
# PERL_USE_UNSAFE_INC=1
# SHELL=/bin/zsh
#
#
#
# PERL5LIB path
# /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/blib/lib
# /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/blib/arch
#
#
#
# perl                                     5.016000
# Alien::Base                              2.33
# Alien::Build                             2.33
# Alien::Build::MM                         2.33
# Alien::Build::Plugin::Build::SearchDep   2.33
# Alien::Build::Plugin::Prefer::BadVersion 2.33
# Alien::Build::Plugin::Probe::Vcpkg       2.33
# ExtUtils::CBuilder                       0.280206
# ExtUtils::MakeMaker                      7.48
# Test2::V0                                0.000136
# Test::Alien                              2.33
#
#
#
# version        = 2.9.4
# cflags         =
# cflags_static  =
# libs           = -lxml2
# libs_static    = -lxml2 -lz -lpthread -licucore -lm
#
#
#
t/00_diag.t ........ ok
t/alien_libxml2.t .. 1/?
# Failed test 'xs'
# at t/alien_libxml2.t line 26.
#   ExtUtils::CBuilder->compile failed
#     error building /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/_alien/tmp/kP0Cen_2lx/test.o from '/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/_alien/tmp/kP0Cen_2lx/test.c' at /Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/ExtUtils/CBuilder/Base.pm line 177.
#     cc -I/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/darwin-2level/CORE -c -fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -DPERL_USE_SAFE_PUTENV -O3 -o /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/_alien/tmp/kP0Cen_2lx/test.o /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/_alien/tmp/kP0Cen_2lx/test.c
#     /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9/_alien/tmp/kP0Cen_2lx/test.xs:5:10: fatal error: 'libxml/parser.h' file not found
#     #include <libxml/parser.h>
#              ^~~~~~~~~~~~~~~~~
#     1 error generated.
t/alien_libxml2.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests

Test Summary Report
-------------------
t/alien_libxml2.t (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=2, Tests=4,  0 wallclock secs ( 0.02 usr  0.00 sys +  0.42 cusr  0.12 csys =  0.56 CPU)
Result: FAIL
Failed 1/2 test programs. 1/4 subtests failed.
make: *** [test_dynamic] Error 1
  PLICEASE/Alien-Libxml2-0.16.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports PLICEASE/Alien-Libxml2-0.16.tar.gz
MichaelGrundie commented 4 years ago

/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-9 does not contain an include directory

plicease commented 4 years ago

Looks like the probe incorrectly used the broken .pc file from Apple. It should try xml2-config first. Can you provide the output of perl Makefile.PL. Make sure that the xml2-config commands are returning a success value.

MichaelGrundie commented 4 years ago
.cpan/build/Alien-Libxml2-0.16-1
▶ perl Makefile.PL
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::CommandSequence> + xml2-config --version
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + xml2-config --cflags
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + xml2-config --libs
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Generating a Unix-style Makefile
Writing Makefile for Alien::Libxml2
Writing MYMETA.yml and MYMETA.json
plicease commented 4 years ago

what is in _alien/state.json

MichaelGrundie commented 4 years ago
{
   "args" : [
      "root",
      "_alien",
      "meta_prop",
      {}
   ],
   "install" : {
      "complete" : {
         "gather_system" : 1
      },
      "finished" : 1,
      "mm" : {
         "distname" : "Alien-Libxml2"
      },
      "my_cflags" : "-I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2",
      "my_libs" : "-L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm",
      "my_version" : "2.9.10",
      "patch" : null,
      "plugin_probe_cbuilder_gather" : {},
      "prefix" : "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/share/dist/Alien-Libxml2",
      "root" : "/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/_alien",
      "stage" : "/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/blib/lib/auto/share/dist/Alien-Libxml2"
   },
   "runtime" : {
      "alien_build_version" : "2.33",
      "cflags" : " ",
      "cflags_static" : " ",
      "install_type" : "system",
      "legacy" : {
         "finished_installing" : 1,
         "install_type" : "system",
         "original_prefix" : "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/share/dist/Alien-Libxml2",
         "version" : "2.9.4"
      },
      "libs" : "-lxml2 ",
      "libs_static" : "-lxml2 -lz -lpthread -licucore -lm ",
      "perl_module_version" : "0.16",
      "prefix" : "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/share/dist/Alien-Libxml2",
      "version" : "2.9.4"
   }
}
MichaelGrundie commented 4 years ago

parser.h is contained in libxml2/libxml

▶ ls -l /usr/local/Cellar/libxml2/2.9.10_1/include/libxml2/libxml
total 1032
-rw-r--r--  1 michaelgrundie  staff   3157 30 Oct  2019 DOCBparser.h
-rw-r--r--  1 michaelgrundie  staff   9410 30 Oct  2019 HTMLparser.h
-rw-r--r--  1 michaelgrundie  staff   3646 30 Oct  2019 HTMLtree.h
-rw-r--r--  1 michaelgrundie  staff   4341 30 Oct  2019 SAX.h
-rw-r--r--  1 michaelgrundie  staff   4949 30 Oct  2019 SAX2.h
-rw-r--r--  1 michaelgrundie  staff   3115 30 Oct  2019 c14n.h
-rw-r--r--  1 michaelgrundie  staff   4906 30 Oct  2019 catalog.h
-rw-r--r--  1 michaelgrundie  staff   5159 30 Oct  2019 chvalid.h
-rw-r--r--  1 michaelgrundie  staff   5152 30 Oct  2019 debugXML.h
-rw-r--r--  1 michaelgrundie  staff   1814 30 Oct  2019 dict.h
-rw-r--r--  1 michaelgrundie  staff   8507 30 Oct  2019 encoding.h
-rw-r--r--  1 michaelgrundie  staff   4712 30 Oct  2019 entities.h
-rw-r--r--  1 michaelgrundie  staff  14670 30 Oct  2019 globals.h
-rw-r--r--  1 michaelgrundie  staff   6601 30 Oct  2019 hash.h
-rw-r--r--  1 michaelgrundie  staff   3348 30 Oct  2019 list.h
-rw-r--r--  1 michaelgrundie  staff   3758 30 Oct  2019 nanoftp.h
-rw-r--r--  1 michaelgrundie  staff   2005 30 Oct  2019 nanohttp.h
-rw-r--r--  1 michaelgrundie  staff  39718 30 Oct  2019 parser.h
-rw-r--r--  1 michaelgrundie  staff  17419 30 Oct  2019 parserInternals.h
-rw-r--r--  1 michaelgrundie  staff   2586 30 Oct  2019 pattern.h
-rw-r--r--  1 michaelgrundie  staff   5996 30 Oct  2019 relaxng.h
-rw-r--r--  1 michaelgrundie  staff  26224 30 Oct  2019 schemasInternals.h
-rw-r--r--  1 michaelgrundie  staff   4371 30 Oct  2019 schematron.h
-rw-r--r--  1 michaelgrundie  staff   1958 30 Oct  2019 threads.h
-rw-r--r--  1 michaelgrundie  staff  38108 30 Oct  2019 tree.h
-rw-r--r--  1 michaelgrundie  staff   2664 30 Oct  2019 uri.h
-rw-r--r--  1 michaelgrundie  staff  13622 30 Oct  2019 valid.h
-rw-r--r--  1 michaelgrundie  staff   2967 30 Oct  2019 xinclude.h
-rw-r--r--  1 michaelgrundie  staff   5042 30 Oct  2019 xlink.h
-rw-r--r--  1 michaelgrundie  staff  10605 30 Oct  2019 xmlIO.h
-rw-r--r--  1 michaelgrundie  staff   3956 30 Oct  2019 xmlautomata.h
-rw-r--r--  1 michaelgrundie  staff  36809 30 Oct  2019 xmlerror.h
-rw-r--r--  1 michaelgrundie  staff   3759 30 Oct  2019 xmlexports.h
-rw-r--r--  1 michaelgrundie  staff   5945 30 Oct  2019 xmlmemory.h
-rw-r--r--  1 michaelgrundie  staff   1170 30 Oct  2019 xmlmodule.h
-rw-r--r--  1 michaelgrundie  staff  12607 30 Oct  2019 xmlreader.h
-rw-r--r--  1 michaelgrundie  staff   5458 30 Oct  2019 xmlregexp.h
-rw-r--r--  1 michaelgrundie  staff   2337 30 Oct  2019 xmlsave.h
-rw-r--r--  1 michaelgrundie  staff   7069 30 Oct  2019 xmlschemas.h
-rw-r--r--  1 michaelgrundie  staff   4841 30 Oct  2019 xmlschemastypes.h
-rw-r--r--  1 michaelgrundie  staff   5511 30 Oct  2019 xmlstring.h
-rw-r--r--  1 michaelgrundie  staff   9993 30 Oct  2019 xmlunicode.h
-rw-r--r--  1 michaelgrundie  staff   8035 30 Oct  2019 xmlversion.h
-rw-r--r--  1 michaelgrundie  staff  21265 30 Oct  2019 xmlwriter.h
-rw-r--r--  1 michaelgrundie  staff  16602 30 Oct  2019 xpath.h
-rw-r--r--  1 michaelgrundie  staff  19353 30 Oct  2019 xpathInternals.h
-rw-r--r--  1 michaelgrundie  staff   3359 30 Oct  2019 xpointer.h
plicease commented 4 years ago

Looks like it is working this time, what happens when you run make && make test

plicease commented 4 years ago

Actually do a clean build if you can I think it has some of the old values in there. make clean && perl Makefile.PL && make && make test

MichaelGrundie commented 4 years ago

Unfortunately I get the same issue.

.cpan/build/Alien-Libxml2-0.16-1                                                                                                    ⍉
▶ make clean && perl Makefile.PL && make && make test
rm -f \
      Libxml2.bso Libxml2.def \
      Libxml2.exp Libxml2.x \
       blib/arch/auto/Alien/Libxml2/extralibs.all \
      blib/arch/auto/Alien/Libxml2/extralibs.ld Makefile.aperl \
      *.a *.o \
      *perl.core MYMETA.json \
      MYMETA.yml blibdirs.ts \
      core core.*perl.*.? \
      core.[0-9] core.[0-9][0-9] \
      core.[0-9][0-9][0-9] core.[0-9][0-9][0-9][0-9] \
      core.[0-9][0-9][0-9][0-9][0-9] libLibxml2.def \
      mon.out perl \
      perl perl.exe \
      perlmain.c pm_to_blib \
      pm_to_blib.ts so_locations \
      tmon.out
rm -rf \
      blib
mv Makefile Makefile.old > /dev/null 2>&1
rm -rf _alien
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::CommandSequence> + xml2-config --version
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + xml2-config --cflags
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + xml2-config --libs
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Alien::Libxml2
Writing MYMETA.yml and MYMETA.json
cp lib/Alien/Libxml2.pm blib/lib/Alien/Libxml2.pm
"/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" -MAlien::Build::MM=cmd -e prefix site /Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/darwin-2level /Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
main> prefix /Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/share/dist/Alien-Libxml2
"/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" -MAlien::Build::MM=cmd -e version 0.16
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
"/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" -MAlien::Build::MM=cmd -e download
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
"/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" -MAlien::Build::MM=cmd -e build
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::CommandSequence> + pkg-config --exists libxml-2.0
Alien::Build::CommandSequence> + pkg-config --cflags libxml-2.0
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkg-config --libs libxml-2.0
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkg-config --modversion libxml-2.0
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkg-config --static --cflags libxml-2.0
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkg-config --static --libs libxml-2.0
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::Plugin::Core::Legacy> adding legacy hash to config
Alien::Build::Plugin::Core::Gather> mkdir -p /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/blib/lib/auto/share/dist/Alien-Libxml2/_alien
Manifying 1 pod document
"/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" -MAlien::Build::MM=cmd -e test
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
PERL_DL_NONLAZY=1 "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin/perl" "-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_GB.UTF-8
# LC_TERMINAL=iTerm2
# LC_TERMINAL_VERSION=3.3.12
# PERL5LIB=/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/blib/lib:/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/blib/arch
# PERLBREW_HOME=/Users/michaelgrundie/.perlbrew
# PERLBREW_MANPATH=/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/man
# PERLBREW_PATH=/Users/michaelgrundie/perl5/perlbrew/bin:/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/bin
# PERLBREW_PERL=perl-5.16.0
# PERLBREW_ROOT=/Users/michaelgrundie/perl5/perlbrew
# PERLBREW_SHELLRC_VERSION=0.88
# PERLBREW_VERSION=0.88
# PERL_DL_NONLAZY=1
# PERL_USE_UNSAFE_INC=1
# SHELL=/bin/zsh
#
#
#
# PERL5LIB path
# /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/blib/lib
# /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/blib/arch
#
#
#
# perl                                     5.016000
# Alien::Base                              2.33
# Alien::Build                             2.33
# Alien::Build::MM                         2.33
# Alien::Build::Plugin::Build::SearchDep   2.33
# Alien::Build::Plugin::Prefer::BadVersion 2.33
# Alien::Build::Plugin::Probe::Vcpkg       2.33
# ExtUtils::CBuilder                       0.280206
# ExtUtils::MakeMaker                      7.48
# Test2::V0                                0.000136
# Test::Alien                              2.33
#
#
#
# version        = 2.9.4
# cflags         =
# cflags_static  =
# libs           = -lxml2
# libs_static    = -lxml2 -lz -lpthread -licucore -lm
#
#
#
t/00_diag.t ........ ok
t/alien_libxml2.t .. 1/?
# Failed test 'xs'
# at t/alien_libxml2.t line 26.
#   ExtUtils::CBuilder->compile failed
#     error building /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/_alien/tmp/NTk4ly_305/test.o from '/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/_alien/tmp/NTk4ly_305/test.c' at /Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/ExtUtils/CBuilder/Base.pm line 177.
#     cc -I/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/darwin-2level/CORE -c -fno-common -DPERL_DARWIN -mmacosx-version-min=10.15 -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -DPERL_USE_SAFE_PUTENV -O3 -o /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/_alien/tmp/NTk4ly_305/test.o /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/_alien/tmp/NTk4ly_305/test.c
#     /Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/_alien/tmp/NTk4ly_305/test.xs:5:10: fatal error: 'libxml/parser.h' file not found
#     #include <libxml/parser.h>
#              ^~~~~~~~~~~~~~~~~
#     1 error generated.
t/alien_libxml2.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests

Test Summary Report
-------------------
t/alien_libxml2.t (Wstat: 256 Tests: 3 Failed: 1)
  Failed test:  2
  Non-zero exit status: 1
Files=2, Tests=4,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.44 cusr  0.13 csys =  0.59 CPU)
Result: FAIL
Failed 1/2 test programs. 1/4 subtests failed.
make: *** [test_dynamic] Error 1
MichaelGrundie commented 4 years ago
▶ cat _alien/state.json
{
   "args" : [
      "root",
      "_alien",
      "meta_prop",
      {}
   ],
   "install" : {
      "complete" : {
         "gather_system" : 1
      },
      "finished" : 1,
      "mm" : {
         "distname" : "Alien-Libxml2"
      },
      "my_cflags" : "-I/usr/local/Cellar/libxml2/2.9.10_1/include/libxml2",
      "my_libs" : "-L/usr/local/Cellar/libxml2/2.9.10_1/lib -lxml2 -lz -lpthread -liconv -lm",
      "my_version" : "2.9.10",
      "patch" : null,
      "plugin_probe_cbuilder_gather" : {},
      "prefix" : "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/share/dist/Alien-Libxml2",
      "root" : "/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/_alien",
      "stage" : "/Users/michaelgrundie/.cpan/build/Alien-Libxml2-0.16-1/blib/lib/auto/share/dist/Alien-Libxml2"
   },
   "runtime" : {
      "alien_build_version" : "2.33",
      "cflags" : " ",
      "cflags_static" : " ",
      "install_type" : "system",
      "legacy" : {
         "finished_installing" : 1,
         "install_type" : "system",
         "original_prefix" : "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/share/dist/Alien-Libxml2",
         "version" : "2.9.4"
      },
      "libs" : "-lxml2 ",
      "libs_static" : "-lxml2 -lz -lpthread -licucore -lm ",
      "perl_module_version" : "0.16",
      "prefix" : "/Users/michaelgrundie/perl5/perlbrew/perls/perl-5.16.0/lib/site_perl/5.16.0/darwin-2level/auto/share/dist/Alien-Libxml2",
      "version" : "2.9.4"
   }
}
MichaelGrundie commented 4 years ago

Is the issue that runtime cflags does not match my_cflags?

plicease commented 4 years ago

@MichaelGrundie sorry I intended for you to run make realclean or start with a fresh unpacked tarball:

make realclean && perl Makefile.PL && make && make test

MichaelGrundie commented 4 years ago

Hi, I had tried realclean before after reading some of the other closed issues and it didn't resolve this issues, though I have found a way to get it working.

I ran: export PKG_CONFIG_PATH="/usr/local/opt/libxml2/lib/pkgconfig"

I think the issue is that the mac default pkg-config couldn't see the .pc file?

I don't think I have brew installed pkg-config which I'm guessing some people typically do? (source: https://github.com/Homebrew/homebrew-core/issues/56402)

But after exporting PKG_CONFIG_PATH it installed fine.

plicease commented 4 years ago

@MichaelGrundie I just wanted to let you know that I was finally able to reproduce this on my mac. (not sure why, but although I wasn't able to get it to fail I was able to get it to find the wrong cflags which is the cause of what you are seeing). I'm glad that you have a workaround for now, but I am working on an enhancement to Alien::Build that the is module should be able to take advantage of to make this work more reliably and address the specific bug that you uncovered. Thanks for reporting this and helping me out while I was trying to reproduce it.

MichaelGrundie commented 4 years ago

No problem, if you need any other info from me, I'm happy to help

plicease commented 4 years ago

@MichaelGrundie Can you install Alien::Build 2.36_01 ( https://cpan.metacpan.org/authors/id/P/PL/PLICEASE/Alien-Build-2.36_01.tar.gz ) and try it now? I tested in my environment and it seemed to work and would like to know if it works for you as well.

MichaelGrundie commented 4 years ago

I’ll do this tomorrow and let you know.

plicease commented 4 years ago

Thanks. GitHub decided to auto-close this for me based on #24, but please re-open this if it is still happening.

MichaelGrundie commented 4 years ago

@plicease installed without issue and without exporting PKG_CONFIG_PATH. Good work and thank you 👍