[Patches] [ python-Patches-617906 ] Build Error on Systems Without IPv6 Supp

noreply@sourceforge.net noreply@sourceforge.net
Fri, 04 Oct 2002 14:14:17 -0700


Patches item #617906, was opened at 2002-10-03 06:20
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=617906&group_id=5470

Category: Build
Group: Python 2.2.x
Status: Closed
Resolution: Rejected
Priority: 5
Submitted By: Kurt B. Kaiser (kbk)
Assigned to: Nobody/Anonymous (nobody)
Summary: Build Error on Systems Without IPv6 Supp

Initial Comment:
The problem was discovered installing 2.2.1
from the src.rpm on a Redhat 6.2 system
which does not have IPv6 support.

The 17 Sept 02 revision of python-2.2.spec
(2.2.1-2) defaults to building Python with the
configure switch --enable-ipv6=yes.

An AC_ARG_ENABLE macro in configure.in
sets ENABLE_IPV6 if the config switch is set,
without checking whether the system has the
resources to build and run IPv6.  This forces a
compile with IPV6 support which fails on my
system.  Python then ends up without any 
socket support since .../lib-dynload/_socket.so
is missing.

Among other problems, this AC_ARG_ENABLE
logic re-exposes Bug 454493.

For clarity, the patch is provided in three stages,
meant to be applied in sequence:

1. configure.in.patch1 supplies the minimum to 
move the AF_INET6 and RFC2553 tests out of
the ACTION_IF_NOT_GIVEN section of the
macro.  A default of no IPv6 support is supplied.

2. configure.in.patch2 integrates the stack type
and IPv6 library presence tests into the logic
which sets ENABLE_IPV6.  Trace messages are
added to the test for IPv6 library presence.  The
logic is changed so that the build will default to 
IPv4 instead of exiting the configuration process
if the IPv6 library is not found.  IPv6 support is
compiled only if the system passes all the tests.
Finally, some comments in the stack type check are
changed to allow them to appear in configure as
well as configure.in.

3. configure.in.patch3 does whitespace normalization
for this section of configure.in.

This patch may solve the problem raised in Bug 
553000; I experienced shell errors testing the various
paths through the stack type check / library check 
until I quoted the shell variables in the library check.

----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2002-10-04 23:14

Message:
Logged In: YES 
user_id=21627

Unless you can demonstrate a real bug, I won't accept any
patches for Python 2.2; this is for bug fixes only.

For Python 2.3, there is an entirely different story.
Patches are fine, if:
- they are against the Python CVS
- they are accompanied of a rationale explaining the problem
they intend to fix, or the feature they intend to introduce,
- are minimal in this respect: one patch at a time, which
only solves the demonstrated problem, or only provides a
single feature.

For your proposed change: 

1. I believe this is already the case; IPv6 *is* the default
if nothing is specified, and an IPv6 library is detected.

2. I would not like such a change: there is always a chance
that the C library will support the API nicely, but
configure fails to foresee that it will work out. On such a
system, users need a way to try out IPv6.

I have real difficulties to understand your changes, and I
don't want to guess for 2.2. If you are unhappy with that,
we can certainly reopen this patch, so another reviewer can
look at it.

----------------------------------------------------------------------

Comment By: Kurt B. Kaiser (kbk)
Date: 2002-10-04 22:32

Message:
Logged In: YES 
user_id=149084

Well, I'm disappointed that you are rejecting the patch
completely.  It does more than just tighten up the
enable-ipv6 logic.  Among other things, there are additional
configure messages and I believe a bug in the library
presence check code has been fixed.

What would you say if I were to update it with the following
changes?

1. Make configuring IPv6 the default when the switch is
absent.

2. Exit from the configure script if 
--enable-ipv6=yes but the four tests don't all run 
successfully.


----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-10-04 08:39

Message:
Logged In: YES 
user_id=21627

I see, so it fails because you have glibc 2.1. Then this is
clearly an error in the spec file; there is no need to pass
--enable-ipv6 on Linux.

There are various other cases where configure exits, e.g.
when computation of sizes of builtin types fails, or if
relative paths are specified for --prefix etc. They are just
less likely to happen.

Sean Reifschneider will update the .spec file in this
matter, so I'll reject the patch.



----------------------------------------------------------------------

Comment By: Kurt B. Kaiser (kbk)
Date: 2002-10-03 22:58

Message:
Logged In: YES 
user_id=149084

> Can you please elaborate on how precisely the build
> fails on your system, and precisely what software you
> are using (operating system, C library)?

Linux float.attbi.com 2.2.5-15

RH 6.2(+)

glibc-2.1.3-23
glibc-devel-2.1.3-23

[kbk@float ~]$ rpm -qi python2
Name        : python2                      Relocations: /usr
Version     : 2.2.1                             Vendor: (none)
Release     : 2                             Build Date: Sat Sep 28 01:11:35 2002
Install date: Sat Sep 28 01:41:58 2002      Build Host: float.attbi.com
Group       : Development/Languages         Source RPM: 
python2-2.2.1-2.src.rpm

