shawnlaffan / perl-alien-proj

Perl Alien package to compile the Proj library
GNU Lesser General Public License v3.0
3 stars 1 forks source link

Alien::proj 1.24 tests fail #11

Closed dhdeangelis closed 2 years ago

dhdeangelis commented 2 years ago

Installing Alien::proj fails on tests. Output below taken from the last lines of successful build.

OS: openSUSE Tumbleweed Perl: 5.34.1 proj: 9.0.0

Note: Proj 9 is already in the system, findable and accessible:

> find /usr/local -name libproj*
/usr/local/lib64/libproj.so.25.9.0.0
/usr/local/lib64/libproj.so.25
/usr/local/lib64/libproj.so

yet, Alien::proj will still download and build it again. This is perhaps not optimal behavior.

Manifying 1 pod document
  SLAFFAN/Alien-proj-1.24.tar.gz
  /bin/make -- OK
Running make test for SLAFFAN/Alien-proj-1.24.tar.gz
"/usr/local/perls/perl-5.34.1/bin/perl" -MAlien::Build::MM=cmd -e test
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is 9.0.0
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:
ENV: LD_LIBRARY_PATH is
ENV: LDFLAGS is
ENV: CFLAGS is
ENV: CXXFLAGS is
PERL_DL_NONLAZY=1 "/usr/local/perls/perl-5.34.1/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ....... 1/? # Testing Alien::proj 1.24, Perl 5.034001, /usr/local/perls/perl-5.34.1/bin/perl
#
# Install type is share
# Proj version is 9.0.0
# Aliens:
# Alien::sqlite: version: 3.38.1, install type: system
# Alien::libtiff: version: 4.3.0, install type: system
# $ENV{LD_LIBRARY_PATH} =
# Dynamic lib dependencies:
# /root/.cpan/build/Alien-proj-1.24-0/blib/lib/auto/share/dist/Alien-proj/lib64/libproj.so:
#     linux-vdso.so.1 (0x00007ffde39c5000)
#     libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x00007fb57bf0e000)
#     libtiff.so.5 => /lib64/libtiff.so.5 (0x00007fb57be89000)
#     libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fb57bc5e000)
#     libm.so.6 => /lib64/libm.so.6 (0x00007fb57bb74000)
#     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fb57bb53000)
#     libc.so.6 => /lib64/libc.so.6 (0x00007fb57b924000)
#     libzstd.so.1 => /lib64/libzstd.so.1 (0x00007fb57b874000)
#     liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fb57b841000)
#     libjbig.so.2 => /lib64/libjbig.so.2 (0x00007fb57b833000)
#     libjpeg.so.8 => /lib64/libjpeg.so.8 (0x00007fb57b799000)
#     libz.so.1 => /lib64/libz.so.1 (0x00007fb57b77c000)
#     /lib64/ld-linux-x86-64.so.2 (0x00007fb57c43e000)
# /root/.cpan/build/Alien-proj-1.24-0/blib/lib/auto/share/dist/Alien-proj/lib64/libproj.so.25:
#     linux-vdso.so.1 (0x00007fff4b721000)
#     libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x00007f15690a1000)
#     libtiff.so.5 => /lib64/libtiff.so.5 (0x00007f156901c000)
#     libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f1568df1000)
#     libm.so.6 => /lib64/libm.so.6 (0x00007f1568d07000)
#     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f1568ce6000)
#     libc.so.6 => /lib64/libc.so.6 (0x00007f1568ab7000)
#     libzstd.so.1 => /lib64/libzstd.so.1 (0x00007f1568a07000)
#     liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f15689d4000)
#     libjbig.so.2 => /lib64/libjbig.so.2 (0x00007f15689c6000)
#     libjpeg.so.8 => /lib64/libjpeg.so.8 (0x00007f156892c000)
#     libz.so.1 => /lib64/libz.so.1 (0x00007f156890f000)
#     /lib64/ld-linux-x86-64.so.2 (0x00007f15695d1000)
# /root/.cpan/build/Alien-proj-1.24-0/blib/lib/auto/share/dist/Alien-proj/lib64/libproj.so.25.9.0.0:
#     linux-vdso.so.1 (0x00007ffdc65e5000)
#     libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x00007f4267b89000)
#     libtiff.so.5 => /lib64/libtiff.so.5 (0x00007f4267b04000)
#     libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007f42678d9000)
#     libm.so.6 => /lib64/libm.so.6 (0x00007f42677ef000)
#     libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007f42677ce000)
#     libc.so.6 => /lib64/libc.so.6 (0x00007f426759f000)
#     libzstd.so.1 => /lib64/libzstd.so.1 (0x00007f42674ef000)
#     liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f42674bc000)
#     libjbig.so.2 => /lib64/libjbig.so.2 (0x00007f42674ae000)
#     libjpeg.so.8 => /lib64/libjpeg.so.8 (0x00007f4267414000)
#     libz.so.1 => /lib64/libz.so.1 (0x00007f42673f7000)
#     /lib64/ld-linux-x86-64.so.2 (0x00007f42680b9000)
t/00-load.t ....... ok   
t/01-config.t ..... # NAME=proj
# VERSION=9.0.0
# CFLAGS:
t/01-config.t ..... 1/?
#   Failed test 'cflags'
#   at t/01-config.t line 16.
#                   ''
#     doesn't match '(?^:-I)'

