[GRASS-dev] [GRASS GIS] #2842: configure fails to detect missing HTMLParser

#2842: configure fails to detect missing HTMLParser
-------------------------+-------------------------
Reporter: marisn | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.1.0
Component: Compiling | Version: svn-trunk
Keywords: | CPU: Unspecified
Platform: Unspecified |
-------------------------+-------------------------
Seems that Python module HTMLParser is a requirement to compile GRASS 7
trunk. Still configure part will give no warning if it is missing. If it
is required, it should be tested during configure phase. If it is
optional, compilation should not fail in case of its absence.

Example of failure message:
{{{
if [ "pngdriver" != "" -a -f "pngdriver".html ] ; then make html ; fi
make[1]: Entering directory '/home/maris/soft/grass_trunk/lib/pngdriver'
VERSION_NUMBER=7.1.svn /home/maris/soft/grass_trunk/dist.x86_64-pc-linux-
gnu/tools/g.html2man.py /home/maris/soft/grass_trunk/dist.x86_64-pc-linux-
gnu/docs/html/pngdriver.html /home/maris/soft/grass_trunk/dist.x86_64-pc-
linux-gnu/docs/man/man1/pngdriver.1
Traceback (most recent call last):
   File "/home/maris/soft/grass_trunk/dist.x86_64-pc-linux-
gnu/tools/g.html2man.py", line 4, in <module>
     from html import HTMLParser, HTMLParseError
   File "/home/maris/soft/grass_trunk/dist.x86_64-pc-linux-
gnu/tools/html.py", line 4, in <module>
     import HTMLParser as base
ImportError: No module named 'HTMLParser'
../../include/Make/Html.make:11: recipe for target
'/home/maris/soft/grass_trunk/dist.x86_64-pc-linux-
gnu/docs/man/man1/pngdriver.1' failed
make[1]: *** [/home/maris/soft/grass_trunk/dist.x86_64-pc-linux-
gnu/docs/man/man1/pngdriver.1] Error 1
make[1]: Leaving directory '/home/maris/soft/grass_trunk/lib/pngdriver'
../../include/Make/Lib.make:26: recipe for target 'lib' failed
make: *** [lib] Error 2
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2842&gt;
GRASS GIS <https://grass.osgeo.org>

#2842: configure fails to detect missing HTMLParser
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.1.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by neteler):

If problem or not seems to depend on the distro - which one do you use?

E.g., in Fedora no such issue:
{{{
rpm -qf /usr/lib64/python2.7/HTMLParser.py
python-libs-2.7.10-8.fc23.x86_64
}}}

Here it is part of the standard Python library package.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2842#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#2842: configure fails to detect missing HTMLParser
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.1.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by marisn):

Replying to [comment:1 neteler]:
> Here it is part of the standard Python library package.
Thanks, Markus, for heads-up. The module has been renamed in Python 3,
thus I worked around by setting a different python interpreter before
compilation.

Still the issue is valid - configure step should check build time
dependencies and fail if they are not met. It is done for C, C++ - why
Python should be different?

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/2842#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#2842: configure fails to detect missing HTMLParser
--------------------------+-------------------------
  Reporter: marisn | Owner: grass-dev@…
      Type: defect | Status: new
  Priority: normal | Milestone: 7.1.0
Component: Compiling | Version: svn-trunk
Resolution: | Keywords:
       CPU: Unspecified | Platform: Unspecified
--------------------------+-------------------------

Comment (by glynn):

Replying to [comment:2 marisn]:

> Still the issue is valid - configure step should check build time
dependencies and fail if they are not met. It is done for C, C++ - why
Python should be different?

For C/C++, the checks are often part of a more significant process, i.e.
ensuring that the necessary parameters are stored in Platform.make,
config.h, etc. That has to be done in order for the build to work, even
when everything is in order. The fact that you get an error if something
is wrong is almost a side-effect.

At present, we don't even check whether Python is installed. For C, the
relevant compiler checks are part of autoconf (AC_PROG_CC); there isn't an
equivalent for Python. With Python 3 becoming more common, it may be
worthwhile checking for Python 2.x specifically.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/2842#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>