Giter VIP home page Giter VIP logo

alien-build's People

Contributors

a3f avatar dakkar avatar fweimer-rh avatar giatorta avatar hakonhagland avatar ilya33 avatar inphobia avatar jberger avatar jj avatar jjatria avatar kiwiroy avatar lancew avatar leonerd avatar leto avatar midlifexis avatar mohawk2 avatar nshp avatar plicease avatar run4flat avatar salva avatar shawnlaffan avatar skaji avatar zmughal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alien-build's Issues

Default download hook

There isn't a default download hook currently. Instead we use the fetch, decode and prefer hooks directly if there is no download hook. This is more or less the way we want it to work, but it would be better to have a default hook to actually do that, so that when using the af command you can use --before or --after options on the download hook.

Documentation: the 599 FAQ could use an example.

This FAQ:

https://metacpan.org/pod/distribution/Alien-Build/lib/Alien/Build/Manual/FAQ.pod#599-Internal-Exception-errors-downloading-packages-from-the-internet

says:

Some websites allow an initial request from http but then redirect to https. If you can it is better to specify https, if you cannot, then you can instead use the ssl property on either of those two plugins.

but it would be helpful to provide an example like with the other FAQs. Worth doing a followup for the entire FAQ to make sure that there aren't any other answers that deserve a fleshed out example as well.

Feature request: a "Premake" build plugin?

I've been looking into writing an Alien::Build distribution for a library that uses premake as part of its build process. While reading through the documentation for distribution authors I read about build plugins, and thought that a "Premake" plugin would be the way to go. But there is none in CPAN. So I thought I'd ask what you think about this as a contribution.

I hadn't even heard of the plugin system for Alien::Build until this happened, but I'd be happy to give this a try.

Some questions:

  1. In the likely event that premake is not installed, is it the role of the plugin to get a copy it can use? They distribute precompiled versions for Linux, Mac and Windows, so maybe fetching a version to use would not be too crazy. Or should it just helpfully die with a message to the user?
  2. Premake seems to be under heavy development, and the project I'm trying to use it for actually uses a versions that is still in alpha. How would you handle that?

Additional info

The library in question is Box2D. There is already an Alien::Box2D distribution, but it's outdated because it tries to download the sources from the defunct Google Code website. Looking into fixing that distribution is what sent me down this path.

MSWin32: Better Visual C++ support.

It took major work to get Alien::Libbz2 to work on Visual C++. Alien::FFI also works with some wrappers. Some ideas from both could probably be adapted to a more general solution. Perhaps.

On install test to see if pkg-config actually works ?

We test to see if it is in the PATH on a recent install I noticed that one of the pkg-config tests failed because it was using /usr/bin/perl, and PERL5LIB with perlbrew libs in it. Thing is I am not sure if at configure time PERL5LIB is set in the same way as test time, so this may not even be detectable.

PkgConfig plugins will need to be updated appropriately as well.

Low priority since this is more an bug in the environment, but would be good to be able to work around it.

test directive for alienfile.

To run tests that run at Perl's test phase, but could be something like make check or whatnot. Generally my position has been to put these in with the build step, and just always run them. Some would like them to get run at the test phase, so that users have the option of of forcing an install after or in spite of a failed test.

Use cases:

  • From the share block:
