[GRASS-dev] 6.4.0 blocker bugs

Glynn Clements glynn at gclements.plus.com
Wed Aug 11 15:10:10 EDT 2010


Markus Neteler wrote:

> >> > I'd like to just make one final request to remove the swig directory
> >> > before release. Otherwise, people will try and use it.
> 
> Good point.
> 
> >> I would vote for it. The wxGUI vdigit and nviz has been disabled,
> >> there is nothing which uses swig.
> >
> > Even if they were enabled, vdigit and (the SWIG-based version of) nviz
> > don't use anything from the swig directory.
> 
> I see that the ctypes backport consists of two commits:
> http://trac.osgeo.org/grass/changeset/42916
> http://trac.osgeo.org/grass/changeset/43015

Please bear in mind that removing the SWIG wrappers and adding the
ctypes wrappers are entirely orthogonal. As nothing (except for the
new nviz module, which isn't in 6.4) depends upon either, removing the
swig directory doesn't imply backporting the ctypes wrappers.

1. The swig directory uses SWIG to generate Python binding for the
GRASS libraries. Nothing in GRASS uses these; the intent was to allow
add-ons to be written in Python.

2. The lib/python/ctypes directory also generates Python bindings for
the GRASS libraries. Whereas SWIG-based bindings consist of a binary
module plus a Python module, ctypes-based bindings consist only of
Python modules which use the ctypes module in the Python standard
library (in Python 2.5 and later; ctypes was available as an add-on
module for 2.4). Nothing in 6.4 uses this, and the intent is to allow
add-ons to be written in Python.

3. The wx GUI's vdigit and nviz modules consist of a mix of C++ and
Python, and use SWIG to generate the Python bindings for their C++
component. They do not use the bindings for the GRASS libraries from
the swig directory. They do require the swig program to be installed,
and GRASS to be configured --with-python.

4. The new nviz module in 6.5 and 7.0 (but not 6.4) no longer has a
C++ component. Instead, it's written entirely in Python, using the
ctypes-based bindings for the nviz and ogsf libraries. Nothing else in
GRASS (and nothing at all in 6.4) uses the ctypes bindings.

IOW: the swig directory can be removed without affecting any other
part of GRASS, including the vdigit/nviz modules. The configure checks
relating to SWIG (i.e. --with-python) and the requirement for the swig
program relate to the vdigit and (6.4) nviz modules. lib/python/ctypes
is only required for the ctypes-based nviz module in 6.4/7.0, or if we
want to offer the ctypes-based bindings for use by add-ons.

So, there's no need to delay 6.4.0 for ctypes. We can add it in 6.4.1,
or even make a separate package which works with 6.4.0 (so long as we
don't change the API, we would just need to ensure that grass.py
contains the correct definition for GIS_H_VERSION so that G_gisinit()
works).

But if we release 6.4.0 with the swig directory in place, we'll still
be getting questions about it (that we probably won't be able to
answer) in ten years time.

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


More information about the grass-dev mailing list