[Vm-dev] Re: updating and compiling the BerkeleyDB plugin

Paul DeBruicker pdebruic at gmail.com
Sun Apr 12 17:34:32 UTC 2015


Hi David,

I followed your instructions and made some headway in getting the plugin
compiled. The changes are on SquaeakSource.  I think I have now hit some
errors that will necessitate making changes to the sqBerkeleyDbPlugin.c 
file in the .sar.   

Where should I save/share those changes?  

I'm ambivalent and will put it on github if you are too. 

I'm using 32 bit ubuntu 14.04.  I think the current Big problem is that the
plugin was written for BerkeleyDB version 4.???.  I've been trying to
compile it against version 6.1, because its the current stable installed by
apt-get.  Maybe the API has changed.  I'll download and try some of the 4.x
libraries to see.  

The current set of errors are pasted below.

I've got about an hour a week I want to spend on this so there is no rush on
my end for Progress.  


Thanks for taking a look 


Paul





Scanning dependencies of target BerkeleyDbPlugin
[ 77%] Building C object
BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c.o
/home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c: In
function ‘initialiseModule’:
/home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c:141:2:
warning: passing argument 1 of ‘sqDbInit’ from incompatible pointer type
[enabled by default]
  return sqDbInit(sqDbMalloc);
  ^
In file included from
/home/deploy/src/trunk/src/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.c:37:0:
/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/BerkeleyDbPlugin.h:13:5:
note: expected ‘void * (*)(size_t)’ but argument is of type ‘void *
(*)(sqInt)’
 int sqDbInit(void *(*sq_malloc)(size_t size) );
     ^
[ 80%] Building C object
BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c.o
/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:
In function ‘sqDbOpen’:
/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
warning: passing argument 2 of ‘dbp->open’ from incompatible pointer type
[enabled by default]
   DBCALL(dbp->open(dbp,fname,NULL,DB_BTREE,flags,0664); free(fname));
   ^
/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
note: expected ‘struct DB_TXN *’ but argument is of type ‘char *’
/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
warning: passing argument 4 of ‘dbp->open’ makes pointer from integer
without a cast [enabled by default]
/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
note: expected ‘const char *’ but argument is of type ‘int’
/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c:134:3:
error: too few arguments to function ‘dbp->open’
make[2]: ***
[BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/home/deploy/src/trunk/platforms/Cross/plugins/BerkeleyDbPlugin/sqBerkeleyDatabase.c.o]
Error 1
make[1]: *** [BerkeleyDbPlugin/CMakeFiles/BerkeleyDbPlugin.dir/all] Error 2
make: *** [all] Error 2





