perl5-alien / alien-base Goto Github PK
View Code? Open in Web Editor NEWBase classes for Alien:: modules (deprecated, see Alien-Build)
License: Other
Base classes for Alien:: modules (deprecated, see Alien-Build)
License: Other
Alien::Base is now distributed as part of Alien-Build. Please see https://github.com/Perl5-Alien/Alien-Build for details. Alien::Base is a base class and framework for creating Alien distributions. The goal of the project is to make things as simple and easy as possible for both developers and users of Alien modules. Alien is a Perl namespace for defining dependencies in CPAN for libraries and tools which are not "native" to CPAN. Alien modules will typically use the system libraries if they are available, or download the latest version from the internet and build them from source code. These libraries can then be used by other Perl modules, usually modules that are implemented with XS or FFI. To install Alien::Base, use cpanminus: cpanm Alien::Base If you have downloaded this from GitHub or locally, do cpanm --installdeps . cpanm . Once installed you can read the project documentation using the perldoc command, or via the metacpan.org website. If you are an Alien developer, see the authoring documentation: perldoc Alien::Base::ModuleBuild::Authoring perldoc Alien::Build::Manual::AlienAuthor (this one installed in a separate module) http://metacpan.org/pod/Alien::Base::ModuleBuild::Authoring http://metacpan.org/pod/Alien::Build::Manual::AlienAuthor The FAQ also contains hints on dealing with specific challenges, like dealing with specific tools: perldoc Alien::Base::FAQ http://metacpan.org/pod/Alien::Base::FAQ If you are a user of an Alien module, you will likely be more interested in the Alien::Base interface itself: perldoc Alien::Base http://metacpan.org/pod/Alien::Base For questions that aren't answered in the documentation, please feel free to contact the Alien::Base team: * IRC: #native on irc.perl.org * mailing list at https://groups.google.com/forum/#!forum/perl5-alien * GitHub issue tracker at https://github.com/Perl5-Alien/Alien-Base/issues
Although the package configuration information is correctly stored in Alien::MyLib::ConfigData, loading that configuration data does not properly load the PkgConfig class. For example, I am working on an Alien module called Alien::FFCall. The module that will use this Alien module, called simply FFI, has trouble with the Build.PL file, saying:
Can't locate object method "keyword" via package "Alien::Base::PkgConfig" at /home/visitors/dcmertens/perl5/lib/perl5/Alien/Base.pm line 86.
BEGIN failed--compilation aborted at Build.PL line 4.
The installation does not change the directory paths to installed dirs.
[27884] [Tue Nov 25 23:28:48 2014] [warning]: Can't stat
/root/.cpanplus/5.18.4/build/Alien-LibGumbo-0.02/_alien/libgumbo-0.2: Access denied
at /usr/local/share/perl5/Alien/Base.pm line 296. (/usr/local/share/perl5/Carp.pm:168)
[27884] [Tue Nov 25 23:28:48 2014] [warning]: Could not resolve -lgumbo at
/usr/local/lib64/perl5/HTML/Gumbo.pm line 7. (/usr/local/share/perl5/Carp.pm:168)
When writing a Build.PL file for a module that depends on Alien::MyLib, the values for $alien->cflags and $alien->libs point to the original build directory rather than the installed sharedir location.
OS: OS X 10.9.4
cpanm (App::cpanminus) 1.7001 on perl 5.016003 built for darwin-2level
Creating new 'Build' script for 'Alien-Base' version '0.004'
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have Capture::Tiny 0.17 ... Yes (0.24)
Checking if you have URI 0 ... Yes (1.61)
Checking if you have parent 0 ... Yes (0.225)
Checking if you have File::chdir 0.1005 ... Yes (0.1008)
Checking if you have File::ShareDir 0 ... Yes (1.102)
Checking if you have Archive::Extract 0 ... Yes (0.58)
Checking if you have HTTP::Tiny 0 ... Yes (0.017)
Checking if you have Module::Build 0.36 ... Yes (0.4205)
Checking if you have Sort::Versions 0 ... Yes (1.60)
Checking if you have Perl::OSType 0 ... Yes (1.002)
Checking if you have List::MoreUtils 0 ... Yes (0.33)
Building and testing Alien-Base-0.004
Building Alien-Base
t/builder.t .............. ok
t/cabinet.t .............. ok
t/file.t ................. ok
t/find_lib.t ............. ok
t/http.t ................. ok
t/http_uri.t ............. ok
t/install_destination.t .. ok
t/interpolate.t .......... ok
t/local_repo.t ........... ok
t/pkgconfig.t ............ ok
t/repository.t ........... ok
t/utils.t ................ ok
t/validation.t ........... ok
Use of uninitialized value $lib in concatenation (.) or string at t/version.t line 29.
t/version.t ..............
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 34.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 35.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 34.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 35.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 34.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 35.
Must specify package names on the command line
t/yy-system_installed.t .. skipped: Could not find a suitable library for testing
Same behaviour under cpanm (App::cpanminus) 1.7001 on perl 5.019009 built for darwin-2level
pkg-config is installed:
$ which pkg-config
/usr/local/bin/pkg-config
$ pkg-config --version
0.28
See issue on expressing this in metadata here: Perl-Toolchain-Gang/CPAN-Meta#82
DESTDIR is feature that allows to use "fake root" directory where everything gets installed
relative to this. DESTDIR is used by distributions for packaging software (using rpm, deb)
Regular Build.PL support destdir well. Unfortunately Alien/Base/ModuleBuild.pm doesn't support it.
[arekm@ixion-pld Alien-LibGumbo-0.02]$ perl Build.PL 'destdir=/home/users/arekm/test/libgumbo'
Archive::Extract will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at /usr/share/perl5/vendor_perl/Alien/Base/ModuleBuild.pm, line 16.
Checking prerequisites...
requires:
! Path::Class is not installed
ERRORS/WARNINGS FOUND IN PREREQUISITES. You may wish to install the versions
of the modules indicated above before proceeding with this installation
Run 'Build installdeps' to install missing prerequisites.
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Alien-LibGumbo' version '0.02'
[arekm@ixion-pld Alien-LibGumbo-0.02]$ ./Build
Archive::Extract will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at /usr/share/perl5/vendor_perl/Alien/Base/ModuleBuild.pm, line 16.
Building Alien-LibGumbo
Downloading File: libgumbo-0.2.tar.gz ... Done
Extracting Archive ... Done
[...]
CXX examples/positions_of_class.o
CXXLD positions_of_class
Done
built fine but now install part:
[arekm@ixion-pld Alien-LibGumbo-0.02]$ LC_ALL=C ./Build install
Archive::Extract will be removed from the Perl core distribution in the next major release. Please install it from CPAN. It is being used at /usr/share/perl5/vendor_perl/Alien/Base/ModuleBuild.pm, line 16.
Building Alien-LibGumbo
Installing /home/users/arekm/test/libgumbo/usr/local/share/perl5/Alien/LibGumbo.pm
Installing /home/users/arekm/test/libgumbo/usr/local/share/perl5/Alien/LibGumbo/ConfigData.pm
Installing /home/users/arekm/test/libgumbo/usr/local/share/perl5/auto/share/dist/Alien-LibGumbo/README
Installing /home/users/arekm/test/libgumbo/usr/local/man/man3/Alien::LibGumbo::ConfigData.3pm
Failed to change directory to '/usr/local/share/perl5/auto/share/dist/Alien-LibGumbo': No such file or directory at /usr/share/perl5/vendor_perl/Alien/Base/ModuleBuild.pm line 312.
[arekm@ixion-pld Alien-LibGumbo-0.02]$
it did install few files correctly bug then failed :-/
Failed to change directory to '/usr/local/share/perl5/auto/share/dist/Alien-LibGumbo': No such file or directory at /usr/share/perl5/vendor_perl/Alien/Base/ModuleBuild.pm line 312.
308 return if $self->config_data( 'install_type' ) eq 'system';
309
310 {
311 my $target = $self->alien_library_destination;
312 local $CWD = $target;
313
314 # The only form of introspection that exists is to see that the README file
So please implement destdir support in Alien Base.
One solution could be this patch:
http://git.pld-linux.org/gitweb.cgi?p=packages/perl-Alien-Base.git;a=blob_plain;f=perl-Alien-Base-DESTDIR.patch;hb=HEAD
My wish for an Alien::Base install would be to place the *.so libraries
into the architecture dependent branch of the auto dir.
/var/local/perl/5.14.2/lib/site_perl/5.14.2/Alien/DontPanic.pm
/var/local/perl/5.14.2/lib/site_perl/5.14.2/Alien/DontPanic
/var/local/perl/5.14.2/lib/site_perl/5.14.2/Alien/DontPanic/ConfigData.pm
/var/local/perl/5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-DontPanic
/var/local/perl/5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-DontPanic/include
/var/local/perl/5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-DontPanic/include/libdontpanic.h
/var/local/perl/5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-DontPanic/lib
/var/local/perl/5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-DontPanic/lib/dontpanic.pc
/var/local/perl/5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-DontPanic/lib/libdontpanic.so <-- is x86_64-linux specific
/var/local/perl/5.14.2/lib/site_perl/5.14.2/x86_64-linux/auto/Alien/DontPanic
/var/local/perl/5.14.2/lib/site_perl/5.14.2/x86_64-linux/auto/Alien/DontPanic/.packlist
I may be a rare case of sharing a single Perl install directory across multiple architectures
(sun4-solaris, i86pc-solaris, x86_64-linux, i686-linux) and all works well since XS built
modules end up under $Config{archname}/auto
I don't see how Alien::Base would currently support building a module under multiple
architectures. And anyway it seems sorta wrong to put an .so or any other architecture
specific file outside of the architecture specific Perl lib tree branch.
I've got a repository that puts its builds on a different server from the build list page. This causes the file URL to be something like:
http://example.com/mylocation/http://build.example.com/build/tarball.tar.gz
I've started some work on fixing this (https://github.com/preaction/Alien-Base/tree/http_full_urls), but it seems to be bigger than I thought. What are your suggestions for how I should change the API to fix this? Repository::get_files() would have to change, at the very least.
Here is my PERL_MB_OPT
value. I set install_path
to disable build and installation of the documentation in format that I never use (I always use Perldoc).
PERL_MB_OPT="--install_base '$HOME/.perl' --install_path libdoc= --install_path libhtml= --install_path binhtml="
Here is the test output:
$ ./Build test
t/builder.t .............. Not a HASH reference at /home/omengue/.perl/lib/perl5/Module/Build/Base.pm line 2247.
t/builder.t .............. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
t/cabinet.t .............. ok
t/file.t ................. ok
t/find_lib.t ............. Not a HASH reference at /home/omengue/.perl/lib/perl5/Module/Build/Base.pm line 2247.
t/find_lib.t ............. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
t/http.t ................. ok
t/http_uri.t ............. ok
t/install_destination.t .. Not a HASH reference at /home/omengue/.perl/lib/perl5/Module/Build/Base.pm line 2247.
t/install_destination.t .. Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
t/interpolate.t .......... Not a HASH reference at /home/omengue/.perl/lib/perl5/Module/Build/Base.pm line 2247.
t/interpolate.t .......... Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run
t/local_repo.t ........... ok
t/pkgconfig.t ............ ok
t/repository.t ........... ok
t/utils.t ................ ok
t/validation.t ........... ok
t/version.t .............. 1/? Not a HASH reference at /home/omengue/.perl/lib/perl5/Module/Build/Base.pm line 2247.
# Tests were run but no plan was declared and done_testing() was not seen.
t/version.t .............. Dubious, test returned 255 (wstat 65280, 0xff00)
All 1 subtests passed
t/yy-system_installed.t .. skipped: Could not find a suitable library for testing
Test Summary Report
-------------------
t/builder.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/find_lib.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/install_destination.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/interpolate.t (Wstat: 65280 Tests: 0 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
t/version.t (Wstat: 65280 Tests: 1 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
Files=15, Tests=65, 3 wallclock secs ( 0.05 usr 0.02 sys + 2.03 cusr 0.27 csys = 2.37 CPU)
Result: FAIL
Failed 5/15 test programs. 0/65 subtests failed.
Testing Alien::FFI
with Visual C++, and discovered the test suite fails for Alien::Base
. Alien::FFI
installs cleanly (with system libffi) with this version of Alien::Base
. Opening an issue here because I (or someone else who has the tuits) will need to fix it later.
N:\home\ollisg\dev\Alien-FFI>cpanm Alien::Base -v --reinstall
cpanm (App::cpanminus) 1.7001 on perl 5.018002 built for MSWin32-x86-multi-thread-64int
Work directory is C:\Users\ollisg/.cpanm/work/1421865534.7928
You have make N:\lang\msvs\2013\VC\BIN\nmake.exe
You have LWP 6.05
Falling back to Archive::Tar 1.96
You have N:\program32\GnuWin32\bin\unzip.exe
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.98)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.59)
Searching Alien::Base on mirror http://mirror.sydney.wdlabs.com/cpan ...
Downloading index file http://mirror.sydney.wdlabs.com/cpan/modules/02packages.details.txt.gz ...
--> Working on Alien::Base
Fetching http://mirror.sydney.wdlabs.com/cpan/authors/id/P/PL/PLICEASE/Alien-Base-0.008.tar.gz ... OK
Unpacking Alien-Base-0.008.tar.gz
Entering Alien-Base-0.008
Checking configure dependencies from META.json
Checking if you have Module::Build 0.36 ... Yes (0.4205)
Checking if you have Module::Build 0.36 ... Yes (0.4205)
Running Build.PL
Configuring Alien-Base-0.008 ... Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Alien-Base' version '0.008'
OK
Checking dependencies from MYMETA.json ...
Checking if you have parent 0 ... Yes (0.225)
Checking if you have Cwd 0 ... Yes (3.40)
Checking if you have FFI::CheckLib 0 ... Yes (0.07)
Checking if you have HTTP::Tiny 0 ... Yes (0.025)
Checking if you have Module::Build 0.36 ... Yes (0.4205)
Checking if you have File::Spec 0 ... Yes (3.40)
Checking if you have Shell::Guess 0 ... Yes (0.03)
Checking if you have Shell::Config::Generate 0 ... Yes (0.12)
Checking if you have File::chdir 0.1005 ... Yes (0.1008)
Checking if you have Archive::Extract 0 ... Yes (0.68)
Checking if you have File::ShareDir 0 ... Yes (1.03)
Checking if you have Capture::Tiny 0.17 ... Yes (0.23)
Checking if you have Sort::Versions 0 ... Yes (1.5)
Checking if you have Test::More 0.94 ... Yes (1.001003)
Checking if you have Text::ParseWords 3.26 ... Yes (3.28)
Checking if you have URI 0 ... Yes (1.60)
Checking if you have FindBin 0 ... Yes (1.51)
Checking if you have File::Temp 0 ... Yes (0.23)
Checking if you have Perl::OSType 0 ... Yes (1.003)
Checking if you have List::MoreUtils 0 ... Yes (0.33)
Building and testing Alien-Base-0.008 ... Building Alien-Base
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "FFI::Raw" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::MSYS" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::MSYS" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::MSYS" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::CMake" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::TinyCC" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Autotools" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::MSYS" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::Authoring" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild::API" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "ExtUtils::Depends" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::MyLibrary" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Inline" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::Authoring" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::MyLibrary" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild::API#CONFIG-DATA" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild::API#CONSTRUCTOR" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Inline::C" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Inline::CPP" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild::API" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base::ModuleBuild" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Acme::Alien::DontPanic" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Acme::Ford::Prefect" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Acme::Alien::DontPanic" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::LibYAML" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::GSL" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
Cannot find "Alien::Base" in podpath: cannot find suitable replacement path, cannot resolve link
t\00_diag.t ......................... #
t\00_diag.t ......................... 1/1 # perl 5.018002
# Acme::Alien::DontPanic undefined
# Acme::Ford::Prefect undefined
# Acme::Ford::Prefect::FFI undefined
# Archive::Extract 0.68
# Capture::Tiny 0.23
# Cwd 3.40
# File::ShareDir 1.03
# File::Spec 3.40
# File::Temp 0.23
# File::chdir 0.1008
# FindBin 1.51
# HTML::LinkExtor 3.69
# HTTP::Tiny 0.025
# Inline undefined
# Inline::C undefined
# Inline::CPP undefined
# List::MoreUtils 0.33
# Module::Build 0.4205
# Perl::OSType 1.003
# Shell::Config::Generate 0.12
# Shell::Guess 0.03
# Sort::Versions 1.5
# Test::More 1.001003
# Text::ParseWords 3.28
# URI 1.60
# parent 0.225
t\00_diag.t ......................... ok
t\build_flags.t ..................... ok
t\builder.t ......................... ok
t\cabinet.t ......................... ok
t\file.t ............................ ok
t\find_lib.t ........................ 1/?
# Failed test 'found paths from extensions only'
# at t\find_lib.t line 80.
# Structures begin differing at:
# $got->{lib}[0] = Does not exist
# $expected->{lib}[0] = 'lib'
# Failed test '->keyword('Libs') returns mylib'
# at t\find_lib.t line 89.
# ''
# doesn't match '(?^:-lmylib)'
Use of uninitialized value $L in -d at t\find_lib.t line 92.
# Failed test '->keyword('Libs') finds mylib directory'
# at t\find_lib.t line 92.
Use of uninitialized value $L in opendir at t\find_lib.t line 93.
readdir() attempted on invalid dirhandle at t\find_lib.t line 94.
# Failed test '->keyword('Libs') finds mylib'
# at t\find_lib.t line 95.
# Looks like you failed 4 tests of 5.
# Failed test 'Find with static libs only'
# at t\find_lib.t line 96.
# Failed test 'found paths from extensions only'
# at t\find_lib.t line 108.
# Structures begin differing at:
# $got->{lib}[0] = 'dynamic'
# $expected->{lib}[0] = 'lib'
# Looks like you failed 1 test of 5.
# Failed test 'Find with static libs and dynamic dir'
# at t\find_lib.t line 124.
# Looks like you failed 2 tests of 4.
t\find_lib.t ........................ Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/4 subtests
t\http.t ............................ ok
t\http_uri.t ........................ ok
t\inline.t .......................... skipped: test requires Inline 0.56 and Inline::C
t\inline_cpp.t ...................... skipped: test requires Inline 0.56 and Inline::CPP
t\install_destination.t ............. ok
t\interpolate.t ..................... ok
t\local_repo.t ...................... ok
t\pkgconfig.t ....................... ok
t\repository.t ...................... ok
t\repository_content_disposition.t .. ok
t\utils.t ........................... ok
t\validation.t ...................... ok
t\version.t ......................... ok
t\yy-system_installed.t ............. ok
Test Summary Report
-------------------
t\find_lib.t (Wstat: 512 Tests: 4 Failed: 2)
Failed tests: 3-4
Non-zero exit status: 2
Files=20, Tests=109, 14 wallclock secs ( 0.11 usr + 0.03 sys = 0.14 CPU)
Result: FAIL
Failed 1/20 test programs. 2/109 subtests failed.
FAIL
! Installing Alien::Base failed. See C:\Users\ollisg\.cpanm\work\1421865534.7928\build.log for details. Retry with --force to force install it.
N:\home\ollisg\dev\Alien-FFI>
In case there are no pkg-config .pc files, but there are libtool .la files. Perhaps create Alien::Base::Libtool
, like Alien::Base::PkgConfig
.
See: https://www.flameeyes.eu/autotools-mythbuster/libtool/lafiles.html.
On such package that was pointed out to me here is Alien::SDL2. It has to work with multiple libraries to build.
Just a thought, but is there a reason static libraries aren't supported. I've been looking at a couple non-Alien::Base Alien:: modules and they specifically only build static libraries. I might be wrong, but static libraries would not need the need run-time provision mentioned in the documentation. This is advantageous since the Alien module would no longer be a run-time requirement.
This would involve no more than providing Alien::modulename::Install::Files
looking a lot like this:
package Alien::modulename::Install::Files;
use parent q(Alien::modulename); # inherit Inline method
1;
This would allow those wanting to write XS against Alien::modulename
to put in their Makefile.PL
to get for free the various CFLAGS etc:
my $eud = ExtUtils::Depends->new(qw(Othermodule Alien::modulename));
WriteMakefile(NAME => 'Othermodule', $eud->get_makefile_vars);
https://metacpan.org/pod/ExtUtils::Depends#hashref-ExtUtils::Depends::load-name
As seen in Alien::LibXML, when there are variables defined but with null value, A::B::PkgConfg::make_abstract does some really yucky things. Again I should consider moving to using https://metacpan.org/module/PkgConfig where available.
I'm probably doing something silly, but am getting these warnings, and the output doesn't look right...
$ perl -MAlien::LibXML -E'say Alien::LibXML->cflags'
Use of uninitialized value in substitution iterator at /home/tai/perl5/perlbrew/perls/thr-5.16.0/lib/site_perl/5.16.0/Alien/Base/PkgConfig.pm line 109.
Use of uninitialized value in substitution iterator at /home/tai/perl5/perlbrew/perls/thr-5.16.0/lib/site_perl/5.16.0/Alien/Base/PkgConfig.pm line 109.
Use of uninitialized value in substitution iterator at /home/tai/perl5/perlbrew/perls/thr-5.16.0/lib/site_perl/5.16.0/Alien/Base/PkgConfig.pm line 109.
-Iincludedir} -Iincludedir}/libxml2 -I/home/tai/perl5/perlbrew/perls/thr-5.16.0/lib/site_perl/5.16.0/auto/share/dist/Alien-LibXML/include/libxml2
See https://bitbucket.org/tobyink/p5-alien-libxml or https://github.com/tobyink/p5-alien-libxml for the Alien::LibXML.
Some packages come with a foo-config but no pkg-config .pc file. I think that pkg-config should still be used when available because it uses a standard interface when it is supported by the package (and we have a pure perl implementation for when a real pkg-config is not available). However, it would be good to have a way of saying "use foo-config as pkg-config for cflags and libs". We already have a hook for saying "use foo-config --version to determine the system version".
This was my work around for an existing Alien dist, but I am not certain I have it quite right yet:
https://github.com/plicease/Alien-qd/commit/85069bb2ad054f84b90d02160ad817fc4a509ae2
Alternatively, when I was writing the FAQ I tried to find a common example where the package provided a foo-config but no pkg-config .pc file. I couldn't find one, so perhaps it isn't a common problem. Maybe a refinement on the Alien::qd example and an addition to the FAQ would be sufficient.
Hi. I have trouble installing File::chdir on cygwin, its maintainer suggests you could switch to File::pushd. See Perl-Toolchain-Gang/File-chdir#3. Thanks for consideration.
On windows:
N:\home\ollisg\dev\Alien-Base>prove -lv t\builder.t
t\builder.t ..
# Subtest: default temp and share
ok 1 - An object of class 'Alien::Base::ModuleBuild' isa 'Alien::Base::ModuleBuild'
ok 2 - An object of class 'Alien::Base::ModuleBuild' isa 'Module::Build'
ok 3 - Creates _alien dir
ok 4 - Creates _share dir
Cleaning up build files
ok 5 - Removes _alien dir
ok 6 - Removes _share dir
1..6
ok 1 - default temp and share
# Subtest: override temp and share
ok 1 - Creates _test_temp dir
ok 2 - Creates _test_temp dir
Cleaning up build files
ok 3 - Removes _test_temp dir
ok 4 - Removes _test_share dir
1..4
ok 2 - override temp and share
# Subtest: destdir
Building My-Test
Downloading File: foo.tar.gz ... Done
Extracting Archive ... Done
Building library ... % mkdir bin
% touch bin/foo
Done
Library looks like it installed, but no version was determined at t\builder.t line 113.
ok 1 - destdir accessor
Installing C:\Users\ollisg\AppData\Local\Temp\ckLzHWa0XG\home\ollisg\perl5\strawberry\x86\5.18.2\lib\perl5\auto\share\dist\My-Test\README
Installing C:\Users\ollisg\AppData\Local\Temp\ckLzHWa0XG\home\ollisg\perl5\strawberry\x86\5.18.2\lib\perl5\My\Test\ConfigData.pm
Failed to change directory to 'C:\Users\ollisg\AppData\Local\Temp\ckLzHWa0XG\N:\home\ollisg\perl5\strawberry\x86\5.18.2\lib\perl5\auto\share\dist\My-Test': No such file or directory at N:\home\ollisg\dev\Alien-B
ase\lib/Alien/Base/ModuleBuild.pm line 333.
# Child (destdir) exited without calling finalize()
not ok 3 - destdir
# Failed test 'destdir'
# at N:/home/ollisg/perl5/strawberry/x86/5.18.2/lib/perl5/Test/Builder.pm line 276.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 3.
Dubious, test returned 2 (wstat 512, 0x200)
Failed 1/3 subtests
Test Summary Report
-------------------
t\builder.t (Wstat: 512 Tests: 3 Failed: 1)
Failed test: 3
Non-zero exit status: 2
Parse errors: No plan found in TAP output
Files=1, Tests=3, 2 wallclock secs ( 0.01 usr + 0.03 sys = 0.05 CPU)
Result: FAIL
Alien::Base::ModuleBuild::alien_refresh_packlist()
is using ExtUtils::Installed
to fetch the current module's packlist. Unfortunately this may be very slow, especially for large perl installations. The slowness happens already in ExtUtils::Installed->new
, which is scanning the whole perl directory for .packlist files, reads them all (no filtering possible), and also parsing the version numbers of all modules.
On my systems, this may take between 15s (for smaller perl installations, and only if everything's already in the system cache), 300s (also a small perl installation, but uncached), and half an hour (large perl installation, nothing in the system cache).
It would be more efficient if the .packlist file would be search like this:
my $mod = "Term::ReadKey"; $mod =~ s{::}{/}g; for (@INC) { my $candidate = "$_/auto/$mod/.packlist"; return $candidate if -r $candidate}'
and the resulting filename provided to ExtUtils::Packlist->new
, without using ExtUtils::Installed
at all.
This was discussed a little bit in #76. At the time it was somewhat academic as I didn't have any AB classes that needed patching. But I knew that I would one day. Alien::LibYAML
is an example of a package that needs a patch to be usable. This is how I did it.
https://github.com/plicease/Alien-LibYAML/commit/2d6664a2c24f7fa4d1bead0323490ec105c5cbe1
This works well except for two things:
. patch is not available everywhere
. it does not apparently work on windows thanks (I suspect) to line endings
here is a windows failure:
http://www.cpantesters.org/cpan/report/f723c5e8-6fe4-1014-a8dd-bf46afe32da0
There may be an incantation to get patch to work on windows
http://stackoverflow.com/questions/7754972/how-do-i-get-patch-to-ignore-carriage-returns
I haven't tried any of that yet.
libyaml
doesn't install on windows at the moment without patching anyway, so this is not a meaningful regression for now.
The technique described in #76 is powerful in a pinch, but a lot of people are used to dealing with diff patches, and adding an easy and reliable interface for that would be a plus.
Some projects only release their code via Git and it might be useful to have a way to specify a Git repo along with a Git commit SHA or a version tag.
This should be pretty easy to fix:
t\build_flags.t ..................... ok
t\builder.t ......................... ok
t\cabinet.t ......................... ok
t\file.t ............................ ok
t\find_lib.t ........................ ok
# Failed test at t\http.t line 114.
# Structures begin differing at:
# $got->[0] = './'
# $expected->[0] = 'relativepackage.txt'
# Looks like you failed 1 test of 1.
# Failed test 'LWP::UserAgent'
# at t\http.t line 115.
# Looks like you failed 1 test of 2.
# Failed test 'list_files()'
# at t\http.t line 116.
# Child (LWP::UserAgent) exited without calling finalize()
# Failed test 'LWP::UserAgent'
# at N:\home\ollisg\perl5\strawberry\x86\5.18.2\lib\perl5/Test/Builder.pm line 263.
Cannot rename '-9908' to '': No such file or directory
# Child (get_file()) exited without calling finalize()
# Failed test 'get_file()'
# at N:\home\ollisg\perl5\strawberry\x86\5.18.2\lib\perl5/Test/Builder.pm line 276.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 2 just after 8.
t\http.t ............................
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/8 subtests
t\http_uri.t ........................ ok
t\install_destination.t ............. ok
t\interpolate.t ..................... ok
t\local_repo.t ...................... ok
t\pkgconfig.t ....................... ok
t\repository.t ...................... ok
t\repository_content_disposition.t .. ok
t\utils.t ........................... ok
t\validation.t ...................... ok
t\version.t ......................... ok
t\yy-system_installed.t ............. ok
http://www.cpantesters.org/cpan/report/4e136d12-3a54-11e4-9533-b131854e61d6
I was able to reproduce this on my perlbrew'd Perl 5.8.8. There are also some 5.8.x passes so it may just be a wrong version of something somewhere.
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.98)
Checking if you have File::Spec 0.82 ... Yes (3.40)
Checking if you have Locale::Maketext::Simple 0 ... Yes (0.21)
Checking if you have IPC::Cmd 0.64 ... Yes (0.92)
Checking if you have Params::Check 0.07 ... Yes (0.38)
Checking if you have if 0 ... Yes (0.05)
Checking if you have Test::More 0 ... Yes (1.001003)
Checking if you have File::Path 0 ... Yes (1.08)
Checking if you have Module::Load::Conditional 0.04 ... Yes (0.62)
Checking if you have File::Basename 0 ... Yes (2.74)
Building and testing Archive-Extract-0.72 ... cp lib/Archive/Extract.pm blib/lib/Archive/Extract.pm
Manifying blib/man3/Archive::Extract.3
PERL_DL_NONLAZY=1 /home/ollisg/perl5/perlbrew/perls/perl-5.8.8/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/01_Archive-Extract.t .. ok
All tests successful.
Files=1, Tests=1476, 2 wallclock secs ( 0.15 usr 0.02 sys + 0.36 cusr 0.22 csys = 0.75 CPU)
Result: PASS
Manifying blib/man3/Archive::Extract.3
Installing /home/ollisg/.perlbrew/libs/perl-5.8.8@test/lib/perl5/Archive/Extract.pm
Installing /home/ollisg/.perlbrew/libs/perl-5.8.8@test/man/man3/Archive::Extract.3
Appending installation info to /home/ollisg/.perlbrew/libs/perl-5.8.8@test/lib/perl5/x86_64-linux/perllocal.pod
OK
Successfully installed Archive-Extract-0.72
Installing /home/ollisg/.perlbrew/libs/perl-5.8.8@test/lib/perl5/x86_64-linux/.meta/Archive-Extract-0.72/MYMETA.json
Installing /home/ollisg/.perlbrew/libs/perl-5.8.8@test/lib/perl5/x86_64-linux/.meta/Archive-Extract-0.72/install.json
Building and testing Alien-Base-0.005 ... Building Alien-Base
t/build_flags.t .....................
# Failed test at t/build_flags.t line 17.
# Structures begin differing at:
# $got->[0] = ''
# $expected->[0] = '-L/a/b/c'
# Looks like you failed 1 test of 1.
t/build_flags.t ..................... 1/?
# Failed test 'unix'
# at t/build_flags.t line 19.
# Failed test at t/build_flags.t line 23.
# Structures begin differing at:
# $got->[0] = ''
# $expected->[0] = '-L/a/b/c'
# Failed test at t/build_flags.t line 23.
# Structures begin differing at:
# $got->[0] = ''
# $expected->[0] = '-LC:\a\b\c'
# Failed test at t/build_flags.t line 23.
# Structures begin differing at:
# $got->[0] = ''
# $expected->[0] = '-LC:/a/b/c'
# Looks like you failed 3 tests of 3.
# Failed test 'windows'
# at t/build_flags.t line 25.
# Looks like you failed 2 tests of 2.
t/build_flags.t ..................... Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/2 subtests
t/builder.t ......................... 1/? You do not have 'Archive::Tar' installed - Please install it as soon as possible. at /home/ollisg/.cpanm/work/1410538627.26375/Alien-Base-0.005/blib/lib/Alien/Base/ModuleBuild.pm line 259
Library looks like it installed, but no version was determined at t/builder.t line 115
Use of uninitialized value in scalar assignment at /home/ollisg/.cpanm/work/1410538627.26375/Alien-Base-0.005/blib/lib/Alien/Base/ModuleBuild.pm line 345.
Can't find source file Build.PL for up-to-date check at /home/ollisg/.perlbrew/libs/perl-5.8.8@test/lib/perl5/Module/Build/Base.pm line 5614.
t/builder.t ......................... ok
t/cabinet.t ......................... ok
t/file.t ............................ ok
t/find_lib.t ........................ ok
t/http.t ............................ ok
t/http_uri.t ........................ ok
t/install_destination.t ............. ok
t/interpolate.t ..................... ok
t/local_repo.t ...................... ok
t/pkgconfig.t ....................... ok
t/repository.t ...................... ok
t/repository_content_disposition.t .. ok
t/utils.t ........................... ok
t/validation.t ...................... ok
t/version.t ......................... ok
t/yy-system_installed.t ............. ok
Test Summary Report
-------------------
t/build_flags.t (Wstat: 512 Tests: 2 Failed: 2)
Failed tests: 1-2
Non-zero exit status: 2
Files=17, Tests=108, 3 wallclock secs ( 0.09 usr 0.03 sys + 1.96 cusr 0.40 csys = 2.48 CPU)
Result: FAIL
Failed 1/17 test programs. 2/108 subtests failed.
FAIL
if in my Build.PL file I specify:
alien_repository => {
protocol => 'http',
host => 'netcologne.dl.sourceforge.net',
location => '/project/buddy/buddy/BuDDy 2.4/',
pattern => qr/^buddy-([\d\.]+)\.tar\.gz$/,
},
it doesn't fetch the file because of the blank in the location
field.
If I set such a field as:
location => '/project/buddy/buddy/BuDDy%202.4/',
it works.
It looks like the get_file
method of Repository::HTTP
may be updated to use the URI
package.
@devel-chm raised these excellent points on this other issue (Perl5-Alien/Perl5-Alien-Documents#4 (comment)):
I do think that some structural changes will need to optimize
AB for Alien2 capabilities however, the fact that it is a build-on
framework means that we can make the changes and fairly
simply port existing AB users to A2B. For most purposes, I
hope that the "fixed" API still starts from the same beginnings.
It just works a lot better making things work cross-platform.Here are some of the pieces we have (already!) to work with.
This is a list of my thoughts which may differ from others
ideas along the same lines:(1) Use PkgConfig to standardize communication of platform
installation information and capabilities. NOTE: we will
need to deal with issues of whether and where the pkg-config
files would be but it makes sense to me that the vocabulary
should still be the same whether or not a distribution pkg-config
is present.(2) AB is improving incrementally but I think a simple refactoring
to make the operation symmetric across platforms would
really help(3) I think we should think about using EUMM as the dominant
build process for AB (vs MB) for a number of reasons. EUMM
is the defacto build process for perl and is supported across
ALL perl platforms. Many/all external dependencies actually
need the usual make/gcc/... environment to build so a AB
module would need a make, a shell, and a compile environment
to do more than detect. We could support a set of MB tools
or modules to enable platform users to obtain a make+shell+cc
build environment and then go straight make from there.
Personally, I think the pure perl build tool is the most elegant
solution but MB seems to be losing momentum---in part
because it is a thankless job to implement EUMM and make
in perl. Lots of more enjoyable and interesting things to program
out there!(4) PDL has a large number of external dependencies that could
be used as use cases with which to develop this functionality
along with a number of motivated developers.
Some useful packages could be alienized that have executables instead of (or in addition to) libraries. Here is how I was able to get this to work for Alien::nasm
:
https://github.com/plicease/Alien-nasm/blob/master/lib/Alien/nasm.pm#L23
This as an option (default to off) would be a useful feature.
On the line
Line 33 in 2f64e7a
Alien::Base
uses Text::ParseWords::shellwords
to parse out the linkershellwords
, it currently does not work withuse Text::ParseWords qw(shellwords)
## Unix path [ok]
shellwords( "-L/path/to/lib -lzlib" )
# [
# [0] "-L/path/to/lib",
# [1] "-lzlib"
# ]
## Windows path with forward slashes [ok]
shellwords( "-LC:/path/to/lib -lzlib" )
# [
# [0] "-LC:/path/to/lib",
# [1] "-lzlib"
# ]
## Windows path with backslashes [not ok]
shellwords( "-LC:\\path\\to\\lib -lzlib" )
# [
# [0] "-LC:pathtolib",
# [1] "-lzlib"
# ]
Here's an example of an Alien::Base config where that happens for me: https://gist.github.com/zmughal/cab88c49f453f4463f32. This leads to errors in resolving the DLLs.
--> Working on Alien::Base
Fetching http://mirrors.gossamer-threads.com/CPAN/authors/id/J/JB/JBERGER/Alien-Base-0.003.tar.gz
-> OK
Unpacking Alien-Base-0.003.tar.gz
Entering Alien-Base-0.003
Checking configure dependencies from META.json
Checking if you have Module::Build 0.36 ... Yes (0.4205)
Checking if you have Module::Build 0.36 ... Yes (0.4205)
Configuring Alien-Base-0.003
Running Build.PL
Checking prerequisites...
Building and testing Alien-Base-0.003
Building Alien-Base
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/builder.t .............. ok
t/cabinet.t .............. ok
t/file.t ................. ok
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/find_lib.t ............. ok
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/http.t ................. ok
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/http_uri.t ............. ok
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/install_destination.t .. ok
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/interpolate.t .......... ok
t/local_repo.t ........... ok
t/pkgconfig.t ............ ok
t/repository.t ........... ok
t/utils.t ................ ok
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
Can't call method "all_config" on an undefined value at /Users/ether/.perlbrew/libs/19.8@std/lib/perl5/Module/Build/Base.pm line 1009.
# Tests were run but no plan was declared and done_testing() was not seen.
# Looks like your test exited with 255 just after 6.
t/validation.t ...........
Dubious, test returned 255 (wstat 65280, 0xff00)
All 6 subtests passed
(less 2 skipped subtests: 4 okay)
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/version.t .............. ok
# Acme::Override::INET replaced IO::Socket::INET with IO::Socket::IP 0.27
t/yy-system_installed.t .. ok
Test Summary Report
-------------------
t/validation.t (Wstat: 65280 Tests: 6 Failed: 0)
Non-zero exit status: 255
Parse errors: No plan found in TAP output
Files=15, Tests=96, 5 wallclock secs ( 0.08 usr 0.07 sys + 3.16 cusr 0.71 csys = 4.02 CPU)
Result: FAIL
Failed 1/15 test programs. 0/96 subtests failed.
Discussed on the mailing list at some point, but not resolved as far as I can tell. Couple of recent failures:
http://www.cpantesters.org/cpan/report/fb7bea05-6c04-1014-8274-a91b8ac59954
http://www.cpantesters.org/cpan/report/d3e57538-3e65-11e4-9a88-330370114c4e
happens in a couple of other places too. Even if the actual fix is in Alien::Foo
et al it is probably worth a FAQ in AB.
$ ./Build test
t/builder.t .............. ok
t/cabinet.t .............. ok
t/file.t ................. ok
t/find_lib.t ............. ok
t/http.t ................. ok
t/install_destination.t .. ok
t/interpolate.t .......... ok
t/local_repo.t ........... ok
t/pkgconfig.t ............ ok
t/repository.t ........... ok
t/utils.t ................ ok
t/validation.t ........... ok
Use of uninitialized value $name in substitution (s///) at /home/iurt/rpm/BUILD/Alien-Base-0.001/blib/lib/Alien/Base/ModuleBuild.pm line 454.
Use of uninitialized value $lib in concatenation (.) or string at t/version.t line 29.
# Failed test 'Found installed library '
# at t/version.t line 29.
# got: ''
# expected: '1'
# Looks like you failed 1 test of 3.
t/version.t ..............
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/3 subtests
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 32.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 33.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 32.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 33.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 32.
Must specify package names on the command line
Use of uninitialized value $lib in concatenation (.) or string at t/yy-system_installed.t line 33.
Must specify package names on the command line
t/yy-system_installed.t .. skipped: Could not find a suitable library for testing
Test Summary Report
-------------------
t/version.t (Wstat: 256 Tests: 3 Failed: 1)
Failed test: 2
Non-zero exit status: 1
Files=14, Tests=77, 2 wallclock secs ( 0.04 usr 0.02 sys + 1.59 cusr 0.26 csys = 1.91 CPU)
Result: FAIL
Failed 1/14 test programs. 1/77 subtests failed.
Hi,
Alien::Base is not indexed on metacpan, because it is not indexed by PAUSE:
http://cpan.metacpan.org/modules/02packages.details.txt
See also a similar issue for Search::Sphinx; I think it has to do with the version number you use.
metacpan/metacpan-web#622
https://rt.cpan.org/Public/Bug/Display.html?id=79877
One of the other side-effects of this is that your module also is not picked up by smoke testers, because they use the PAUSE index to check what modules to test.
BTW I did test your latest release (manually) on OS X and Windows, and for me it passes.
Now that we are allowing the module to manually install itself into the final share_dir location, the .packlist will not include those files. Using a combination of ExtUtils::Installed and ExtUtils::Packlist, with File::Find or the like, making this current should be possible.
Note that M::B creates an instance of EU::Installed by doing:
my $inst = eval { ExtUtils::Installed->new(extra_libs => [@INC]) };
because aparently it has some problems with modified @INC
, so I should do this too.
XS modules get installed in platform specific directory like x86_64-linux-thread-multi
Alien dists are frequently platform specific (although they might not be you could have an Alien dist that provides some javascript for example).
I think Alien::Base
dists should be installed in the platform specific directory by default. The cases where you wouldn't want to do this are probably small enough that providing a manual override option to turn this off would probably be sufficient. Detecting for platform specific files (.so, .a files) would also be a nice to have.
I think migrating should not be a big problem, as the arch directory seems to come before the non arch directories:
twin% perl -E 'say $_ for @INC'
/home/foo/.perlbrew/libs/perl-5.20.2t@dev/lib/perl5/x86_64-linux-thread-multi
/home/foo/.perlbrew/libs/perl-5.20.2t@dev/lib/perl5
/home/foo/perl5/perlbrew/perls/perl-5.20.2t/lib/site_perl/5.20.2/x86_64-linux-thread-multi
/home/foo/perl5/perlbrew/perls/perl-5.20.2t/lib/site_perl/5.20.2
/home/foo/perl5/perlbrew/perls/perl-5.20.2t/lib/5.20.2/x86_64-linux-thread-multi
/home/foo/perl5/perlbrew/perls/perl-5.20.2t/lib/5.20.2
Though going back once you have converted is tricky (I had this problem with Archive::Libarchive::FFI
, which lost its .so file at some point).
There does not appear to be a public interface to tell Module::Build
to install into a arch directory, so I am also not exactly sure how we do this.
If there is agreement I think this should be marked as a bug.
Hi
I am trying to build some source code from http://gputils.sourceforge.net/ on Windows using Alien::MSYS
and Alien::Base
as in my github repo p5-alien-gputils.
It starts off great with ./configure
working as expected but unfortunately the configure
script checks for byacc
or bison
and flex
and moves on if it is not present. But the make
fails after a while since some source code definitely needs byacc
or bison
installed.
There does not seem to be an Alien::Yacc
or Alien::Bison
present on CPAN. I was hoping Alien::MSYS
could add those two tools as part of its default build ?
What other options do you recommend ?
Please advise.
Synopsis: Alien::Base ok, Alien::FFCall ok, Perl-FFI fails: can't load shared object file
On Ubuntu, I can successfully build and install Alien::Base and Alien::FFCall (the latter can be found here: http://github.com/run4flat/Alien-FFCall). I revised perl-FFI based upon the documentation and examples in Alien::Base; you can find that work here: http://github.com/run4flat/perl-FFI).
Although I can build perl-FFI, I am unable to run any tests. It complains with the following error:
$ ./Build test
t/00-load.t .. 1/2 Bailout called. Further testing stopped: Unable to load FFI!
# Failed test 'use FFI;'
# at t/00-load.t line 8.
# Tried to use 'FFI'.
# Error: Can't load '/home/dcmertens/packages/perl-FFI/blib/arch/auto/FFI/FFI.so' for module FFI: libavcall.so.0: cannot open shared object file: No such file or directory at /home/dcmertens/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/i686-linux/DynaLoader.pm line 190.
The weird part of this: /home/dcmertens/packages/perl-FFI/blib/arch/auto/FFI/FFI.so
is the location of the library as built, not as installed, all the stranger since it found the proper location (/home/dcmertens/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-FFCall...
) at build time:
./Build
Building FFI
cc -I/home/dcmertens/perl5/perlbrew/perls/perl-5.14.2/lib/5.14.2/i686-linux/CORE -DXS_VERSION="1.04" -DVERSION="1.04" -fPIC -I/home/dcmertens/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-FFCall/include -c -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -o lib/FFI.o lib/FFI.c
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/FFI/FFI.bs')
cc -shared -O2 -L/usr/local/lib -fstack-protector -o blib/arch/auto/FFI/FFI.so lib/FFI.o -L/home/dcmertens/perl5/perlbrew/perls/perl-5.14.2/lib/site_perl/5.14.2/auto/share/dist/Alien-FFCall/lib -lavcall -lcallback
Here I'm using perlbrew, obviously, but I can reproduce this behavior on various Ubuntu platforms with various Perl versions. It might be an error in my use of Alien::Base, but I thought I followed the examples correctly. Is this a bug in Alien::Base, or a bug in my code?
In normal usage of Module::Build, one uses this incantation:
perl Build.PL
./Build
./Build test
./Build install
For my Alien modules at the moment, I have no tests, so I simply call "./Build" and then "./Build install". Something is amiss with the bookkeeping, however, and "./Build install" goes through the whole build process again.
This, at least, is the case for my Alien::FFCall distribution, which you can find on github at https://github.com/run4flat/Alien-FFCall
alien_provides_cflags
, alien_provides_libs
.I tried to alienize gettext, the compilation seems to run through, but the usage of the module on the test fails in the end.
Here is the repo: https://github.com/Getty/p5-alien-gettext (with dzil build you get a dist for testing).
Here is the error:
t/load.t ................ 1/?
Could be that by concept this cant work :) but .... I dont know :) probably its easy to handle.
Although $alien->libs() now includes the proper library path, i.e. "-L/home/visitors/dcmertens/perl5/lib/perl5/auto/share/dist/Alien-FFCall/lib", it does not include the corresponding library link command, i.e. "-lffcall". It should be a simple enough fix, though it raises the question: should this be offered through a function for the consumer (i.e. a new method $alien->libs_with_l()) or should it be a configuration option for the Alien author, (i.e. alien_include_l => 1)?
When using the current git version of Alien::Base, the error message
No Alien::Base::PkgConfig objects are stored!
is shown when using Alien::Base; it works with the current cpan version of Alien::Base.
I think the reason for this is, that the project in question is manually compiled - and there are no *.pc files. Base.pm seems to have been changed to abort in case no *.pc file is found (around line 135).
Is this desired behavior?
This may be completely out of the scope, but I'm looking for a solution to deploy perl apps on naive servers. Currently Carton
works great to package up all CPAN dependencies on the build machine and then transfer the entire local/
onto the server with the same base OS and have it all run without issues. (I don't do carton bundle
as then everything would need to be recompiled on the target)
However, this method depends on target having the same shared libraries as the build system. Eg, DBD::Pg
needs to have postgres client libraries installed on both build and target machines. Would Alien::Base
be able to help with this and somehow include the shared libraries in the local/
so that the only requirement of the target system is to have the same base OS as the build machine?
Thanks
Hi,
at the moment, when alien_install_commands are changed from the default value, they are executed even if alien::base finds that the library already is installed on the system.
Is this desired behavior? I do not really see a reason for it - if the library already is installed, there probably is no reason to execute the install commands. It actually is quite probable that they will fail because the build environment is not present in the _alien directory.
Hi
I am the author of Alien::TALib which installs ta-lib from http://ta-lib.org .
Currently Alien::TALib builds the Linux/Mac versions from source but for Windows just downloads and uses a pre-built library.
I am using Strawberry Perl 5.14 on Windows 7 64-bit.
I would like to migrate Alien::TALib to Alien::Base eventually if Alien::Base can support the
$ configure && make && make install
method on Windows so that I do not have to provide pre-built libs anymore. On the insistence of @mohawk2 I am opening this ticket.
To reproduce the error, you have to do the following:
$ git clone -b alienbase https://github.com/vikasnkumar/Alien-TALib
As you can see the reference code is in a separate branch titled 'alienbase'.
The error message is as below:
Building Alien-TALib
'blib' scheme is detected. Setting ALIEN_BLIB=1. If this has been done in error, please set ALIEN_BLIB and restart build process to disambiguate.
Downloading File: ta-lib-0.4.0-src.tar.gz ... Done
Extracting Archive ... Done
Building library ... Failed
'configure' is not recognized as an internal or external command,
operable program or batch file.
External command (configure --prefix=C:\Users\vicash\github\alien-talib-win32\blib\lib\auto\share\dist\Alien-TALib) failed! Error: 256
at .\Build line 58.
Build not completed at .\Build line 58.
Testing on Windows XP 32 bit with Strawberry Perl 5.14.2, I get errors with linking going back many commits. I had hoped to bisect, but as far back as I cared to check, I kept getting this error (I have attempted to restore line breaks, but I may have missed one or two):
Creating new 'Build' script for 'Alien-DontPanic' version '0.01'
ok 1 - The object isa Module::Build
ok 2 - The object isa Alien::Base::ModuleBuild
Downloading File: dontpanic-1.01.tar.gz ... Done
Extracting Archive ... Done
Building library ... Done
ok 3 - ACTION_alien creates _install (share) directory
ok 4 - ACTION_alien creates _alien (build) directory
ok 5 - ACTION_alien installs lib
ok 6 - ACTION_alien installs header
ok 7 - Generate pkgconfig isa Alien::Base::PkgConfig
Building Alien-DontPanic
ok 8 - Ford::Prefect's Build.PL found
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Ford-Prefect' version '0.01'
ok 9 - The object isa Module::Build
Building Ford-Prefect
gcc -c -s -O2 -DWIN32 -DPERL_TEXTMODE_SCRIPTS -DUSE_SITECUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -mms-bitfields -IC:\projects\Alien-Base\examples\Alien-DontPanic\_install/include -s -O2 "-DXS_VERSION=\"0.01\"" "-DVERSION=\"0.01\"" -I"C:\strawberry\perl\lib\CORE" -I"C:\strawberry\c\include" -o "lib\Ford\Prefect.o" "lib\Ford\Prefect.c"
ExtUtils::Mkbootstrap::Mkbootstrap('blib\arch\auto\Ford\Prefect\Prefect.bs')
Generating script 'lib\Ford\Prefect.lds'
dlltool --def "lib\Ford\Prefect.def" --output-exp "lib\Ford\Prefect.exp"
g++ -o "blib\arch\auto\Ford\Prefect\Prefect.dll" -Wl,--base-file,"lib\Ford\Prefect.base" -Wl,--image-base,0x35110000 -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" "lib\Ford\Prefect.lds" -LC:\projects\Alien-Base\examples\Alien-DontPanic\_install/lib -ldontpanic "lib\Ford\Prefect.exp"
c:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/4.4.7/../../../../i686-w64-mingw
32/bin/ld.exe: cannot find -ldontpanic
collect2: ld returned 1 exit status
dlltool --def "lib\Ford\Prefect.def" --output-exp "lib\Ford\Prefect.exp" --base-file "lib\Ford\Prefect.base"
g++ -o "blib\arch\auto\Ford\Prefect\Prefect.dll" -Wl,--image-base,0x35110000 -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberry\c\lib" "lib\Ford\Prefect.lds" -LC:\projects\Alien-Base\examples\Alien-DontPanic\_install/lib -ldontpanic"lib\Ford\Prefect.exp"
c:/strawberry/c/bin/../lib/gcc/i686-w64-mingw32/4.4.7/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -ldontpanic
collect2: ld returned 1 exit status
Can't locate loadable object for module Ford::Prefect in @INC (@INC contains: lib ../../lib C:\projects\Alien-Base\blib\arch C:\projects\Alien-Base\blib\lib C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib . C:\projects\Alien-Base\examples\Alien-DontPanic\blib\lib C:\projects\Alien-Base\examples\Ford-Prefect\blib\lib C:\projects\Alien-Base\examples\Ford-Prefect\blib\arch) at t\zz-example.t line 64
Compilation failed in require at t\zz-example.t line 64.
not ok 10 - Ford::Prefect knows the answer
# Failed test 'Ford::Prefect knows the answer'
# at t\zz-example.t line 66.
# got: undef
# expected: '42'
Cleaning up build files
Cleaning up configuration files
Cleaning up build files
Cleaning up configuration files
ok 11 - realclean removes Build script
ok 12 - realclean removes _install (share) directory
ok 13 - realclean removes _alien (build) directory
1..13
# Looks like you failed 1 test of 13.
I checked as far back as commit f8ef.
What do we think of the idea of adding an inheritable Inline
function so that it would be possible to do:
package Actual::Module;
use Alien::Subclass qw(Inline);
And then be able to do:
use Inline with => qw(Actual::Module);
Inline
will call a class method Actual::Module->Inline
, so it's inheritable (that's why I changed it to be a method, not a function). Then it will be easy to use XS with Inline
to get the C functions into action.
What say you?
I remember running into this before but avoided by using static libs rather than fixing it for dynamic libs on Solaris.
Going with static libs (see #11) will fix this, but there may also be a Solaris way to fix this. Build log for Acme::Ford::Prefect
follows.
Basically, AB uses @DynaLoader::dl_resolve_using
to get the OS to find libfoo.so in the share dir, but on Solaris this only allows finding Foo.so for the XS module.
cpanm (App::cpanminus) 1.7004 on perl 5.016002 built for i86pc-solaris
Work directory is /home/ollisg/.cpanm/work/1409504863.2756
You have make /home/ollisg/bin/make
You have LWP 6.06
You have /usr/bin/tar, /usr/bin/gzip and /usr/bin/bzip2
You have /usr/bin/unzip
Checking if you have ExtUtils::MakeMaker 6.31 ... Yes (6.98)
Checking if you have ExtUtils::Install 1.46 ... Yes (1.67)
Searching Acme::Ford::Prefect on mirror http://mirror.sydney.wdlabs.com/cpan ...
Downloading index file http://mirror.sydney.wdlabs.com/cpan/modules/02packages.details.txt.gz ...
--> Working on Acme::Ford::Prefect
Fetching http://mirror.sydney.wdlabs.com/cpan/authors/id/J/JB/JBERGER/Acme-Ford-Prefect-0.005.tar.gz
-> OK
Unpacking Acme-Ford-Prefect-0.005.tar.gz
Entering Acme-Ford-Prefect-0.005
Checking configure dependencies from META.json
Checking if you have Acme::Alien::DontPanic 0.005 ... Yes (0.005)
Checking if you have Module::Build 0.38 ... Yes (0.4205)
Checking if you have Module::Build 0.36 ... Yes (0.4205)
Configuring Acme-Ford-Prefect-0.005
Running Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Acme-Ford-Prefect' version '0.005'
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::CBuilder 0 ... Yes (0.280216)
Building and testing Acme-Ford-Prefect-0.005
Building Acme-Ford-Prefect
cc -I/home/ollisg/opt/perl/5.16.2/lib/5.16.2/i86pc-solaris/CORE -DXS_VERSION="0.005" -DVERSION="0.005" -KPIC -I/home/ollisg/.cpanm/work/14095
04862.1359/Acme-Alien-DontPanic-0.005/_alien/dontpanic -I/home/ollisg/.cpanm/work/1409504862.1359/Acme-Alien-DontPanic-0.005/_alien/dontpanic
/src -c -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DPERL_USE_SAFE_PUTENV -O -o lib/Acme/Ford/Prefect.o lib/Acme/Ford/Prefect.c
ExtUtils::Mkbootstrap::Mkbootstrap('blib/arch/auto/Acme/Ford/Prefect/Prefect.bs')
cc -G -L/usr/lib -L/usr/ccs/lib -L/opt/sunstudio12.1/prod/lib -L/lib -L/usr/gnu/lib -o blib/arch/auto/Acme/Ford/Prefect/Prefect.so lib/Acme/F
ord/Prefect.o -L/home/ollisg/.cpanm/work/1409504862.1359/Acme-Alien-DontPanic-0.005/_alien/dontpanic/src/.libs -ldontpanic
Can't load '/home/ollisg/.cpanm/work/1409504863.2756/Acme-Ford-Prefect-0.005/blib/arch/auto/Acme/Ford/Prefect/Prefect.so' for module Acme::Fo
rd::Prefect: ld.so.1: perl: fatal: libdontpanic.so.0: open failed: No such file or directory at /home/ollisg/opt/perl/5.16.2/lib/5.16.2/i86pc
-solaris/DynaLoader.pm line 190.
at t/answer.t line 6.
Compilation failed in require at t/answer.t line 6.
BEGIN failed--compilation aborted at t/answer.t line 6.
# Looks like your test exited with 2 before it could output anything.
t/answer.t ..............
Dubious, test returned 2 (wstat 512, 0x200)
Failed 3/3 subtests
t/dontpanic_packlist.t .. ok
Test Summary Report
-------------------
t/answer.t (Wstat: 512 Tests: 0 Failed: 0)
Non-zero exit status: 2
Parse errors: Bad plan. You planned 3 tests but ran 0.
Files=2, Tests=11, 0 wallclock secs ( 0.00 usr + 0.00 sys = 0.00 CPU)
Result: FAIL
Failed 1/2 test programs. 0/11 subtests failed.
-> FAIL Installing Acme::Ford::Prefect failed. See /home/ollisg/.cpanm/work/1409504863.2756/build.log for details. Retry with --force to forc
e install it.
This is something that should be much easier and much more straight forward:
https://github.com/plicease/Alien-nasm/blob/master/inc/My/ModuleBuild.pm#L43
I dummied up a .pc file to provide the version information only. Knowing how to do this requires understanding the Alien::Base innards, and overriding undocumented methods, which means this could also break in a future version. One simple way to determine version numbers is from the file downloaded.
The idiomatic way forward on Unix-alikes is to go with PkgConfig. Is there already a perl-ish way of dealilng with this cross-platform?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.