How do I build Python 2.3.4 on OpenBSD 3.5?

"Martin v. Löwis" martin at v.loewis.de
Fri Sep 17 14:56:06 EDT 2004


Noah wrote:
> Is it more correct to say that Python does not support OpenBSD?
> It seems like the language should support the OS and not the other way around.

People usuall think that way, yes. However, in this case, it is really
the other way 'round. OpenBSD claims to implement certain
specifications required by Python, but then actually doesn't. Python
could accept systems that make no such claim, or systems that make
the claim and then fully implement the specification (POSIX in this
case). OpenBSD falls in the middle category of systems making false
or confusing claims.

> What limitations are there for Python on OpenBSD? What work-arounds does
> Python have to take? It looks like it undefines _XOPEN_SOURCE.
> Does this limit features on OpenBSD?

No, it (wrongly) exposes them. OpenBSD "honors" _XOPEN_SOURCE, but
incorrectly. If you define _XOPEN_SOURCE on OpenBSD (which one is
entitled to do on any POSIX system), then some system headers fail
to compile. It would be fine if the system headers offered less
functionality in that case, or more - in no case they should stop
to compile. Python requires that systems either totally ignore
_XOPEN_SOURCE, or honor it by reacting accordingly. Failure to
compile is not a proper reaction.

Many systems currently have the similar flaws, since nobody dares
defining _XOPEN_SOURCE. Since Python needs to define _XOPEN_SOURCE
on some systems (most notably Tru64), and it is "the right thing"
on any system claiming POSIX conformance, and should not hurt on
all other systems, Python defines it always, and exempts a few
specific systems which are known to be broken.

Some vendors have acted since and fixed their systems, e.g. Sun
with Solaris 7 and later. Others, like the OpenBSD maintainers,
unfortunately fail to do so to date.

> Should it be a bug that configure doesn't also do this for OpenBSD 3.5?
> Although Python 2.3.4 came out before OpenBSD 3.5.

Right. Furthermore, we do hope that some OpenBSD release will fix that
bug. Then, we can gradually remove the work-arounds for older BSD
releases when these systems come out of use. For that procedure,
we need to check every OpenBSD release again whether it supports
POSIX properly.

I just recently added a change to Python 2.4 so it extends the
work-around for 3.5, so Python 2.4 should build on OpenBSD 3.5
out of the box.

Regards,
Martin



More information about the Python-list mailing list