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

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

From: Branko Čibej <brane_at_apache.org>
Date: Fri, 4 Jan 2019 08:11:48 +0100

On 04.01.2019 04:33, Troy Curtis Jr wrote:
> 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

Please do! I know I've been bitten by the same helpful message, and I
know my way around the build scripts better than the average user.

> 2) My implementation

I'm (slightly) worried about SWIG_PY_ERRMSG being set in so many places,
making it easy to miss some in future changes. But I don't have a better
idea for making the message detailed enough, the way it is now.

> 3) Whether you think I should add similar functionality to the other (SWIG)
> bindings

Please do, if you have the time.

-- Brane
Received on 2019-01-04 08:11:59 CET

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.