code in cvs is broken

Bill Gribble grib@linuxdevel.com
14 Nov 2001 07:57:14 -0600


On Tue, 2001-11-13 at 23:33, Linas Vepstas wrote:
> There is no gw-gnc.h that I can find, and gw-gnc-module.h doesn't seem
> to do the trick.   I presume there's some valid excuse for having 
> code in CVS that won't compile ??

I checked in a slightly less cheesy version of your fix, which smoothes
things over for the time being, but it bears discussing what the problem
actually was, why we got into that state, and what's going on overall. 

The proximate problem was one of compile ordering and mutual
dependencies.  The gw-gnc.{c,h} files are generated during the build of
libgw-gnc.la, the "miscellaneous g-wrap bindings" module.  libgw-gnc.la
g-wraps a lot of the Gnome dialogs and other functions from
libgncgnome.la.  In order for Guile to know it must load libgncgnome.la
along with libgw-gnc.la, we link libgncgnome.la into libgw-gnc.la at
link time. 

That means libgncgnome.la has to be built before libgw-gnc.la. However,
top-level.c included gw-gnc.h, meaning that libgw-gnc.la has to be built
before libgncgnome.la.... AAAH!

In this case, the simplest solution is just to remove the #include of
gw-gnc.h from top-level.c ... it's not needed any more.  But this
problem is likely to come up more in the next few weeks, as we get
closer to completing the project that got all this started: the move
from the Gnucash executable being a C program to it being a Scheme
script. 

This means that there's no big climactic link step to resolve all the
symbols that point hither and thither between .c files.  We have to
break cycles of mutual dependency and structure the individual modules
so that they can be linked into completely-resolved libraries, so that
we can open them with dlopen and get all the necessary symbols.  

As you found out, the failure mode of this kind of development is the
state where you can recompile a previously-compiled tree but can't
compile from 'make clean'.  I think people should be frequently
rebuilding from make clean as a test, but practically, there are going
to be some times when things get checked in that won't compile from make
clean.  So report them for sure but don't be too surprised when they
crop up. 

b.g.