#   Failed test 'libs'
#   at t/01-config.t line 17.
#                   '-ltiff -lsqlite3'
#     doesn't match '(?^:-L)'
# Looks like you failed 2 tests of 2.
t/01-config.t ..... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests
t/02-use.t ........ 1/? # libs: -ltiff -lsqlite3
# cflags:
# Dynamic libs: /root/.cpan/build/Alien-proj-1.24-0/blib/lib/auto/share/dist/Alien-proj/lib64/libproj.so:/root/.cpan/build/Alien-proj-1.24-0/blib/lib/auto/share/dist/Alien-proj/lib64/libproj.so.25:/root/.cpan/build/Alien-proj-1.24-0/blib/lib/auto/share/dist/Alien-proj/lib64/libproj.so.25.9.0.0
# bin dir: /root/.cpan/build/Alien-proj-1.24-0/blib/lib/auto/share/dist/Alien-proj/bin
t/02-use.t ........ ok   
t/03-utilities.t .. 1/? #
#
# Utility results:
# Rel. 9.0.0, March 1st, 2022
# usage: cs2cs [-dDeEfIlrstvwW [args]]
#               [[--area name_or_code] | [--bbox west_long,south_lat,east_long,north_lat]]
#               [--authority {name}] [--accuracy {accuracy}] [--no-ballpark]
#               [+opt[=arg] ...] [+to +opt[=arg] ...] [file ...]
# Exit code is 0
#
# Bin dirs: 1
t/03-utilities.t .. ok   

Test Summary Report
-------------------
t/01-config.t   (Wstat: 512 Tests: 2 Failed: 2)
  Failed tests:  1-2
  Non-zero exit status: 2
t/02-use.t      (Wstat: 0 Tests: 3 Failed: 0)
  TODO passed:   2-3
Files=4, Tests=8,  0 wallclock secs ( 0.01 usr  0.00 sys +  0.42 cusr  0.04 csys =  0.47 CPU)
Result: FAIL
Failed 1/4 test programs. 2/8 subtests failed.
make: *** [Makefile:988: test_dynamic] Error 255
Lockfile removed.
  SLAFFAN/Alien-proj-1.24.tar.gz
  /bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports SLAFFAN/Alien-proj-1.24.tar.gz
Failed during this command:
 SLAFFAN/Alien-proj-1.24.tar.gz               : make_test NO
shawnlaffan commented 2 years ago

Thanks for the report.

Could you provide the results of the perl Makefile.PL invocation? You might need to call make clean first if you are building from source.

Also, what happens when you call pkg-config --modversion proj?

Shawn.

dhdeangelis commented 2 years ago

Thanks for the response, Shawn. Here comes the information you requested:

# pkg-config --modversion proj
9.0.0
# perl Makefile.PL 
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
Alien::Build::CommandSequence> + pkgconf --exists proj
Alien::Build> error in probe (will do a share install): external command failed at /usr/local/perls/perl-5.34.1/lib/site_perl/5.34.1/Alien/Build/CommandSequence.pm line 72.
Alien::Build> Don't panic, we will attempt a share build from source if possible.
Alien::Build> Do not file a bug unless you expected a system install to succeed.
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for Alien::proj
Writing MYMETA.yml and MYMETA.json
shawnlaffan commented 2 years ago

This might be an issue with the pkh-config plugin. I'll look into it.

shawnlaffan commented 2 years ago

What happens if you call pkgconf --exists proj? This is the call being used by the probe.

dhdeangelis commented 2 years ago

Nothing!

pkgconf --exists proj

It seems my PKG_CONFIG_PATH is empty:


echo $PKG_CONFIG_PATH