Excerpt from the build log:
==================
checking for usconfig in -lmpc... no
checking for thr_create in -lthread... no
checking if --enable-ipv6 is specified... yes
checking ipv6 stack type... linux-glibc
checking for --with-cycle-gc... yes
checking for --with-pymalloc... no
[...]
building '_socket' extension
/usr/local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c: In 
function `make\sockaddr':
/usr/local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c:733: 
structure has\ no member named `sin6_scope_id'
/usr/local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c: In 
function `gets\ockaddrarg':
/usr/local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c:846: 
structure has\ no member named `sin6_scope_id'
/usr/local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c: In 
function `PySo\cket_getnameinfo':
/usr/local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c:2598: 
structure ha\s no member named `sin6_scope_id'
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC 
-DUSE_SSL=1 -I. -I/usr/loca\l/src/rpm/BUILD/Python-2.2.1/./Include 
-I/usr/local/include -IInclude/ -c 
/usr/\local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c -o 
build/temp.linux-i68\6-2.2/socketmodule.o
WARNING: building of extension "_socket" failed: command 'gcc' failed 
with exit\ status 1
===================

** Because the .spec sets the --enable-ipv6 the AF_INET6
and RFC2553 tests were skipped.  _socket.so was not
created, but the build continued with no socket support
at all.

** If I run ./configure --enable-ipv6=no
_socket.so is built as follows:
======================
building '_socket' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC 
-DUSE_SSL=1 -I. -I/usr/loca\l/src/rpm/BUILD/Python-2.2.1/./Include 
-I/usr/local/include -IInclude/ -c 
/usr/\local/src/rpm/BUILD/Python-2.2.1/Modules/socketmodule.c -o 
build/temp.linux-i68\6-2.2/socketmodule.o
gcc -shared build/temp.linux-i686-2.2/socketmodule.o -L/usr/local/lib 
-lssl -lc\rypto -o build/lib.linux-i686-2.2/_socket.so
==========================

** If I run ./configure with no switch, I get the same.
The AF_INET6 test fails (silently) and I get IPv4.

> It is the fallback to ignore the option that bothers
> me. The current configure is designed to stop the
> build process if a command line option has been
> provided, yet the requested feature cannot be
> activated.

I see what you're saying.  OTOH, it appears that the
IPv6 configuration is the only part of configure that
will terminate the configure script if a test fails.
(buggygetaddrinfo also exits on failure).  If this is
really desired, one could insert an exit in the
AC_MSG_CHECKING(if IPv6 can be configured) code if
ipv6=0 (one of the four tests failed) _and_ the switch
was enabled.

> Errors should never pass silently.  Unless explicitly
> silenced.

I'm not sure the user knows that he is silencing any
errors.  The configure --help merely states that
--enable-ipv6=yes will enable IPv6, not that any tests
will be bypassed.

> If you don't want IPv6 support, build with
> --disable-ipv6.

yes

> If you don't care, build with no option.

yes

> If you absolutely must have IPv6, configure with
> --enable-ipv6.

except that you can't have it if you don't have the
libraries and runtime support.  (Unless there is
something going on here that I don't know about :)

Sorry this is so long but you asked :-)

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-10-03 21:12

Message:
Logged In: YES 
user_id=21627

Can you please elaborate on how precisely the build fails on
your system, and precisely what software you are using
(operating system, C library)?

It is the fallback to ignore the option that bothers me. The
current configure is designed to stop the build process if a
command line option has been provided, yet the requested
feature cannot be activated.

Errors should never pass silently.
Unless explicitly silenced.

If you don't want IPv6 support, build with --disable-ipv6.
If you don't care, build with no option. If you absolutely
must have IPv6, configure with --enable-ipv6. Seems logical
to me.

----------------------------------------------------------------------

Comment By: Kurt B. Kaiser (kbk)
Date: 2002-10-03 20:38

Message:
Logged In: YES 
user_id=149084

Why have configure force a build which is going to
fail, or lack runtime support?  I guess I'm missing
something here :-\

Is the main reason for the switch to provide a way to
disable IPv6, or is there also a reason to override the
AF_INET6 and RFC2553 tests?

The patch ensures that those two tests are run even if
the switch is explicitly set, informs the user what
the problem is if for some reason the requested IPv6
support cannot be supplied, and provides a graceful
fall-back to IPv4.

Looking at this again, the current default if no switch
is supplied is to attempt to configure IPv6.  I chose
no IPv6 support; I can provide an updated patch.


The spec	file is from the current 2.2.1 src.rpm

http://www.python.org/2.2.1/rpms.html

and Python Patch 611191.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2002-10-03 17:53

Message:
Logged In: YES 
user_id=21627

I fail to see the bug being fixed. An explicit --enable-ipv6
is meant to request explicitly request IPv6 support,
overriding the automatic test that happens if you don't
provide an option.

So the right solution appears to be to change the spec file.
I don't know where you got that spec file from, so I can't
help here.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=617906&group_id=5470