Alien packages for FFCall and libffi

29 views
Skip to first unread message

David Mertens

unread,
Apr 20, 2012, 7:11:28 PM4/20/12
to Reini Urban, perl-c...@googlegroups.com, Ryan Jendoubi, Gaal Yahas, Anatoly Vorobey, shl...@shlomifish.org, Joel Berger
Hey everybody -

Based on Joel Berger's excellent (and still developing) work on Alien::Base, I've written Alien packages for FFCall and libffi. They include some basic docs and a few tests (of the C libraries directly; not Perl-level tests). You can see my work here:

http://github.com/run4flat/Alien-FFI
http://github.com/run4flat/Alien-FFCall

To see how to use these sorts of modules, you can see how I modified FFI's code in my branch here:
http://github.com/run4flat/perl-FFI
The commit history is particularly useful:
https://github.com/run4flat/perl-FFI/commits/master

I would *really* like something to hit CPAN soon so that I can release my Perl-TCC bindings. Those bindings will only really be useful when the wrappers for one of these libraries is available, so any and all work that you could bring to this would be greatly appreciated. With my modifications, FFI is basically ready to be wrapped into v1.05 and pushed to CPAN. I have not looked closely at the Ctypes work, though I would ultimately like to use that as it seems to be more robust.

:-D

David

--
 "Debugging is twice as hard as writing the code in the first place.
  Therefore, if you write the code as cleverly as possible, you are,
  by definition, not smart enough to debug it." -- Brian Kernighan

David Mertens

unread,
Apr 21, 2012, 1:57:16 PM4/21/12
to Reini Urban, perl-c...@googlegroups.com, Ryan Jendoubi, Gaal Yahas, Anatoly Vorobey, shl...@shlomifish.org, Joel Berger
So... I may have spoken a bit too soon. :-)

Joel's work on Alien::Base is still progressing. It works partly on Ubuntu machines, though my tests with FFI.pm's modifications indicate that not everything is ironed out. It does not look so promising for Windows machines, and 64 bit architectures seem to give trouble as well. The obvious next step is to get some simple packages out there that use the infrastructure so Joel can get more feedback.

I propose that we push a developer's release for FFI.pm (say, v1.05_01) to CPAN with my latest changes to the build setup. This will hopefully give Joel some good feedback on what needs to happen with Alien::Base.

Reini Urban

unread,
Apr 24, 2012, 11:27:58 AM4/24/12
to David Mertens, perl-c...@googlegroups.com, Ryan Jendoubi, Gaal Yahas, Anatoly Vorobey, shl...@shlomifish.org, Joel Berger
On Sat, Apr 21, 2012 at 12:57 PM, David Mertens
<dcmerte...@gmail.com> wrote:
> So... I may have spoken a bit too soon. :-)

$ perl Build.PL
Can't locate Alien/Base/ModuleBuild.pm in @INC (@INC contains:
/usr/local/lib/perl5/site_perl/5.14.2/x86_64-linux
/usr/local/lib/perl5/site_perl/5.14.2
/usr/local/lib/perl5/5.14.2/x86_64-linux /usr/local/lib/perl5/5.14.2
.) at Build.PL line 4.
BEGIN failed--compilation aborted at Build.PL line 4.

I hate Module::Build, but obviously there is not even a simple prereq
check in Build.PL.
I'd love to have Alien::FFI as prereq for CTypes, sure.

> Joel's work on Alien::Base is still progressing. It works partly on Ubuntu
> machines, though my tests with FFI.pm's modifications indicate that not
> everything is ironed out. It does not look so promising for Windows
> machines, and 64 bit architectures seem to give trouble as well. The obvious
> next step is to get some simple packages out there that use the
> infrastructure so Joel can get more feedback.
>
> I propose that we push a developer's release for FFI.pm (say, v1.05_01) to
> CPAN with my latest changes to the build setup. This will hopefully give
> Joel some good feedback on what needs to happen with Alien::Base.

--
Reini Urban
http://cpanel.net/   http://www.perl-compiler.org/

David Mertens

unread,
Apr 24, 2012, 11:41:06 AM4/24/12
to Reini Urban, Reini Urban, perl-c...@googlegroups.com, Ryan Jendoubi, Gaal Yahas, Anatoly Vorobey, shl...@shlomifish.org, Joel Berger
Reini,

Sorry, Alien::Base is a build prerequisite. It's marked as a prereqs_require, but that does no good when you're working from source instead of CPAN. I suppose a check and an informative message would be more helpful. I'll get right on that.

At any rate, hold off on testing this module. Alien::Base wasn't working quite right until some very recent dev work, which has yet to hit CPAN. Once that's up, I'll send out another email.

David

P.S. Your x-ray email inbox is full. You should probably not send mail from there until you've cleared it out, otherwise messages sent via "Reply" won't reach you.
Reply all
Reply to author
Forward
0 new messages