``
shawnlaffan commented 2 years ago

That seems to be the issue. Is it only a problem for proj? What about other calls like pkgconf --exists gdal?

dhdeangelis commented 2 years ago

That seems to be the issue. Is it only a problem for proj? What about other calls like pkgconf --exists gdal?

Same. PKG_CONFIG_PATH is empty. So this is probably something in my system after all.

shawnlaffan commented 2 years ago

It could be the version. I just installed pkgconf on my WSL2 Ubuntu install. It is version 1.6.3 and finds the relevant libs.

What version do you have installed? I think openSuse is on 1.5.3? pkgconf --version

dhdeangelis commented 2 years ago
# pkgconf --version
1.8.0

Also PKG_CONFIG_PATH is empty. I am not familiar with this. I will have to read a bit on how to configure this properly.

That explains the problems with Alien::proj.

shawnlaffan commented 2 years ago

I can special case the probe to use pkg-config on openSuse. What does perl -e'print $^O' return?

It might also be the case that pkgconf does not search /usr/local/lib* by default: https://access.redhat.com/discussions/4734691

@plicease - FYI.

dhdeangelis commented 2 years ago

I can special case the probe to use pkg-config on openSuse. What does perl -e'print $^O' return?

It might also be the case that pkgconf does not search /usr/local/lib* by default: https://access.redhat.com/discussions/4734691

@plicease - FYI.

I did a quick search and things are apparently not so clear in my system. Let me first investigate more and I will come back. May be the problem is not with Alien::* after all but here in my system, or in openSUSE. Thank you.

shawnlaffan commented 2 years ago

Another alternative is to add '/usr/local/lib64/pkgconfig' to $ENV{PKG_CONFIG_PATH} on openSUSE in the alienfile. If it is a general issue then it could be added to the main Alien system.

dhdeangelis commented 2 years ago

Thank you Shawn. I now see there may be something problematic either on my system or in this particular version of pkgconfig for opensuse:

For example:

# pkg-config --exists proj

returns nothing, but:

# pkgconf --path proj
/usr/local/lib64/pkgconfig/proj.pc

The PKG_PATH is now correct:

# echo $PKG_CONFIG_PATH
/usr/lib64/pkgconfig:/usr/share/pkgconfig:/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig

But none of this suggests a problem with Alien::proj. I will dig more and come back. Thanks for all help.

shawnlaffan commented 2 years ago

It might be working. pkg-config prints nothing for exists either

pkg-config --exists proj
# 
pkg-config --exists proj && echo yes
# yes
dhdeangelis commented 2 years ago

I am now finding that indeed it may be working, if we ask in a different way:

# if (pkgconf --exists proj); then echo 'exists'; fi;
exists

See this question and its answers: https://stackoverflow.com/questions/25874903/what-exactly-does-pkg-config-exists-do

dhdeangelis commented 2 years ago

