Ariel Scolnicov wrote:
>
> Brian Ingerson <[EMAIL PROTECTED]> writes:
>
> [...]
>
> > 2) The second problem is a little stickier and is the real subject of
> > this tome :) I think that the MD5 keys (the long hex numbers) that are
> > currently mangled in the shared object names, should be removed and
> > placed elsewhere. This would allow a script called 'beebop.pl' to have a
> > shared object called 'beebop.so' instead of
> > 'main_C_beebop_pl_6e7142e1724ddd37c76e8d76925ff60a.so' and it would be
> > installed as './blib_I/lib/auto/beebop/beebop.so' instead of
> >
>'./blib_I/lib/perl5/site_perl/5.005/i586-linux/auto/main_C_beebop_pl_6e7142e1724ddd37c76e8d76925ff60a/main_C_beebop_pl_6e7142e1724ddd37c76e8d76925ff60a.so'
> > My idea is to put all the extra verification information in a sister
> > file called './blib_I/lib/auto/beebop/beebop.inline'.
>
> You can keep versioning information like this *inside* the .so file.
> Just add another Perl-wrapped function which gives the *version* of
> the module. Here, "version" is your beautiful MD5 digest, not a real
> number. Inline can load the module and test the stored MD5 digest
> against the computed MD5 digest; then it can do the usual thing.
Ariel,
This seems like a good idea, and indeed it is the method I originally
pondered a couple of months ago. Unfortunately it has some pitfalls.
Here are the reasons I chose not to follow this path:
The first one is technical. If you load a module and the MD5 is wrong,
how do you unload that module, before loading the new one? I don't know
of a DynaUnloader module. Even if you could overlay the new module, it
might open the door to weird problems. And the solution needs to be
cross-platform as well.
The second reason is more general. Inline has been set up to check for a
'build requirement' before calling the language specific build()
function. In 'C' this is a '.so' file (or '.dll' on MSWin32) which has
the proper MD5. But in python this is a '.pydat' file. The language
author can choose whatever file type she wants. Since '.pydat' is not an
executable file at all, I can't put a MD5() method in it. I want to
provide a general solution for all language authors.
The third reason is KISS. The '.inline' method is trivial to implement
and easy to extend. All the data would be in clear text, which makes for
easier debugging. It also provides a little 'brochure' for the
extension. It might look like this:
MD5=6e7142e1724ddd37c76e8d76925ff60a
EXT_NAME=Jazz.so
PACKAGE=Jazz
SOURCE_LANGUAGE=C
COMPILE_TIME=Jan 9 11:27
CREATOR=ingy
CONFIG_OPTIONS {
LIBS='-lfoo'
}
BOUND_FUNCTIONS {
int bebop(char* x)
void swing(int i, ...)
}
REALM=Perl
ARCHNAME=i686-linux-thread-multi
>
> I could probably hack a demo of this over the weekend. Let me know if
> you think it's a good idea & want to go this way.
So I probably wouldn't pursue it. But I'm always grateful to see someone
who wants to help out. If you want to work on any of the other patches
from my wishlist, let me know.
Thanks again, Brian
> The chief advantages I can see are that you keep everything to a
> single file, and that it's a possible hook for future compatibility
> tests (again, without adding a file).
BTW, I see nothing wrong with adding a new file type to the Perl
'site/lib' tree. There are already several other file types besides
'.so'. There are '.bs', '.al', '.ix', '.packlist', etc. '.inline' seems
like a good addition :)
> Ariel Scolnicov |"GCAAGAATTGAACTGTAG" | [EMAIL PROTECTED]
> Compugen Ltd. |Tel: +972-2-5713025 (Jerusalem) \ We recycle all our Hz
> 72 Pinhas Rosen St. |Tel: +972-3-7658117 (Main office)`---------------------
> Tel-Aviv 69512, ISRAEL |Fax: +972-3-7658555 http://3w.compugen.co.il/~ariels