[GRASS-dev] GRASS 6.3.0

Glynn Clements glynn at gclements.plus.com
Sat Mar 22 03:25:43 EDT 2008


Glynn Clements wrote:

> > > Another problem with vdigit: the C++ wrapper file  
> > > grass6_wxvdigit_wrap.cpp
> > > is *not* a source file (it is built from the .i files using SWIG), and
> > > should not be stored in the SVN repository. It should be generated  
> > > by SWIG
> > > during the build process.
> > 
> > Correct or not, I'vee seen it as a convention in many projects to  
> > include pre-SWIG'd sources (ie Mapserver, Qgis, GDAL).  While  
> > developers may be OK with adding SWIG to their toolbox (though I  
> > haven't installed it on my new Mac because I don't need it any more),  
> > users who build from source may not have SWIG, and may not want to  
> > install something that's not used at runtime but only for compilation.
> 
> Even if we include the file as a convenience, the Makefile should
> still have the appropriate dependency information so that any changes
> to the .i files are handled correctly.

However, this is complicated by the fact that grass6_wxvdigit.i isn't
stored in SVN, so that file gets generated, then
grass6_wxvdigit_wrap.cpp gets regenerated from that, which may make it
out of sync with the SVN version. Also, there's no guarantee that the
local timestamps (which indicate when the files were checked out)
accurately reflect the relationships between the files.

This is one reason why you don't normally keep intermediate files in a
version-control repository. E.g. we don't keep the lex/yacc-generated
files in the repository, so users need those tools to compile.

Another reason is that developers need to sync and commit the
pre-generated versions whenever they edit the underlying .i and .h
files. Also, we'll get a lot of noise in the diffs if different
developers are using different versions of SWIG (I have 1.3.31, but
the SVN version was built with 1.3.33).

Some projects keep the configure script under version control,
although that too is technically not a source file. But the situation
for the configure script is slightly different, as:

a) Neither configure nor configure.in are mentioned in the Makefiles.

b) You can't use the Makefiles until you've run configure, which
creates a chicken-and-egg situation. E.g. you can't have the top-level
Makefile generate configure from configure.in, you can't use the
configure script to detect how to run autoconf to generate the
configure script, etc.

For now, I've removed the intermediate files, so you need SWIG to
build the vdigit module from source.

Ultimately, the SVN repository exists for development. It's likely
that the inconvenience to developers is only going to increase as the
wx GUI becomes more important (e.g. as existing XDRIVER-based programs
disappear in 7.x).

If the SWIG issues are considered problematic for end users (who build
from source), it may be worth considering including the SWIG-generated
files in source tarballs.

Note that you already need SWIG if you want to build the wrappers for
the GRASS libraries (i.e. if you want to call GRASS functions directly
from Python). I would expect this to be an issue sooner or later (I
had assumed that vdigit was already doing this, but it turns out that
only the C part calls GRASS directly).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list