And now it seems to be seeing the pakage:


Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
Alien::Build::CommandSequence> + pkgconf --exists proj
Alien::Build::CommandSequence> + pkgconf --atleast-version=6.1 proj
Alien::Build::CommandSequence> + pkgconf --modversion proj
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Generating a Unix-style Makefile
Writing Makefile for Alien::proj
Writing MYMETA.yml and MYMETA.json```
dhdeangelis commented 2 years ago

And now it installs fine from CPAN. So the culprit was obviously that I lacked a proper PKG_CONFIG_PATH!

cpan[2]> upgrade Alien::proj                                                                                                                                                                  

Package namespace         installed    latest  in CPAN file
Alien::proj                    1.20      1.24  SLAFFAN/Alien-proj-1.24.tar.gz
Running install for module 'Alien::proj'
Checksum for /root/.cpan/sources/authors/id/S/SL/SLAFFAN/Alien-proj-1.24.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
Configuring S/SL/SLAFFAN/Alien-proj-1.24.tar.gz with Makefile.PL
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
Alien::Build::CommandSequence> + pkgconf --exists proj
Alien::Build::CommandSequence> + pkgconf --atleast-version=6.1 proj
Alien::Build::CommandSequence> + pkgconf --modversion proj
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::proj
Writing MYMETA.yml and MYMETA.json
  SLAFFAN/Alien-proj-1.24.tar.gz
  /usr/local/perls/perl-5.34.1/bin/perl Makefile.PL -- OK
Running make for S/SL/SLAFFAN/Alien-proj-1.24.tar.gz
cp lib/Alien/proj.pm blib/lib/Alien/proj.pm
"/usr/local/perls/perl-5.34.1/bin/perl" -MAlien::Build::MM=cmd -e prefix site /usr/local/perls/perl-5.34.1/lib/5.34.1/x86_64-linux /usr/local/perls/perl-5.34.1/lib/site_perl/5.34.1/x86_64-linux 
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
main> prefix /usr/local/perls/perl-5.34.1/lib/site_perl/5.34.1/x86_64-linux/auto/share/dist/Alien-proj
"/usr/local/perls/perl-5.34.1/bin/perl" -MAlien::Build::MM=cmd -e version 1.24
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
"/usr/local/perls/perl-5.34.1/bin/perl" -MAlien::Build::MM=cmd -e download
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
"/usr/local/perls/perl-5.34.1/bin/perl" -MAlien::Build::MM=cmd -e build
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
Alien::Build::CommandSequence> + pkgconf --exists proj
Alien::Build::CommandSequence> + pkgconf --cflags proj
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkgconf --libs proj
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkgconf --modversion proj
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkgconf --static --cflags proj
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Alien::Build::CommandSequence> + pkgconf --static --libs proj
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 /root/.cpan/build/Alien-proj-1.24-1/blib/lib/auto/share/dist/Alien-proj/_alien
Manifying 1 pod document
  SLAFFAN/Alien-proj-1.24.tar.gz
  /bin/make -- OK
Running make test for SLAFFAN/Alien-proj-1.24.tar.gz
"/usr/local/perls/perl-5.34.1/bin/perl" -MAlien::Build::MM=cmd -e test
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is 9.0.0
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
PERL_DL_NONLAZY=1 "/usr/local/perls/perl-5.34.1/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00-load.t ....... 1/? # Testing Alien::proj 1.24, Perl 5.034001, /usr/local/perls/perl-5.34.1/bin/perl
# 
# Install type is system
# Proj version is 9.0.0
# Aliens:
# Alien::sqlite: version: 3.38.1, install type: system
# Alien::libtiff: version: 4.3.0, install type: system
# $ENV{LD_LIBRARY_PATH} = 
# Dynamic lib dependencies:
# /usr/local/lib64/libproj.so.25.9.0.0:
#   linux-vdso.so.1 (0x00007ffc88509000)
#   libsqlite3.so.0 => /lib64/libsqlite3.so.0 (0x00007fd7b822d000)
#   libtiff.so.5 => /lib64/libtiff.so.5 (0x00007fd7b81a8000)
#   libcurl.so.4 => /lib64/libcurl.so.4 (0x00007fd7b8101000)
#   libstdc++.so.6 => /lib64/libstdc++.so.6 (0x00007fd7b7ed4000)
#   libm.so.6 => /lib64/libm.so.6 (0x00007fd7b7dec000)
#   libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00007fd7b7dcb000)
#   libc.so.6 => /lib64/libc.so.6 (0x00007fd7b7b9c000)
#   libzstd.so.1 => /lib64/libzstd.so.1 (0x00007fd7b7aec000)
#   liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fd7b7ab9000)
#   libjbig.so.2 => /lib64/libjbig.so.2 (0x00007fd7b7aa9000)
#   libjpeg.so.8 => /lib64/libjpeg.so.8 (0x00007fd7b7a11000)
#   libz.so.1 => /lib64/libz.so.1 (0x00007fd7b79f4000)
#   libnghttp2.so.14 => /lib64/libnghttp2.so.14 (0x00007fd7b79cc000)
#   libidn2.so.0 => /lib64/libidn2.so.0 (0x00007fd7b79ab000)
#   libssh.so.4 => /lib64/libssh.so.4 (0x00007fd7b793d000)
#   libpsl.so.5 => /lib64/libpsl.so.5 (0x00007fd7b7927000)
#   libssl.so.1.1 => /lib64/libssl.so.1.1 (0x00007fd7b7884000)
#   libcrypto.so.1.1 => /lib64/libcrypto.so.1.1 (0x00007fd7b754b000)
#   libgssapi_krb5.so.2 => /lib64/libgssapi_krb5.so.2 (0x00007fd7b74f7000)
#   libldap-2.5.so.0 => /lib64/libldap-2.5.so.0 (0x00007fd7b7493000)
#   liblber-2.5.so.0 => /lib64/liblber-2.5.so.0 (0x00007fd7b7482000)
#   libbrotlidec.so.1 => /lib64/libbrotlidec.so.1 (0x00007fd7b7473000)
#   /lib64/ld-linux-x86-64.so.2 (0x00007fd7b875f000)
#   libunistring.so.2 => /lib64/libunistring.so.2 (0x00007fd7b72ef000)
#   libkrb5.so.3 => /lib64/libkrb5.so.3 (0x00007fd7b7220000)
#   libk5crypto.so.3 => /lib64/libk5crypto.so.3 (0x00007fd7b7207000)
#   libcom_err.so.2 => /lib64/libcom_err.so.2 (0x00007fd7b7201000)
#   libkrb5support.so.0 => /lib64/libkrb5support.so.0 (0x00007fd7b71ef000)
#   libsasl2.so.3 => /lib64/libsasl2.so.3 (0x00007fd7b71d0000)
#   libbrotlicommon.so.1 => /lib64/libbrotlicommon.so.1 (0x00007fd7b71ad000)
#   libkeyutils.so.1 => /lib64/libkeyutils.so.1 (0x00007fd7b71a6000)
#   libresolv.so.2 => /lib64/libresolv.so.2 (0x00007fd7b7192000)
#   libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fd7b7164000)
#   libpcre2-8.so.0 => /lib64/libpcre2-8.so.0 (0x00007fd7b70b6000)
t/00-load.t ....... ok   
t/01-config.t ..... # NAME=proj
# VERSION=9.0.0
# CFLAGS: -I/usr/local/include
t/01-config.t ..... ok   
t/02-use.t ........ 1/? # libs: -L/usr/local/lib64 -lproj
# cflags: -I/usr/local/include
# Dynamic libs: /usr/local/lib64/libproj.so.25.9.0.0
# bin dir: 
no proj bin dir found via bin_dir method
t/02-use.t ........ ok   
t/03-utilities.t .. 1/? # 
# 
# Utility results:
# Rel. 9.0.0, March 1st, 2022
# usage: cs2cs [-dDeEfIlrstvwW [args]]
#               [[--area name_or_code] | [--bbox west_long,south_lat,east_long,north_lat]]
#               [--authority {name}] [--accuracy {accuracy}] [--no-ballpark]
#               [+opt[=arg] ...] [+to +opt[=arg] ...] [file ...]
# Exit code is 0
# 
# Bin dirs: 0
t/03-utilities.t .. ok   
All tests successful.

Test Summary Report
-------------------
t/02-use.t      (Wstat: 0 Tests: 3 Failed: 0)
  TODO passed:   2-3
Files=4, Tests=8,  1 wallclock secs ( 0.02 usr  0.00 sys +  0.43 cusr  0.06 csys =  0.51 CPU)
Result: PASS
Lockfile removed.
  SLAFFAN/Alien-proj-1.24.tar.gz
  /bin/make test -- OK
Running make install for SLAFFAN/Alien-proj-1.24.tar.gz
"/usr/local/perls/perl-5.34.1/bin/perl" -MAlien::Build::MM=cmd -e clean_install
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is 9.0.0
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/lib64/pkgconfig /usr/share/pkgconfig /usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
Manifying 1 pod document
Files found in blib/arch: installing files in blib/lib into architecture dependent library tree
Installing /usr/local/perls/perl-5.34.1/lib/site_perl/5.34.1/x86_64-linux/Alien/proj.pm
Installing /usr/local/perls/perl-5.34.1/lib/site_perl/5.34.1/x86_64-linux/auto/share/dist/Alien-proj/_alien/alien.json
Installing /usr/local/perls/perl-5.34.1/lib/site_perl/5.34.1/x86_64-linux/auto/share/dist/Alien-proj/_alien/alienfile
Installing /usr/local/perls/perl-5.34.1/man/man3/Alien::proj.3
Appending installation info to /usr/local/perls/perl-5.34.1/lib/5.34.1/x86_64-linux/perllocal.pod
  SLAFFAN/Alien-proj-1.24.tar.gz
  /bin/make install  -- OK
shawnlaffan commented 2 years ago

Good to see!

Just to be clear, you set $PKG_CONFIG_PATH yourself? If so then I can add a conditional to update it within the alienfile on openSUSE. I just need to know what perl -e'print $^O' returns.

If it affects other Aliens then it can perhaps be added to the main Alien::Build system.

dhdeangelis commented 2 years ago

Yes I set my PKG:CONFIG:PATH manually, but in my view it shouldn't be that way.

perl -e'print $^O' returns linux

shawnlaffan commented 2 years ago

Thanks. That $^O is pretty generic...

I'll look into using pkgconf itself to show the search path it is using, and add /usr/local/... if they exist and are not listed.

pkgconf --variable pc_path pkgconf

dhdeangelis commented 2 years ago

Yes, that's a good idea. I am confused about this variable pc_path pkgconf. Is it the built-in default pkgconf variable?

shawnlaffan commented 2 years ago

It's not documented in the man page. I found it at https://superuser.com/questions/47967/where-does-pkg-config-takes-its-information-from

shawnlaffan commented 2 years ago

@dhdeangelis - I've added some code to a branch to add the local lib paths to PKG_CONFIG_PATH when they exist and are not already searched. Could you give that a try when you get a chance?

https://github.com/shawnlaffan/perl-alien-proj/tree/issue_11_pkgconf

You might need to install Capture::Tiny for it to run.

I'll check in again tomorrow (when I will also fix the Cirrus errors).

plicease commented 2 years ago

I think in this case if AB is using the pkg-config command line then it has to rely on it being properly configured. If we try proactively modifying PKG_CONFIG_PATH then it could muck up local configuration. Many things are not going to work if pkg-config is pointing to the 32 bit libraries anyway.

dhdeangelis commented 2 years ago

I tested this branch. I found that if I run perl makefile.PL without any particular configuration for PKG_CONFIG_PATH it does not recognize that proj is present:

> perl Makefile.PL 
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::Auto::X0::Alienfile> PK: pkgconf
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
Alien::Build::CommandSequence> + pkgconf --exists proj
Alien::Build::CommandSequence> + pkgconf --exists proj
Alien::Build> error in probe (will do a share install): external command failed at /usr/local/perls/perl-5.34.1/lib/site_perl/5.34.1/Alien/Build/CommandSequence.pm line 72.
Alien::Build> Don't panic, we will attempt a share build from source if possible.
Alien::Build> Do not file a bug unless you expected a system install to succeed.
Generating a Unix-style Makefile
Writing Makefile for Alien::proj
Writing MYMETA.yml and MYMETA.json

On the other hand, in my new "normal" state in which I added a new file /etc/bash.bashrc.local with the following line:

export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig

it seems to work OK, as expected:

> perl Makefile.PL 
Alien::sqlite has sqlite version 3.38.1
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Alien::Build::Auto::X0::Alienfile> PK: pkgconf
Alien::Build::Plugin::PkgConfig::Negotiate> Using PkgConfig plugin: PkgConfig::CommandLine
Downloaded proj version is not yet defined
Alien::Build::Auto::X0::Alienfile> Enabling TIFF support
Alien::Build::Auto::X0::Alienfile> PKG_CONFIG_PATH:/usr/local/lib64/pkgconfig /usr/local/lib/pkgconfig
ENV: LD_LIBRARY_PATH is 
ENV: LDFLAGS is 
ENV: CFLAGS is 
ENV: CXXFLAGS is 
Alien::Build::CommandSequence> + pkgconf --exists proj
Alien::Build::CommandSequence> + pkgconf --atleast-version=6.1 proj
Alien::Build::CommandSequence> + pkgconf --modversion proj
Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
Generating a Unix-style Makefile
Writing Makefile for Alien::proj
Writing MYMETA.yml and MYMETA.json

So it seems the changes made no effect.

shawnlaffan commented 2 years ago

@plicease - That's a good point regarding systems and configurations.

@dhdeangelis - Thanks for testing the code Hernán. Given the the above point it's probably best to leave things be for now. If the effect are widespread then the docs could be updated, and/or some additional warnings can be added to the log.

Thanks again for the report. Let me know if anything else needs to be done under this ticket. If not then I'll close it.

dhdeangelis commented 2 years ago

@plicease - That's a good point regarding systems and configurations.

@dhdeangelis - Thanks for testing the code Hernán. Given the the above point it's probably best to leave things be for now. If the effect are widespread then the docs could be updated, and/or some additional warnings can be added to the log.

Thanks again for the report. Let me know if anything else needs to be done under this ticket. If not then I'll close it.

@shawnlaffan I agree. If we assume that most users have proj installed via the package manager and only a minority will install themselves compiling the code in /usr/local, then it will be enough to just add a note in the documentation reminding them to specify the PKG_CONFIG_PATH as necessary, for example using export PKG_CONFIG_PATH=/usr/local/lib64/pkgconfig:/usr/local/lib/pkgconfig or whatever is suitable for their cases.

shawnlaffan commented 2 years ago

Thanks @dhdeangelis . I'll close this issue now.

If it happens to others then we can add notes to the logs, although one wonders how many users check those in a standard cpan/cpanm install.