Opened 8 years ago

Last modified 6 years ago

#2842 new defect

configure fails to detect missing HTMLParser

Reported by: marisn Owned by: grass-dev@…
Priority: normal Milestone: 7.2.4
Component: Compiling Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

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

Change History (9)

comment:1 by neteler, 8 years ago

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.

in reply to:  1 ; comment:2 by marisn, 8 years ago

Replying to 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?

in reply to:  2 comment:3 by glynn, 8 years ago

Replying to 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.

comment:4 by neteler, 8 years ago

Milestone: 7.1.07.2.0

Milestone renamed

comment:5 by neteler, 7 years ago

Milestone: 7.2.07.2.1

Ticket retargeted after milestone closed

comment:6 by martinl, 7 years ago

Milestone: 7.2.17.2.2

comment:7 by neteler, 7 years ago

Milestone: 7.2.27.2.3

Ticket retargeted after milestone closed

comment:8 by martinl, 6 years ago

Milestone: 7.2.3

Ticket retargeted after milestone closed

comment:9 by martinl, 6 years ago

Milestone: 7.2.4
Note: See TracTickets for help on using tickets.