[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

[PATCH] RFC on providing a more meaningful error message for swig-py

From: Troy Curtis Jr <troycurtisjr_at_apache.org>
Date: Thu, 3 Jan 2019 22:33:23 -0500

Howdy guys,

One of the TODO items I put in the swig-py3 branch README is to provide a
more useful error message if the user tries to build the swig-py bindings,
but they are disabled/failed to configure. There are several failure modes
that would prevent the Python binding from building, however currently if
they are not successfully configured and the user types 'make swig-py' this
is what they get:

$ make swig-py
/usr/bin/swig
-I/home/tscurti/working/oss/subversion/swig-py3-4/py2-build/subversion
-I/home/tscurti/working/oss/subversion/swig-py3-4/py2-build/../subversion/include
-I/home/tscurti/working/oss/subversion/swig-py3-4/py2-build/../subversion/bindings/swig
-I/home/tscurti/working/oss/subversion/swig-py3-4/py2-build/../subversion/bindings/swig/include
-I/home/tscurti/working/oss/subversion/swig-py3-4/py2-build/../subversion/bindings/swig/proxy
-I/home/tscurti/working/oss/subversion/swig-py3-4/py2-build/subversion/bindings/swig/proxy
-I/usr/include/apr-1 -I/usr/include/apr-1 none -o
subversion/bindings/swig/python/svn_client.c
../subversion/bindings/swig/svn_client.i
swig error : Unrecognized option none
Use 'swig -help' for available options.
make: *** [../build-outputs.mk:286:
subversion/bindings/swig/python/svn_client.c] Error 1

Which isn't very helpful. I even kinda knew this, and it was still a
confusing message when I first tried doing a test build on the macos
BuildBot recently. (Luckily Brane dug through the log quickly and found the
issue [1].)

So instead with the attached patch you get something like:

$ make swig-py
SWIG Python bindings not configured, py3c library not found
make: *** [Makefile:924: verify-swig-py] Error 1

or for the more generic case

$ make swig-py
SWIG Python bindings not configured, check config.log for details
make: *** [Makefile:924: verify-swig-py] Error 1

I think it is clear these errors are more meaningful, but I'd like thoughts
on:

1) Whether I should bother
2) My implementation
3) Whether you think I should add similar functionality to the other (SWIG)
bindings

Proposed patch attached.

Troy

--
1: https://wilderness.apache.org/channels/?f=svn-dev/2018-12-27

Received on 2019-01-04 04:33:52 CET

This is an archived mail posted to the Subversion Dev mailing list.