Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python2.4: building '_socket' extension fails with `INET_ADD #41278

Closed
stroeder mannequin opened this issue Dec 3, 2004 · 8 comments
Closed

Python2.4: building '_socket' extension fails with `INET_ADD #41278

stroeder mannequin opened this issue Dec 3, 2004 · 8 comments
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error

Comments

@stroeder
Copy link
Mannequin

stroeder mannequin commented Dec 3, 2004

BPO 1078245
Nosy @loewis

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2010-08-26.15:23:03.540>
created_at = <Date 2004-12-03.11:16:09.000>
labels = ['extension-modules', 'type-bug']
title = "Python2.4: building '_socket' extension fails with `INET_ADD"
updated_at = <Date 2010-08-26.15:23:03.538>
user = 'https://bugs.python.org/stroeder'

bugs.python.org fields:

activity = <Date 2010-08-26.15:23:03.538>
actor = 'BreamoreBoy'
assignee = 'none'
closed = True
closed_date = <Date 2010-08-26.15:23:03.540>
closer = 'BreamoreBoy'
components = ['Extension Modules']
creation = <Date 2004-12-03.11:16:09.000>
creator = 'stroeder'
dependencies = []
files = []
hgrepos = []
issue_num = 1078245
keywords = []
message_count = 8.0
messages = ['60609', '60610', '60611', '60612', '60613', '60614', '60615', '114986']
nosy_count = 5.0
nosy_names = ['loewis', 'anthonybaxter', 'stroeder', 'ggarrett', 'BreamoreBoy']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'test needed'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1078245'
versions = ['Python 2.6']

@stroeder
Copy link
Mannequin Author

stroeder mannequin commented Dec 3, 2004

HI!

I'm trying to build Python2.4 on a rather old Debian
machine.
Building _socket fails (see below) although I tried to use

configure --disable-ipv6

I've added

#define INET_ADDRSTRLEN 16

to Modules/socketmodule.h which made it work. There
were no problems compiling Python2.2 on the very same
machine.

Ciao, Michael.

------------------------------ snip
------------------------------
building '_socket' extension
gcc -pthread -DNDEBUG -g -O3 -Wall -Wstrict-prototypes
-fPIC -I. -I/tmp/Python-2.4/./Include
-I/user/W3311/local/include -I/usr/local/include
-I/tmp/Python-2.4/Include -I/tmp/Python-2.4 -c
/tmp/Python-2.4/Modules/socketmodule.c -o build/t
emp.linux-i686-2.4/socketmodule.o
/tmp/Python-2.4/Modules/socketmodule.c: In function
socket_inet_ntop': /tmp/Python-2.4/Modules/socketmodule.c:3350: INET_ADDRSTRLEN' undeclared (first use this function)
/tmp/Python-2.4/Modules/socketmodule.c:3350: (Each
undeclared identifier is reported only once
/tmp/Python-2.4/Modules/socketmodule.c:3350: for each
function it appears in.)
/tmp/Python-2.4/Modules/socketmodule.c:3350: size of
array `ip' has non-integer type

@stroeder stroeder mannequin added extension-modules C modules in the Modules dir labels Dec 3, 2004
@anthonybaxter
Copy link
Mannequin

anthonybaxter mannequin commented Dec 13, 2004

Logged In: YES
user_id=29957

How old a debian release is this? It sounds like it's a just
a broken system header, and I'm not entirely convinced that
adding this to the already-large collection of #ifdefs in
socketmodule is a path to happiness.

@loewis
Copy link
Mannequin

loewis mannequin commented Jan 6, 2005

Logged In: YES
user_id=21627

There are already a few attempts to define ADDRSTRLEN if it
is missing. Maybe we should just merge them into one, and
define it if it is not defined, independent of the system.

@ggarrett
Copy link
Mannequin

ggarrett mannequin commented Apr 11, 2005

Logged In: YES
user_id=377412

I have the same problem on Solaris 7.

@ggarrett
Copy link
Mannequin

ggarrett mannequin commented Apr 11, 2005

Logged In: YES
user_id=377412

I got:

building '_socket' extension
gcc -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -fPIC
-fno-strict-aliasing -I. -I/opt/src/Python-2.4.1/./Include
-I/usr/local/include -I/opt/src/Python-2.4.1/Include
-I/opt/src/Python-2.4.1 -c
/opt/src/Python-2.4.1/Modules/socketmodule.c -o
build/temp.solaris-2.7-sun4u-2.4/socketmodule.o
In file included from
/opt/src/Python-2.4.1/Modules/socketmodule.c:315:
/opt/src/Python-2.4.1/Modules/getnameinfo.c: In function
fake_getnameinfo': /opt/src/Python-2.4.1/Modules/getnameinfo.c:173: warning: implicit declaration of function inet_ntop'
/opt/src/Python-2.4.1/Modules/getnameinfo.c:174: warning:
comparison between pointer and integer
/opt/src/Python-2.4.1/Modules/getnameinfo.c:206: warning:
comparison between pointer and integer
/opt/src/Python-2.4.1/Modules/socketmodule.c: In function
socket_inet_ntop': /opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error: INET_ADDRSTRLEN' undeclared (first use in this function)
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
(Each undeclared identifier is reported only once
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: error:
for each function it appears in.)
/opt/src/Python-2.4.1/Modules/socketmodule.c:3380: warning:
assignment makes pointer from integer without a cast
/opt/src/Python-2.4.1/Modules/socketmodule.c:3350: warning:
unused variable `ip'

My users then see...

# regtester.py ../ini/tester.ini main
Traceback (most recent call last):
  File "./regtester.py", line 24, in ?
    import core_engine, core_event, core_action, logger
  File "/etsi/tst/regtester.1.0.0/scripts/core_engine.py",
line 19, in ?
    import time, Queue, sched, copy, string, threading,
asyncore, socket
  File "/usr/local/lib/python2.4/asyncore.py", line 51, in ?
    import socket
  File "/usr/local/lib/python2.4/socket.py", line 45, in ?
    import _socket
ImportError: No module named _socket

I try your work-around. Doesn't help.

@loewis
Copy link
Mannequin

loewis mannequin commented Apr 11, 2005

Logged In: YES
user_id=21627

Unfortunately, non of us has Solaris 7, so there is little
chance that we are able to develop a patch. Can you provide one?

@ggarrett
Copy link
Mannequin

ggarrett mannequin commented Apr 12, 2005

Logged In: YES
user_id=377412

I'm a SysAdmin. My users (programmers) who want this
version of Python claim to have put this fix in place and it
works (on a copy I'm sure is squirreled away in someone's
home directory). Perhaps the account I'm using doesn't have
something it needs in LD_LIBRARY_PATH, etc.?

@devdanzin devdanzin mannequin added type-bug An unexpected behavior, bug, or error labels Feb 15, 2009
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Aug 26, 2010

I don't believe that this can still be a problem.

@BreamoreBoy BreamoreBoy mannequin closed this as completed Aug 26, 2010
@BreamoreBoy BreamoreBoy mannequin closed this as completed Aug 26, 2010
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
extension-modules C modules in the Modules dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

0 participants