From owner-freebsd-ports-bugs@freebsd.org Sun Apr 3 17:49:45 2016 Return-Path: Delivered-To: freebsd-ports-bugs@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 06FD7B0190C for ; Sun, 3 Apr 2016 17:49:45 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id E00071DAA for ; Sun, 3 Apr 2016 17:49:44 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id u33HniG4063195 for ; Sun, 3 Apr 2016 17:49:44 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-ports-bugs@FreeBSD.org Subject: [Bug 208486] lang/python27 lang/python33 lang/python34 lang/python35: Date: Sun, 03 Apr 2016 17:49:44 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Ports & Packages X-Bugzilla-Component: Individual Port(s) X-Bugzilla-Version: Latest X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Many People X-Bugzilla-Who: dim@FreeBSD.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: python@FreeBSD.org X-Bugzilla-Flags: maintainer-feedback? X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter flagtypes.name attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Apr 2016 17:49:45 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D208486 Bug ID: 208486 Summary: lang/python27 lang/python33 lang/python34 lang/python35: Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Many People Priority: --- Component: Individual Port(s) Assignee: python@FreeBSD.org Reporter: dim@FreeBSD.org Assignee: python@FreeBSD.org Flags: maintainer-feedback?(python@FreeBSD.org) Created attachment 168932 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D168932&action= =3Dedit Fix python issue 10910 for lang/python[27,33,34,35] During the exp-run in bug 208158, it was found that pyport.h (from the vari= ous lang/python ports) result in compilation errors with libc++ 3.8.0 [1], for instance with science/py-scipy: In file included from scipy/interpolate/src/_interpolate.cpp:4: In file included from scipy/interpolate/src/interpolate.h:3: In file included from /usr/include/c++/v1/iostream:38: In file included from /usr/include/c++/v1/ios:216: /usr/include/c++/v1/__locale:468:15: error: C++ requires a type specifier f= or all declarations char_type toupper(char_type __c) const ^ /usr/local/include/python2.7/pyport.h:731:29: note: expanded from macro 'toupper' #define toupper(c) towupper(btowc(c)) ^ This is because pyport.h contains a rather nasty workaround for very old FreeBSD ctype issue, which was added in August 2004 [2]: /* On 4.4BSD-descendants, ctype functions serves the whole range of * wchar_t character set rather than single byte code points only. * This characteristic can break some operations of string object * including str.upper() and str.split() on UTF-8 locales. This * workaround was provided by Tim Robbins of FreeBSD project. */ #ifdef __FreeBSD__ #include #if __FreeBSD_version > 500039 # define _PY_PORT_CTYPE_UTF8_ISSUE #endif #endif #if defined(__APPLE__) # define _PY_PORT_CTYPE_UTF8_ISSUE #endif #ifdef _PY_PORT_CTYPE_UTF8_ISSUE #include #include #undef isalnum #define isalnum(c) iswalnum(btowc(c)) #undef isalpha #define isalpha(c) iswalpha(btowc(c)) #undef islower #define islower(c) iswlower(btowc(c)) #undef isspace #define isspace(c) iswspace(btowc(c)) #undef isupper #define isupper(c) iswupper(btowc(c)) #undef tolower #define tolower(c) towlower(btowc(c)) #undef toupper #define toupper(c) towupper(btowc(c)) #endif Re-defining the macros like this causes trouble with some standard C++ libraries, which explicitly undefine such macros, and create them as inline functions instead. This problem was already reported to upstream Python in 2011, as issue 10910 [3]. The approach there is to wrap the workaround in an #ifdef __cplusplus, but after some digging, I found out that the original bug in ctype, which for example gave back 'True' for isspace('\xa0'), has already been solved in October 2007 by Andrey Chernov, in r172619 [4]. The ctype fixes were MFC'd= to stable/6 and stable/7 in r172929 [5]. I propose to add the attached patch to lang/python[27,33,34,35], which inst= ead corrects the __FreeBSD_version check to the following: #if (__FreeBSD_version >=3D 500040 && __FreeBSD_version < 602113) || \ (__FreeBSD_version >=3D 700000 && __FreeBSD_version < 700054) || \ (__FreeBSD_version >=3D 800000 && __FreeBSD_version < 800001) # define _PY_PORT_CTYPE_UTF8_ISSUE #endif Alternatively, since we don't really support such old FreeBSD versions anym= ore, the whole check and workaround can be removed instead. However, I also submitted the same change to upstream Python, in issue 10910, so hopefully = this fix will appear in future Python releases. [1] http://package18.nyi.freebsd.org/data/headamd64PR208158-default/2016-03-22_= 18h30m05s/logs/errors/py27-scipy-0.16.1.log [2] https://hg.python.org/cpython/rev/adfe7d39a049 [3] http://bugs.python.org/issue10910 [4] https://svnweb.freebsd.org/base?view=3Drevision&revision=3D172619 [5] https://svnweb.freebsd.org/base?view=3Drevision&revision=3D172929 --=20 You are receiving this mail because: You are the assignee for the bug.=