share {
  test [ '%{make} check ];
  # likewise with ffi block:
  ffi {
    test [ '%{make} check' ];
  }'
};

This is the most common use case. When building from source many packages provide a check or test target in their makefile. It should run from the source build directory (_alien/build_XXXX). It should run before the t/*.t tests.

  • From the sys block:
sys {
  test ...; # ???
};

I am not 100% sure of the practical use cases for this are. Hence the equivocal synopsis. Should happen in an empty test directory (_alien/test_XXXX). I think this should be included for symmetry.

  • From the root block:
test ...; # ???

I don't think this should be included. Although it makes sense for symmetry with the gather directive, I can't think of when you would be able to write a common test that would work both in the build directory on a built source tree, and from an empty directory

Implementation Details

  • build block and build.ffi block need to remember the successful build directory so that we an $CWD back into them (currently once we successfully build and stage, this directory is forgotten).
  • Alien::Build::MB and Alien::Build::MM need to be updated to provide augmented test targets.
  • Tests should run BEFORE t/*.t tests.
  • Test failure in test directive should probably bail out and NOT run t/*.t tests ?
  • Support needs also to be added to App::af

Improve CI coverage on Windows (Appveyor love)

Abstract

It would be good to get better coverage on appveyor. At the moment we are using the last major version of Strawberry 5.24.0 (dmake) and not the latest Strawberry 5.26.0 (gmake). Since that is a major configuration change that AB has to deal with it would be good to test both. It would also be good to test Cygwin and MSYS / MinGW. Testing 64 bit Perls may also be useful, but probably less so.

Matrix Items

(Even some useful subset of these would be useful)

  • Strawberry Perl x86 5.24.0
  • Strawberry Perl x64 5.24.0
  • Strawberry Perl x86 5.26.0
  • Strawberry Perl x64 5.26.0
  • cygwin (whatever is installed on appveyor)
  • MSYS2 / MinGW x86
  • MSYS2 / MinGW x64
  • ActiveState Perl (whatever is installed on appveyor)

Additional testing

After testing, AB should be installed, and then we should build some key Aliens to make sure they work. Not 100% sure which are best but candidates:

  • Alien::Autotools
  • Alien::gmake
  • Alien::libuv
  • ...

version 1.32 is not indexed correctly

02packages.details.txt:

Alien::Build                       1.28  P/PL/PLICEASE/Alien-Build-1.28.tar.gz
...
Alien::Build::Plugin::Gather::IsolateDynamic 1.32  P/PL/PLICEASE/Alien-Build-1.32.tar.gz

Core plugin to check cryptographic signatures

Some thought as to how it should work should probably be done. I think however the interface works, the back end should probably use Crypt::Digest and allow multiple algorithms SHA256 seems a good recommendation for the moment, but no algo should be hard coded.

Forcing an install to ignore a system library

Is there generic mechanism to ignore an installed library? For example, if an existing system library is out-of-date, I'd like to be able to use an environment variable to inform Alien::Build to ignore it and download and build from scratch.

Thanks,
Diab

Code example for Alien::Build::Manual::AlienUser for Dist::Zilla

This should go into dist.ini

[@Filter]
-remove = MakeMaker

[MakeMaker::Awesome]
header = use Config;
header = use Alien::Foo;
WriteMakefile_arg = CONFIGURE_REQUIRES => { 'Alien::Foo' => '0' }
WriteMakefile_arg = CCFLAGS => Alien::Foo>cflags . ' ' . $Config{ccflags}
WriteMakefile_arg = LIBS => [ Alien::Foo->libs ]

hard fail in t/test_alien__xs_ok__cpp.t despite marked in TODO

error:

testalienmuuv9/test.c: loadable library and perl binaries are mismatched (got handshake key 0xdb00080, needed 0xdc80080)
t/test_alien__xs_ok__cpp.t ....................... 
Dubious, test returned 1 (wstat 256, 0x100)
No subtests run 

I have not yet been able to reproduce, but I think the bug is in ExtUtils::CBuilder adds the ccflags for C but not C++:

plicease/perl5@011e8fb

full log:

https://gist.github.com/plicease/9d05f7ddce835ac0d671e096a4e3f192

Support building outside of the source root

Both autoconf and cmake support building outside of the source root, eg.:

../source-1.0.0/configre --prefix=...

and

cmake -Dblahblah=foo ../source-1.00/configure

In some cases it would save a lot of copying of files to build in an empty build root with the source root in a different directory.

Failure for PkgConfig::CommandLine under MSYS2

zaki@MSI MINGW64 ~/.cpanm/work/1501782127.6612/Alien-Build-0.80
$ prove -lvr t/alien_build_plugin_pkgconfig_commandline.t
    # Failed test at t/alien_build_plugin_pkgconfig_commandline.t line 77.
    # +------------------+------------------+----+------------------+--------+
    # | PATH             | GOT              | OP | CHECK            | LNs    |
    # +------------------+------------------+----+------------------+--------+
    # |                  | HASH(0x3b059e8)  |    | <HASH>           | 70, 76 |
    # |                  |                  |    |                  |        |
    # | {cflags}         | -fPIC -IC:/msys6 | =~ | (?^:-I/test/incl | 71     |
    # |                  | 4/home/zaki/.cpa |    | ude/foo)         |        |
    # |                  | nm/work/15017821 |    |                  |        |
    # |                  | 27.6612/Alien-Bu |    |                  |        |
    # |                  | ild-0.80/corpus/ |    |                  |        |
    # |                  | include/foo\N{U+ |    |                  |        |
    # |                  | 20}              |    |                  |        |
    # |                  |                  |    |                  |        |
    # | {libs}           | -LC:/msys64/home | eq | -L/test/lib -lfo | 72     |
    # |                  | /zaki/.cpanm/wor |    | o\N{U+20}        |        |
    # |                  | k/1501782127.661 |    |                  |        |
    # |                  | 2/Alien-Build-0. |    |                  |        |
    # |                  | 80/corpus/lib -l |    |                  |        |
    # |                  | foo\N{U+20}      |    |                  |        |
    # |                  |                  |    |                  |        |
    # | {libs_static}    | -LC:/msys64/home | eq | -L/test/lib -lfo | 73     |
    # |                  | /zaki/.cpanm/wor |    | o -lbar -lbaz\N{ |        |
    # |                  | k/1501782127.661 |    | U+20}            |        |
    # |                  | 2/Alien-Build-0. |    |                  |        |
    # |                  | 80/corpus/lib -l |    |                  |        |
    # |                  | foo -lbar -lbaz\ |    |                  |        |
    # |                  | N{U+20}          |    |                  |        |
    # +------------------+------------------+----+------------------+--------+
# Failed test 'system available, okay'
# at t/alien_build_plugin_pkgconfig_commandline.t line 89.
        # Failed test at t/alien_build_plugin_pkgconfig_commandline.t line 139.
        # +-----------------+-----------------+----+-----------------+----------+
        # | PATH            | GOT             | OP | CHECK           | LNs      |
        # +-----------------+-----------------+----+-----------------+----------+
        # |                 | HASH(0x36e57c0) |    | <HASH>          | 113, 138 |
        # |                 |                 |    |                 |          |
        # | {libs}          | -LC:/msys64/hom | eq | -L/test/lib -lx | 114      |
        # |                 | e/zaki/.cpanm/w |    | or\N{U+20}      |          |
        # |                 | ork/1501782127. |    |                 |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/l |    |                 |          |
        # |                 | ib -lxor\N{U+20 |    |                 |          |
        # |                 | }               |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {libs_static}   | -LC:/msys64/hom | eq | -L/test/lib -lx | 115      |
        # |                 | e/zaki/.cpanm/w |    | or -lxor1\N{U+2 |          |
        # |                 | ork/1501782127. |    | 0}              |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/l |    |                 |          |
        # |                 | ib -lxor -lxor1 |    |                 |          |
        # |                 | \N{U+20}        |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {cflags}        | -IC:/msys64/hom | eq | -I/test/include | 116      |
        # |                 | e/zaki/.cpanm/w |    | /xor\N{U+20}    |          |
        # |                 | ork/1501782127. |    |                 |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/i |    |                 |          |
        # |                 | nclude/xor\N{U+ |    |                 |          |
        # |                 | 20}             |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {alt}           | HASH(0x3cbbda8) |    | <HASH>          | 136      |
        # | {alt}{xor}      | HASH(0x3cb85c8) |    | <HASH>          | 127      |
        # |                 |                 |    |                 |          |
        # | {alt}{xor}{libs | -LC:/msys64/hom | eq | -L/test/lib -lx | 121      |
        # | }               | e/zaki/.cpanm/w |    | or\N{U+20}      |          |
        # |                 | ork/1501782127. |    |                 |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/l |    |                 |          |
        # |                 | ib -lxor\N{U+20 |    |                 |          |
        # |                 | }               |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {alt}{xor}{libs | -LC:/msys64/hom | eq | -L/test/lib -lx | 122      |
        # | _static}        | e/zaki/.cpanm/w |    | or -lxor1\N{U+2 |          |
        # |                 | ork/1501782127. |    | 0}              |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/l |    |                 |          |
        # |                 | ib -lxor -lxor1 |    |                 |          |
        # |                 | \N{U+20}        |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {alt}{xor}{cfla | -IC:/msys64/hom | eq | -I/test/include | 123      |
        # | gs}             | e/zaki/.cpanm/w |    | /xor\N{U+20}    |          |
        # |                 | ork/1501782127. |    |                 |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/i |    |                 |          |
        # |                 | nclude/xor\N{U+ |    |                 |          |
        # |                 | 20}             |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {alt}{xor-chill | HASH(0x3cbbc70) |    | <HASH>          | 134      |
        # | out}            |                 |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {alt}{xor-chill | -LC:/msys64/hom | eq | -L/test/lib -lx | 129      |
        # | out}{libs}      | e/zaki/.cpanm/w |    | or-chillout\N{U |          |
        # |                 | ork/1501782127. |    | +20}            |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/l |    |                 |          |
        # |                 | ib -lxor-chillo |    |                 |          |
        # |                 | ut\N{U+20}      |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {alt}{xor-chill | -LC:/msys64/hom | eq | -L/test/lib -lx | 130      |
        # | out}{libs_stati | e/zaki/.cpanm/w |    | or-chillout\N{U |          |
        # | c}              | ork/1501782127. |    | +20}            |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/l |    |                 |          |
        # |                 | ib -lxor-chillo |    |                 |          |
        # |                 | ut\N{U+20}      |    |                 |          |
        # |                 |                 |    |                 |          |
        # | {alt}{xor-chill | -IC:/msys64/hom | eq | -I/test/include | 131      |
        # | out}{cflags}    | e/zaki/.cpanm/w |    | /xor\N{U+20}    |          |
        # |                 | ork/1501782127. |    |                 |          |
        # |                 | 6612/Alien-Buil |    |                 |          |
        # |                 | d-0.80/corpus/i |    |                 |          |
        # |                 | nclude/xor\N{U+ |    |                 |          |
        # |                 | 20}             |    |                 |          |
        # +-----------------+-----------------+----+-----------------+----------+
    # Failed test 'all found in system'
    # at t/alien_build_plugin_pkgconfig_commandline.t line 141.
# Failed test 'system multiple'
# at t/alien_build_plugin_pkgconfig_commandline.t line 143.
t/alien_build_plugin_pkgconfig_commandline.t ..
ok 1 - has bin_name
# it be pkg-config
# PKG_CONFIG_PATH=C:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/lib/pkgconfig
ok 2 - system not available {
    # Alien::Build::CommandSequence> + pkg-config --exists bogus
    # Alien::Build> error in probe (will do a share install): external command failed at C:\msys64\home\zaki\.cpanm\work\1501782127.6612\Alien-Build-0.80\lib/Alien/Build/CommandSequence.pm line 49.
    # 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.
    ok 1
    1..1
}
ok 3 - system available, wrong version {
    # Alien::Build::CommandSequence> + pkg-config --exists foo
    # Alien::Build::CommandSequence> + pkg-config --atleast-version=1.2.4 foo
    # Alien::Build> error in probe (will do a share install): external command failed at C:\msys64\home\zaki\.cpanm\work\1501782127.6612\Alien-Build-0.80\lib/Alien/Build/CommandSequence.pm line 49.
    # 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.
    ok 1
    1..1
}
not ok 4 - system available, okay {
    # Alien::Build::CommandSequence> + pkg-config --exists foo
    # Alien::Build::CommandSequence> + pkg-config --atleast-version=1.2.3 foo
    ok 1
    # Alien::Build::CommandSequence> + pkg-config --exists foo
    # Alien::Build::CommandSequence> + pkg-config --cflags foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --cflags foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --libs foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --libs foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --modversion foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --modversion foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --static --cflags foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --static --cflags foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --static --libs foo
    # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
    # Alien::Build::CommandSequence> + pkg-config --static --libs foo
    # 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 C:/Users/zaki/AppData/Local/Temp/362uhVUFu0/stage/_alien
    not ok 2
    # cflags_static = -fPIC -IC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/include/foo
    ok 3
    1..3
}
not ok 5 - system multiple {
    not ok 1 - all found in system {
        ok 1 - alienfile compiles
        ok 2 - alien install type is system
        ok 3 - alien builds okay
        # Alien::Build::CommandSequence> + pkg-config --exists xor
        # Alien::Build::CommandSequence> + pkg-config --exists xor-chillout
        # Alien::Build::CommandSequence> + pkg-config --cflags xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --cflags xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --cflags xor-chillout
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --libs xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --libs xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --libs xor-chillout
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --modversion xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --modversion xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --modversion xor-chillout
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --static --cflags xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --static --cflags xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --static --cflags xor-chillout
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --static --libs xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --static --libs xor
        # Alien::Build::CommandSequence> [output consumed by Alien::Build recipe]
        # Alien::Build::CommandSequence> + pkg-config --static --libs xor-chillout
        # 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 C:/Users/zaki/AppData/Local/Temp/v04br0Q1dY/stage/_alien
        # $VAR1 = {
        #           'libs' => '-LC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/lib -lxor ',
        #           'prefix' => 'C:/Users/zaki/AppData/Local/Temp/v04br0Q1dY/prefix',
        #           'legacy' => {
        #                         'name' => 'xor',
        #                         'finished_installing' => 1,
        #                         'version' => '4.2.1',
        #                         'install_type' => 'system',
        #                         'original_prefix' => 'C:/Users/zaki/AppData/Local/Temp/v04br0Q1dY/prefix'
        #                       },
        #           'distdir' => 'C:/Users/zaki/AppData/Local/Temp/v04br0Q1dY/prefix',
        #           'version' => '4.2.1',
        #           'cflags' => '-IC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/include/xor ',
        #           'libs_static' => '-LC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/lib -lxor -lxor1 ',
        #           'alt' => {
        #                      'xor-chillout' => {
        #                                          'libs' => '-LC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/lib -lxor-chillout ',
        #                                          'cflags_static' => '-IC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/include/xor ',
        #                                          'version' => '4.2.2',
        #                                          'libs_static' => '-LC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/lib -lxor-chillout ',
        #                                          'cflags' => '-IC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/include/xor '
        #                                        },
        #                      'xor' => {
        #                                 'cflags_static' => '-IC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/include/xor ',
        #                                 'libs' => '-LC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/lib -lxor ',
        #                                 'cflags' => '-IC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/include/xor ',
        #                                 'libs_static' => '-LC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/lib -lxor -lxor1 ',
        #                                 'version' => '4.2.1'
        #                               }
        #                    },
        #           'cflags_static' => '-IC:/msys64/home/zaki/.cpanm/work/1501782127.6612/Alien-Build-0.80/corpus/include/xor ',
        #           'alien_build_version' => '0.80',
        #           'install_type' => 'system'
        #         };
        not ok 4
        1..4
    }
    1..1
}
1..5
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/5 subtests

Test Summary Report
-------------------
t/alien_build_plugin_pkgconfig_commandline.t (Wstat: 512 Tests: 5 Failed: 2)
  Failed tests:  4-5
  Non-zero exit status: 2
Files=1, Tests=5,  2 wallclock secs ( 0.06 usr +  0.03 sys =  0.09 CPU)
Result: FAIL

Patch with .diff files

Your alien dist Alien-Foo should be able to have a patch directory which is accessible from %{alien.install.patch}, and gets copied into $dist_dir/_alien/patch. Once that happens you can do this:

use alienfile;
share {
  patch [ '%{patch} %{alien.install.patch}/foo.diff' ];
};

A plugin which does some automation on the version number, platform, etc would also be handy.

CBuilder In Windows, Misleading System Probe Error Message

This issue only seems to occur in Windows:

https://ci.appveyor.com/project/wbraswell/alien-jpcre2/build/1.0.94#L3260

perl Makefile.PL
Alien::Build::Plugin::Probe::CBuilder> trying: cflags=-IC:/strawberry/perl/site/lib/auto/share/dist/Alien-PCRE2/include -DPCRE2_STATIC  libs=-LC:/strawberry/perl/site/lib/auto/share/dist/Alien-PCRE2/lib -lpcre2-8 
Alien::Build::Plugin::Probe::CBuilder> compile failed: error building xs.dll file from 'mytest.c' at C:/strawberry/perl/lib/ExtUtils/CBuilder/Platform/Windows.pm line 129.
Alien::Build::Plugin::Probe::CBuilder> compile failed: gcc -c -s -O2 -DWIN32 -D__USE_MINGW_ANSI_STDIO -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -fwrapv -fno-strict-aliasing -mms-bitfields -IC:/strawberry/perl/site/lib/auto/share/dist/Alien-PCRE2/include -DPCRE2_STATIC -s -O2 -I"C:\STRAWB~1\perl\lib\CORE" -I"C:\STRAWB~1\c\include" -o "mytest.o" "mytest.c"
mytest.c:1:10: fatal error: jpcre2.hpp: No such file or directory
 #include <jpcre2.hpp>
          ^~~~~~~~~~~~
compilation terminated.
Alien::Build> error in probe (will do a share install): error building xs.dll file from 'mytest.c' at C:/strawberry/perl/lib/ExtUtils/CBuilder/Platform/Windows.pm line 129.

The same build in Linux does not show any of this output whatsoever:

https://travis-ci.org/wbraswell/alien-jpcre2/jobs/257523753#L6173

This has already been mis-reported to me as an error building Alien::JPCRE2 in Windows, so we definitely need to somehow hide the error or otherwise let the users know not to panic when they see this compile error message.

Easy mocking for probe/download/extract/build phases

It should be easier to write tests that mock the stages for the plugin that you are writing isn't used. I've usually done stuff like this:

share {
  download sub { path('file1')->touch };
  extract sub { path('file2')->touch };
  ...
}

Which is pretty short, but still a tad arcane, and pulls in an extra prereq on Path::Tiny. (That module is currently a prereq for AB, but from a purity standpoint, anything downstream that uses Path::Tiny ought to also declare it). Interface tbd. Inspired by:

#63 (comment)

Needs some design, but if someone wants to work on it and has some ideas, please feel free to comment here or on #native.

CC, LD wrapper for late optional Alien utilization

Part of the hesitation to using and Alien module for well established modules is that it means tacking on a number of new prereqs. (personally think this is a bad argument, because they are pretty reliable prereqs). If we can make Alien usage optional on existing simplistic system probes failing, then I think we could improve adoption. To this end we need compiler and linker wrappers so that the appropriate flags can be calculated after the configure step has completed, and before the build step has started. I propose the wrapper should live in Alien::Build::Wrapper, and can be called like this:

% perl -MAlien::Build::Wrapper=Alien::Foo,Alien::Bar -e cc -o foo.o -c foo.c
% perl -MAlien::Build::Wrapper=Alien::Foo,Alien::Bar -e ld -o foo foo.o

This technique is already used by PkgConfig::LibPkgConf which uses Alien::pkgconf if the system package cannot easily be probed by its own Makefile.PL.

share prereqs are being put into build

Noticed this in Libbz2:

use alienfile;
share {
  patch [ '%{patch} ...' ];
}

pulls in Alien::patch as a build require, but should only pull it in as build dynamically. May be a Dist::Zilla::Plugin::AlienBuild bug.

Merge Alien::Role::Alt into core Alien::Base

I'd like to move the interface capabilities in Alien::Role::Alt into core Alien::Base. ::Alt should become an empty role that does not alter Alien::Base for backward compatibility. ::Alt was created as an experimental interface because there wasn't a strong consensus on how to handle this at the time it was created. I think the interface works pretty well in practice as demonstrated by Alien::GMP which is working quite well!

Probe hooks should keep trying until a share is found

Right now, to properly chain probe hooks you need to return system for a system install and die for a share install. The logic should work so that if you return share it tries the other hook, just in case one of them can get a system result. Arguably a design bug, but it is still usable as is.

ExtUtils::ParseXS needs a version bump

As I was working on p5-Alien-OpenJPEG, I noticed that my builds were failing on Travis just on perl-5.20.

After replicating and comparing module versions, I was able to get the following results that suggest we need an ExtUtils::[email protected] minimum:

vagrant@vagrant-ubuntu-trusty-64:~/project-renard/p5-Alien-OpenJPEG/p5-Alien-OpenJPEG/build-dir-5.20$ for version in 3.21 3.24 3.30 3.35; do cpanm ExtUtils::ParseXS@$version -nq >/dev/null 2>&1; echo -en "ExtUtils::ParseXS@$version\t"; perl -Iblib/lib t/version.t >/dev/null 2>&1 && echo 'success' || echo 'fail'; done

ExtUtils::[email protected]  fail
ExtUtils::[email protected]  fail
ExtUtils::[email protected]  success
ExtUtils::[email protected]  success

Nice To Have: Alien::Build::MM should not rebuild if already installed is sufficient

A definite "nice to have" would be to see if the already installed alien is latest and sufficient and thus doing a share build is redundant. Challenges:

  • May need to be "opt in" for the alienfile, possibly with some logic for "these older versions are bad and need to be rebuilt anyway"
  • Test::Alien tests need to be able to work when the lib is already in the installed location (not blib)

The benefit here is that reinstalling an Alien just because there is a new version but no change in the package would be much faster.

Improve plugin documentation.

What exists is somewhat incomplete in parts, out of date in others and there is no tutorial.

Inspiration and lessons learned can be drawn from #42

Two types of plugins should be addressed in said documentation:

  • process plugins, (build, probe, gather, etc) which are used directly in an alienfile as part of the recipe
  • environment plugins (cache, URL rewriters, etc) which are used by end users to adjust behaviors (Alien::Build::Plugin::Fetch::Cache as an example).

I am assigning this to me, but anyone else should feel welcome to make comments or PRs to improve this.

Devel::CheckLib integration

Inspired by #122

Also possibly related ExtUtils::PkgConfig integration. Also definitely related, further FFI::CheckLib integration

The idea is to get these tools commonly used by modules to fallback on Alien based providers if the system does not provide them.

The upside: If a user or integrator explicitly installs Alien::Foo before installing Foo::XS then then he doesn't need to install the system library. In the case of #122 this could mean that you could install stuff into a ./local directory. We get some benefit from Alien without having to push Foo::XS to adopt Alien which usually has a political dimension.

The downside: if this works too well then it may reduce the incentive for Foo::XS owner to adopt Alien. Example: In the case of #122, the requestor wanted to specifically bundle libfoo packages in his ./local in order to be able to deploy that to machines without having to worry about if they had the dev libs. Obviously if his dev machines does have the dev libs then the smartness of only falling back on Alien when the system library is not available is a problem. On the other hand if Foo::XS used Alien::Foo directly, then the user/integrator can ensure that ALIEN_FORCE is set when he/she installs Alien::Foo into ./local.

add data_dir method

A few distributions include a data directory in addition to the bin and lib dirs. It would be useful if there were a method in Alien::Base to access it, per shawnlaffan/perl-alien-gdal#12 .

I have a method in Alien::gdal that seems to work well enough for my use case, but it could probably be more generic.

Improve interface for Download::Negotiate to allow alternatives to Prefer::SortVersions

Prefer::SortVersions is only IMO only sort of okay, but it probably covers 95% of all cases. That said it would be nice for Download::Negotiate to make it easier to customize the sort for that 5% of cases. Right now you can do this like thus:

use alienfile;

probe sub { 'share' };

share {

  start_url 'https://github.com/premake/premake-core/releases';
  plugin 'Download';
  plugin 'Decode::HTML';

  meta->register_hook(prefer => sub {
    my($build, $res) = @_;
    ...
  });

};

I would like to improve this by adding a prefer property that can be one of:

  • the value 0 which indicates not to add a prefer hook or plugin. It is the responsibility of the alienfile to add either a hook or plugin.
  • a code reference which will be used as the prefer hook.
  • a plugin name of the form Prefer::OtherPreferPlugin.

Like the version property the prefer property should imply the use of an appropriate decode plugin.

Examples:

share {
  start_url '...';
  plugin Download => (
    prefer => 0,
  );
  plugin 'Prefer::OtherPreferPlugn';
};
share {
  start_url '...';
  plugin Download => (
    prefer => 0,
  );
  meta->register_hook(
    prefer => sub {
      my($build, $res) = @_;
      ...
    },
  );
};
# xxx do not implment
share {
  start_url '...';
  plugin Download => (
    prefer => 'Prefer::OtherPreferPlugn',
  );
};
share {
  start_url '...';
  plugin Download => (
    prefer => sub {
      my($build, $res) = @_;
      ...
    },
  );
};

appropriate tests should be added to t/alien_build_plugin_download_negotiate.t.

My thinking about this came up in the discussion on #42.

intermittent failure on Solaris / OpenIndiana

This came in from cpantesters:

https://gist.github.com/plicease/564081f002dac921aa28579f4680178b

(there was also a pass from the same tester on Solaris, thus intermittent). Here is the key diagnostic:

t/alien_build_plugin_build_autoconf.t ................ ok
Can't exec "testalienSkVBv/foo.pl": No such file or directory at /home/stro/cpan/build/5.26.0/build/Alien-Build-1.16-0/blib/lib/Test/Alien.pm line 623.
    # Failed test 'xs'
    # at t/alien_build_plugin_build_cmake.t line 96.
    #   ExtUtils::CBuilder->link failed
    #     error building /home/stro/cpan/build/5.26.0/build/Alien-Build-1.16-0/gBE7YvyARW/test.so from /home/stro/cpan/build/5.26.0/build/Alien-Build-1.16-0/gBE7YvyARW/test.o at /home/stro/perl/5.26.0/lib/5.26.0/ExtUtils/CBuilder/Base.pm line 321.
    #     /opt/SUNWspro/bin/cc -G -L/usr/lib -L/usr/ccs/lib -L/opt/sunstudio12.1/prod/lib -L/lib -L/usr/gnu/lib -o /home/stro/cpan/build/5.26.0/build/Alien-Build-1.16-0/gBE7YvyARW/test.so /home/stro/cpan/build/5.26.0/build/Alien-Build-1.16-0/gBE7YvyARW/test.o -L/tmp/VLLBjwPrpR/prefix/lib -lpalindrome -L/tmp/uQgf3EEvQs/prefix/lib -lpalindrome
    #     ld: fatal: library -lpalindrome: not found
    #     ld: fatal: file processing errors. No output written to /home/stro/cpan/build/5.26.0/build/Alien-Build-1.16-0/gBE7YvyARW/test.so

# Failed test 'out-of-source'
# at t/alien_build_plugin_build_cmake.t line 110.
t/alien_build_plugin_build_cmake.t ................... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 

Undeclared dependencies

It appears there are some dependencies that aren't detected by the build process.

URI
URI::file
URI::Escape
File::Listing

The upshot is CPAN test failures in my Alien plugin module Alien::Build::Plugin::Cleanse::BuildDir, e.g.:
http://www.cpantesters.org/cpan/report/d15f1884-9445-11e8-98d5-bb14e5798fec

These are called conditionally, e.g. $meta->add_requires('share' => 'URI' => 0 ); so have been missed by the dependency scanning in the build process (if my understanding of Dist::Zilla is correct).

https://github.com/Perl5-Alien/Alien-Build/blob/e758bdac985c660c1206d89ff23229256b6aa6bd/lib/Alien/Build/Plugin/Fetch/Local.pm#L66

https://github.com/Perl5-Alien/Alien-Build/blob/7978379f52d7fbed31255feaeb9ea4123f16d646/lib/Alien/Build/Plugin/Decode/DirListing.pm#L32

I note that the Alien::Base tests that use URI are conditional, so maybe you already know about this. https://github.com/Perl5-Alien/Alien-Build/blob/177af53c52b12b79342dc5ebb452bc4c5b490538/t/alien_build_plugin_fetch_local.t#L140

It's simple enough for me to work around, but should perhaps be fixed upstream.

Thanks,
Shawn.

openbsd: command line extract fails with xz

Not sure if this is an xz, openbsd, or environment bug, but I get this from some cpantesters running openbsd

t/alien_build_plugin_decode_html.t ................... ok
t/alien_build_plugin_download_negotiate.t ............ ok
t/alien_build_plugin_extract_archivetar.t ............ ok
t/alien_build_plugin_extract_archivezip.t ............ ok
        # Failed test 'no error from extract'
        # at t/alien_build_plugin_extract_commandline.t line 49.
        # +----------------------------------------------------------+----+-------+
        # | GOT                                                      | OP | CHECK |
        # +----------------------------------------------------------+----+-------+
        # | execute failed at /mnt/cpan_build_dir/goku/Alien-Build-1 | eq |       |
        # | .46-0/blib/lib/Alien/Build/Plugin/Extract/CommandLine.pm |    |       |
        # |  line 65.\n                                              |    |       |
        # +----------------------------------------------------------+----+-------+
        # [output   ]Alien::Build::Plugin::Extract::CommandLine> copy /tmp/Al9YjMcfBa/foo-1.00.tar.xz => /tmp/Al9YjMcfBa/xfoo-1.00.tar.xz
        # Alien::Build::Plugin::Extract::CommandLine> + xz -d /tmp/Al9YjMcfBa/xfoo-1.00.tar.xz
        # xz: /tmp/Al9YjMcfBa/xfoo-1.00.tar: Cannot set the file group: Operation not permitted
        # [exception]execute failed at /mnt/cpan_build_dir/goku/Alien-Build-1.46-0/blib/lib/Alien/Build/Plugin/Extract/CommandLine.pm line 65.
    # Failed test 'with extension tar.xz'
    # at t/alien_build_plugin_extract_commandline.t line 71.

# Failed test 'archive'
# at t/alien_build_plugin_extract_commandline.t line 73.
t/alien_build_plugin_extract_commandline.t ........... 
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/2 subtests 
t/alien_build_plugin_extract_commandline__tar_can.t .. ok
t/alien_build_plugin_extract_directory.t ............. ok
t/alien_build_plugin_extract_negotiate.t ............. ok
t/alien_build_plugin_fetch_curlcommand.t ............. ok

I am unable to reproduce on my own openbsd VM, and other cpantesters do not show this error.

Use share/pkgconfig in share directory

So far we only search/use lib/pkgconfig. This usually covers most things that we would care about since most libraries that we are alienizing are arch-dependent and will install their .pc files into lib/pkgconfig. Strictly speaking we should also support share/pkgconfig. There are a number of places where tweaks will need to be added, and tests should be extended to get good coverage for this issue.

Add build_ffi hook

build_ffi hook should build DLLs for FFI. It should do this as a fresh install from a fresh extract. It should install the DLLs to $dist_dir/dynamic instead of $dist_dir/lib. It should do this after the main build hook. It should be easy to make this optional.

Alien::Build::Manual::FAQ: patch example doesn't work

The patch example implies that patch is a built in, but apparently it is not:

use alienfile;

share {

    plugin Download => (
        url     => 'https://github.com/ericmandel/xpa/archive/v2.1.18.tar.gz'
    );

    patch [ '%{patch} -p1 < %{.install.patch}/v2.1.18.diffs' ];

    plugin Extract           => 'tar.gz';
    plugin 'Build::Autoconf' => ();

};

results in:

% af install --dry-run
Alien::Build> error in probe (will do a share install): No hooks registered for probe at /proj/axaf/ots/pkgs/perl-5.22/x86_64-linux_debian-7/lib/site_perl/5.22.1/Alien/Build.pm line 282.
Can't locate Alien/patch.pm in @INC (you may need to install the Alien::patch module)

Also, is there a glossary somewhere which defines what the interpolated variables are? Where is %{.install.patch}?

Plugin to override ALIEN_INSTALL_TYPE on specific aliens.

Useful in CI, as you may be testing a specific install type for the main component that you are testing, but want specific Aliens to use system. Or perhaps you want it to revert to the default logic.

This will probably require some hooks into the Alien-Build core, I don't think it is possible to purely from a plugin atm.

Plugin should be distributed separately from the AB core.

Test failure with Perl 5.10.0 + old version of Archive::Tar

prove -lvm t/alien_build_plugin_extract_archivetar.t
t/alien_build_plugin_extract_archivetar.t .. 
# Seeded srand with seed '20170712' from local date.
Unsuccessful stat on filename containing newline at t/alien_build_plugin_extract_archivetar.t line 34.
Unsuccessful stat on filename containing newline at t/alien_build_plugin_extract_archivetar.t line 40.
Unsuccessful stat on filename containing newline at t/alien_build_plugin_extract_archivetar.t line 40.
not ok 1 - archive {
    ok 1 - with extension tar {
        ok 1 - directory created
        # dir = /tmp/vF25sH4t8K/root/build_3hXt/foo-1.00
        ok 2 - configure exists
        ok 3 - foo.c exists
        1..3
    }
    not ok 2 - with extension tar.bz2 {
        # No files found for /home/ollisg/dev/Alien-Build/corpus/dist/foo-1.00.tar.bz2 at /home/ollisg/dev/Alien-Build/lib/Alien/Build/Plugin/Extract/ArchiveTar.pm line 78
        not ok 1 - directory created
        # Failed test 'directory created'
        # at t/alien_build_plugin_extract_archivetar.t line 34.
        # dir = no files extracted at /home/ollisg/dev/Alien-Build/lib/Alien/Build.pm line 991.
        not ok 2 - configure exists
        # Failed test 'configure exists'
        # at t/alien_build_plugin_extract_archivetar.t line 40.
        not ok 3 - foo.c exists
        # Failed test 'foo.c exists'
        # at t/alien_build_plugin_extract_archivetar.t line 40.
        1..3
    }
    # Failed test 'with extension tar.bz2'
    # at t/alien_build_plugin_extract_archivetar.t line 43.
    ok 3 - with extension tar.gz {
        ok 1 - directory created
        # dir = /tmp/KAHnB0ASz5/root/build_SVbs/foo-1.00
        ok 2 - configure exists
        ok 3 - foo.c exists
        1..3
    }
    1..3
}
# Failed test 'archive'
# at t/alien_build_plugin_extract_archivetar.t line 45.
1..1
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/1 subtests 

Test Summary Report
-------------------
t/alien_build_plugin_extract_archivetar.t (Wstat: 256 Tests: 1 Failed: 1)
  Failed test:  1
  Non-zero exit status: 1
Files=1, Tests=1,  0 wallclock secs ( 0.01 usr  0.01 sys +  0.13 cusr  0.01 csys =  0.16 CPU)
Result: FAIL

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.