David T. Lewis wrote
> Hi Paul,
> 
> Thanks for doing this. I don't have time to really check it out right
> now, but I did load your code from the new repository and I was able
> to generate the C source with no problem (see attached).
> 
> I'll follow up on this in a few days, but at first glance it looks fine.
> 
> FYI, I'm using VMMaker trunk (load update-dtl.16.mcm), then "VMMakerTool
> forUnix"
> to open the VMM tool, then drag the BerkeleyDbPlugin from "Plugins not
> built"
> over to the "External Plugins" pane, then Generate Entire.
> 
> For platforms source, I used the sources from the original SAR and put
> the header file in platforms/Cross/plugins/BerkeleyDbPlugin/ and the C
> file in platforms/unix/plugins/BerkeleyDbPlugin/. I don't know if that's
> right, but it works for generating the C code.
> 
> Dave
> 
> 
> On Sun, Apr 05, 2015 at 08:50:36AM -0700, Paul DeBruicker wrote:
>>  
>> Hi David,
>> 
>> I made the project on SqueakSource.   The repo is here:
>> 
>> 
>> MCHttpRepository
>>     location: 'http://www.squeaksource.com/BerkeleyDB'
>>     user: ''
>>     password: ''
>> 
>> 
>> When attempting to generate the plugin as an external plugin the error
>> shown
>> in the VMMaker window is:
>> 
>> warning, variable simulator doesn't exist or has already been removed
>> failed to inline getErrorMessage: as it contains unrenamable C
>> declarations
>> or C code
>> warning, signature of InterpreterProxy>>instantiateClass:indexableSize:
>> does
>> not match reference implementation.
>> external plugin BerkeleyDbPlugin generated as BerkeleyDbPlugin
>> 5 April 2015 9:00:18 am
>> 
>> 
>> Are these warnings/errors serious?  Is the next step to get rid of them?  
>> 
>> Thanks
>> 
>> Paul
>> 
>> 
>> 
>> 
>> David T. Lewis wrote
>> > I am assuming that this is "Berkeley DB Plugin" on SqueakMap, written
>> by
>> > Stephen Pair
>> > and licensed SqueakL, and therefore OK to include in the VM.
>> > 
>> > The SAR file contains the platforms sources and some hints as to handle
>> it
>> > in a makefile.
>> > 
>> > I expect that this plugin could be brought back to life with a bit of
>> > effort.
>> > It also looks like something that might best be maintained outside of
>> > VMMaker
>> > so that the interested parties can update it as they please.
>> > 
>> > How about if we put the Smalltalk part of the plugin into a new project
>> on
>> > squeaksource.com? Paul DeBruicker, Stephen Pair, Eliot and I all have
>> > accounts
>> > on that server already, so it would be easy to put it there.
>> > 
>> > The Berkeley db library has a lot of history, and I don't know what the
>> > current
>> > runtimes would be on a modern unix/linux/osx platform. The
>> > http://www.sleepycat.com
>> > site redirects to Oracle now, which does not seem encouraging. Current
>> > licensing
>> > seems to be explained at http://en.wikipedia.org/wiki/Berkeley_DB.
>> > 
>> > Dave
>> > 
>> > On Sun, Mar 29, 2015 at 08:50:51AM -0700, Eliot Miranda wrote:
>> >> 
>> >> D'u have the smalltalk source or just the generated C code?  And I
>> what
>> >> VM build environment do you want to work?
>> >> 
>> >> Eliot (phone)
>> >> 
>> >> On Mar 29, 2015, at 7:46 AM, Paul DeBruicker <
>> 
>> > pdebruic@
>> 
>> > > wrote:
>> >> 
>> >> > 
>> >> > Hi - 
>> >> > 
>> >> > I've posted Steven Pair's  BerkeleyDB plugin .sar file to dropbox
>> here:
>> >> > 
>> >> > 
>> >> > https://dl.dropboxusercontent.com/u/4460862/BerkeleyDB.sar
>> >> > 
>> >> > 
>> >> > 
>> >> > I'd like to get it to compile (on linux...), and also to modify it
>> to
>> >> work with the LMDB (http://symas.com/mdb/). According to the LMDB docs
>> it
>> >> should be pretty straightforward to port something from BerkeleyDB.  
>> >> > 
>> >> > From examining the .sar it looks like the plugin hasn't been
>> >> edited/compiled since December 2002.  
>> >> > 
>> >> > Is there a guide for bringing old plugins up to date?  IF not what
>> >> should I expect to have to change to get it working?   
>> >> > 
>> >> > Thanks
>> >> > 
>> >> > Paul
>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context:
>> http://forum.world.st/updating-and-compiling-the-BerkeleyDB-plugin-tp4815915p4817704.html
>> Sent from the Squeak VM mailing list archive at Nabble.com.
> 
> 
> BerkeleyDbPlugin.c (20K)
> <http://forum.world.st/attachment/4817710/0/BerkeleyDbPlugin.c>





--
View this message in context: http://forum.world.st/updating-and-compiling-the-BerkeleyDB-plugin-tp4815915p4819198.html
Sent from the Squeak VM mailing list archive at Nabble.com.


More information about the Vm-dev mailing list