BIND 10 #710: Compilation error on Python 3.2 systems
BIND 10 Development
do-not-reply at isc.org
Fri Jun 17 00:11:54 UTC 2011
#710: Compilation error on Python 3.2 systems
-------------------------------------+-------------------------------------
Reporter: shane | Owner: jinmei
Type: | Status: reviewing
defect | Milestone:
Priority: minor | Sprint-20110628
Component: build | Resolution:
system | Sensitive: 0
Keywords: | Sub-Project: DNS
Defect Severity: N/A | Estimated Difficulty: 2.0
Feature Depending on Ticket: | Total Hours: 0
Add Hours to Ticket: 0 |
Internal?: 0 |
-------------------------------------+-------------------------------------
Comment (by jinmei):
Replying to [comment:12 jelte]:
> Three commits, the most important one is the first; I've added a
configure check that checks if we need -Wno-unused-parameter to include
Python.h. If so, it is added to PYTHON_INCLUDES (not the very best place
to put it, but this way we do know it'll only be used for things that
actually use Python.h, and we don't need to add any workarounds to the
various Makefiles).
Unfortunately this doesn't (always) work. (and even if it does, I'd
probably object to abusing PYTHON_INCLUDES for this purpose:-). In my
system -Wno-something must be placed after the offending warning flag
(normally -Wall or -Wextra). I thought it's quite common, so it's
actually surprising this worked for you:-)
I committed a counter proposal to the branch: 97131f9. I also moved
the check within a g++ (and its variants) specific block in order to
not disturb other compilers that don't understand -Wxxx.
> The second fix is for a failing test (and presumably for failing code);
apparently one of the APIs changed (or rather, a default parameter in a
call), so I added an explicit str() around it.
I suspect the revised code (with Python 3.2) doesn't produce the
expected result. The problem is that (as you pointed out) in Python
3.2 xml.etree.ElementTree.tostring() always returns bytes, not a
string (it seems to be an intentional change, see
http://bugs.python.org/issue10942). But simply wrapping a bytes
object with str() results in a string in the form of "b'original
string'", so it would result in "b'<foo>bar</foo>'" etc, instead of
"<foo>bar</foo>".
Assuming my concern is correct, I made a counter proposal and
committed it (ed6ec07).
And, this makes me think it indicates tests for stats_httpd are not
sufficient. We should have a test to see if StatsHttpd.xml_handler()
produces expected results. Then (again assuming my concern is
correct) you should have been able to notice the first fix wasn't
sufficient. This is not a problem of this branch per se, but for the
original code of stats. So I suggest we create a separate ticket for
that.
> And lastly, python 3.2 now stores .pyc files in {{{__pycache__}}}
directories, which need to be removed (for distcheck, mainly). This does
update a lot of makefiles. I could not find a way to completely remove
directories through a magic automake variable, so I added CLEANDIRS and a
clean-local target in all directories containing python code.
This one looks okay. It would be nicer if we have a common template
for python Makefile.am's including this one so that we won't have to
copy-paste this block every time we create a new Makefile.am for a new
python lib/program, but for now I'm okay with it.
Finally, I think we should have at least one buildbot that uses Python
3.2. I suggest we create a separate ticket for that.
If you are okay with my changes, the only remaining point is the
missing changelog.
--
Ticket URL: <https://bind10.isc.org/ticket/710#comment:15>
BIND 10 Development <http://bind10.isc.org>
BIND 10 Development
More information about the bind10-tickets
mailing list