Package: python3.2
Version: 3.2~a2-5
Severity: important
Tags: patch
User: [email protected]
Usertags: hurd
Hi,
currently[1] python3.2 does not build on GNU/Hurd.
The problems are two:
- hurd patches not applying:
attached updated/refreshed versions of patches:
- cthreads.diff
- hurd-disable-nonworking-constants.diff
- hurd-path_max.diff
- no-large-file-support.diff
- a couple more of tests which either block/crash (io, logging, socket):
patch debian.diff
[1]
https://buildd.debian.org/fetch.cgi?pkg=python3.2&arch=hurd-i386&ver=3.2%7Ea2-5&stamp=1284738710&file=log&as=raw
Thanks,
--
Pino
# DP: Remove cthreads detection
--- a/configure.in
+++ b/configure.in
@@ -2046,7 +2046,6 @@
# Templates for things AC_DEFINEd more than once.
# For a single AC_DEFINE, no template is needed.
-AH_TEMPLATE(C_THREADS,[Define if you have the Mach cthreads package])
AH_TEMPLATE(_REENTRANT,
[Define to force use of thread-safe errno, h_errno, and other functions])
AH_TEMPLATE(WITH_THREAD,
@@ -2128,17 +2127,6 @@
AC_MSG_RESULT($unistd_defines_pthreads)
AC_DEFINE(_REENTRANT)
- AC_CHECK_HEADER(cthreads.h, [AC_DEFINE(WITH_THREAD)
- AC_DEFINE(C_THREADS)
- AC_DEFINE(HURD_C_THREADS, 1,
- [Define if you are using Mach cthreads directly under /include])
- LIBS="$LIBS -lthreads"
- THREADOBJ="Python/thread.o"],[
- AC_CHECK_HEADER(mach/cthreads.h, [AC_DEFINE(WITH_THREAD)
- AC_DEFINE(C_THREADS)
- AC_DEFINE(MACH_C_THREADS, 1,
- [Define if you are using Mach cthreads under mach /])
- THREADOBJ="Python/thread.o"],[
# Just looking for pthread_create in libpthread is not enough:
# on HP/UX, pthread.h renames pthread_create to a different symbol name.
# So we really have to include pthread.h, and then link.
@@ -2174,7 +2162,7 @@
LIBS="$LIBS -lcma"
THREADOBJ="Python/thread.o"],[
USE_THREAD_MODULE="#"])
- ])])])])])])])
+ ])])])])])
AC_CHECK_LIB(mpc, usconfig, [AC_DEFINE(WITH_THREAD)
LIBS="$LIBS -lmpc"
# DP: Comment out constant exposed on the API which are not implemented on
# DP: GNU/Hurd. They would not work at runtime anyway.
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -8152,12 +8152,14 @@
#ifdef O_LARGEFILE
if (ins(d, "O_LARGEFILE", (long)O_LARGEFILE)) return -1;
#endif
+#ifndef __GNU__
#ifdef O_SHLOCK
if (ins(d, "O_SHLOCK", (long)O_SHLOCK)) return -1;
#endif
#ifdef O_EXLOCK
if (ins(d, "O_EXLOCK", (long)O_EXLOCK)) return -1;
#endif
+#endif
/* MS Windows */
#ifdef O_NOINHERIT
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -4553,9 +4553,11 @@
#ifdef SO_OOBINLINE
PyModule_AddIntConstant(m, "SO_OOBINLINE", SO_OOBINLINE);
#endif
+#ifndef __GNU__
#ifdef SO_REUSEPORT
PyModule_AddIntConstant(m, "SO_REUSEPORT", SO_REUSEPORT);
#endif
+#endif
#ifdef SO_SNDBUF
PyModule_AddIntConstant(m, "SO_SNDBUF", SO_SNDBUF);
#endif
# DP: Replace PATH_MAX with MAXPATHLEN.
--- a/Modules/getpath.c
+++ b/Modules/getpath.c
@@ -161,8 +161,8 @@
static wchar_t*
_wgetcwd(wchar_t *buf, size_t size)
{
- char fname[PATH_MAX];
- if (getcwd(fname, PATH_MAX) == NULL)
+ char fname[MAXPATHLEN];
+ if (getcwd(fname, MAXPATHLEN) == NULL)
return NULL;
if (mbstowcs(buf, fname, size) >= size) {
errno = ERANGE;
@@ -176,18 +176,18 @@
int
_Py_wreadlink(const wchar_t *path, wchar_t *buf, size_t bufsiz)
{
- char cbuf[PATH_MAX];
- char cpath[PATH_MAX];
+ char cbuf[MAXPATHLEN];
+ char cpath[MAXPATHLEN];
int res;
- size_t r1 = wcstombs(cpath, path, PATH_MAX);
- if (r1 == (size_t)-1 || r1 >= PATH_MAX) {
+ size_t r1 = wcstombs(cpath, path, MAXPATHLEN);
+ if (r1 == (size_t)-1 || r1 >= MAXPATHLEN) {
errno = EINVAL;
return -1;
}
- res = (int)readlink(cpath, cbuf, PATH_MAX);
+ res = (int)readlink(cpath, cbuf, MAXPATHLEN);
if (res == -1)
return -1;
- if (res == PATH_MAX) {
+ if (res == MAXPATHLEN) {
errno = EINVAL;
return -1;
}
--- a/Modules/main.c
+++ b/Modules/main.c
@@ -656,9 +656,9 @@
if (sts==-1 && filename!=NULL) {
if ((fp = _Py_wfopen(filename, L"r")) == NULL) {
- char cfilename[PATH_MAX];
- size_t r = wcstombs(cfilename, filename, PATH_MAX);
- if (r == PATH_MAX)
+ char cfilename[MAXPATHLEN];
+ size_t r = wcstombs(cfilename, filename, MAXPATHLEN);
+ if (r == MAXPATHLEN)
/* cfilename is not null-terminated;
* forcefully null-terminating it
* might break the shift state */
--- a/Python/pythonrun.c
+++ b/Python/pythonrun.c
@@ -673,7 +673,7 @@
}
static wchar_t *default_home = NULL;
-static wchar_t env_home[PATH_MAX+1];
+static wchar_t env_home[MAXPATHLEN+1];
void
Py_SetPythonHome(wchar_t *home)
@@ -688,8 +688,8 @@
if (home == NULL && !Py_IgnoreEnvironmentFlag) {
char* chome = Py_GETENV("PYTHONHOME");
if (chome) {
- size_t r = mbstowcs(env_home, chome, PATH_MAX+1);
- if (r != (size_t)-1 && r <= PATH_MAX)
+ size_t r = mbstowcs(env_home, chome, MAXPATHLEN+1);
+ if (r != (size_t)-1 && r <= MAXPATHLEN)
home = env_home;
}
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1667,20 +1667,20 @@
static wchar_t*
_wrealpath(const wchar_t *path, wchar_t *resolved_path)
{
- char cpath[PATH_MAX];
- char cresolved_path[PATH_MAX];
+ char cpath[MAXPATHLEN];
+ char cresolved_path[MAXPATHLEN];
char *res;
size_t r;
- r = wcstombs(cpath, path, PATH_MAX);
- if (r == (size_t)-1 || r >= PATH_MAX) {
+ r = wcstombs(cpath, path, MAXPATHLEN);
+ if (r == (size_t)-1 || r >= MAXPATHLEN) {
errno = EINVAL;
return NULL;
}
res = realpath(cpath, cresolved_path);
if (res == NULL)
return NULL;
- r = mbstowcs(resolved_path, cresolved_path, PATH_MAX);
- if (r == (size_t)-1 || r >= PATH_MAX) {
+ r = mbstowcs(resolved_path, cresolved_path, MAXPATHLEN);
+ if (r == (size_t)-1 || r >= MAXPATHLEN) {
errno = EINVAL;
return NULL;
}
# DP: disable large file support for GNU/Hurd
--- a/configure.in
+++ b/configure.in
@@ -1402,6 +1402,9 @@
use_lfs=no
fi
+# Don't use largefile support anyway.
+use_lfs=no
+
if test "$use_lfs" = "yes"; then
# Two defines needed to enable largefile support on various platforms
# These may affect some typedefs
--- a/debian/rules
+++ b/debian/rules
@@ -360,7 +360,7 @@
TEST_EXCLUDES += test_gdb
endif
ifneq (,$(filter $(DEB_HOST_ARCH), hurd-i386))
- TEST_EXCLUDES += test_imaplib test_random test_signal test_socketserver
test_ssl test_threading
+ TEST_EXCLUDES += test_imaplib test_io test_logging test_random test_signal
test_socket test_socketserver test_ssl test_threading
endif
ifneq (,$(TEST_EXCLUDES))
TESTOPTS += -x $(sort $(TEST_EXCLUDES))