From owner-freebsd-standards@FreeBSD.ORG Sun Jan 22 19:38:56 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C1E31065675; Sun, 22 Jan 2012 19:38:56 +0000 (UTC) (envelope-from das@FreeBSD.ORG) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id C0F018FC1D; Sun, 22 Jan 2012 19:38:55 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0MJPQW5033285; Sun, 22 Jan 2012 14:25:26 -0500 (EST) (envelope-from das@FreeBSD.ORG) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0MJPQiK033276; Sun, 22 Jan 2012 14:25:26 -0500 (EST) (envelope-from das@FreeBSD.ORG) Date: Sun, 22 Jan 2012 14:25:26 -0500 From: David Schultz To: Andriy Gapon Message-ID: <20120122192526.GA52071@zim.MIT.EDU> Mail-Followup-To: Andriy Gapon , python@freebsd.org, freebsd-standards@freebsd.org, gogo@cs.uni-sb.de, theraven@freebsd.org References: <4F1AAA75.5050500@FreeBSD.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F1AAA75.5050500@FreeBSD.org> Cc: theraven@FreeBSD.ORG, freebsd-standards@FreeBSD.ORG, python@FreeBSD.ORG, gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Jan 2012 19:38:56 -0000 On Sat, Jan 21, 2012, Andriy Gapon wrote: > > It seems that python27's pyconfig.h (artificially?) limits visibility of system > APIs by setting _POSIX_C_SOURCE to 200112L and _XOPEN_SOURCE to 600. > This might not actually change much for earlier FreeBSD versions. > > But in FreeBSD 10 we now have interfaces from POSIX 200809, specifically some > things that are then used by xlocale.h. > > Now take an example of py-lxml port. It depends on both libxslt and python > (obviously). libxslt doesn't have any limitations in POSIX interfaces that it > uses, so it detects xlocale.h and uses it. xlocale.h depends on definition of > locale_t in locale.h. But since locale_t has been introduced in POSIX 2008 its > declaration is under __POSIX_VISIBLE >= 200809. And because of pyconfig.h, > py-lxml build doesn't see locale_t and so the build fails. > > This is probably an issue that the upstream should also consider. > > Having briefly looked at python27's configure script I wonder if we should set > define_xopen_source=no for FreeBSD 10 (like it has been done for FreeBSD/4.*). > > But in general I am not sure why python has to limit itself to those levels of > interfaces (_POSIX_C_SOURCE 200112L and _XOPEN_SOURCE 600). > > Thoughts, ideas, suggestions? > Thank you! Technically it's a problem with python. If you ask for a strict POSIX environment (doesn't matter what version) and also #include a non-POSIX header, there's no guarantee about what you'll get. I've CC'd the xlocale author in case he wants to comment or voluntarily make xlocale work in an otherwise strict POSIX environment, but that's not officially supported. From owner-freebsd-standards@FreeBSD.ORG Mon Jan 23 11:07:14 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AA951065670 for ; Mon, 23 Jan 2012 11:07:14 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0DF658FC17 for ; Mon, 23 Jan 2012 11:07:14 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q0NB7DUK081091 for ; Mon, 23 Jan 2012 11:07:13 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q0NB7Dx0081089 for freebsd-standards@FreeBSD.org; Mon, 23 Jan 2012 11:07:13 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 23 Jan 2012 11:07:13 GMT Message-Id: <201201231107.q0NB7Dx0081089@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2012 11:07:14 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o stand/162434 standards getaddrinfo: addrinfo.ai_family is an address family, o stand/157050 standards OSS implementation lacks AFMT_FLOAT o stand/154842 standards invalid request authenticator in the second and subseq o stand/150093 standards C++ std::locale support is broken o docs/143472 standards gethostname(3) references undefined value: HOST_NAME_M s stand/141705 standards [libc] [request] libc lacks cexp (and friends) o stand/130067 standards Wrong numeric limits in system headers? o stand/124860 standards flockfile(3) doesn't work when the memory has been exh o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/116477 standards rm(1): rm behaves unexpectedly when using -r and relat o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116081 standards make does not work with the directive sinclude p stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) a stand/86484 standards [patch] mkfifo(1) uses wrong permissions o stand/82654 standards C99 long double math functions are missing o stand/81287 standards [patch] fingerd(8) might send a line not ending in CRL a stand/80293 standards sysconf() does not support well-defined unistd values o stand/79056 standards [feature request] [atch] regex(3) regression tests o stand/70813 standards [patch] ls(1) not Posix compliant o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/56476 standards [patch] cd9660 unicode support simple hack o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/44365 standards [headers] [patch] [request] introduce ulong and unchar a stand/41576 standards ln(1): replacing old dir-symlinks o stand/39256 standards snprintf/vsnprintf aren't POSIX-conformant for strings a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h s stand/24590 standards timezone function not compatible witn Single Unix Spec o stand/21519 standards sys/dir.h should be deprecated some more s bin/14925 standards getsubopt isn't poisonous enough 32 problems total. From owner-freebsd-standards@FreeBSD.ORG Wed Jan 25 13:50:55 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DEDCB106567F; Wed, 25 Jan 2012 13:50:55 +0000 (UTC) (envelope-from theraven@FreeBSD.ORG) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 7B0888FC12; Wed, 25 Jan 2012 13:50:55 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q0PDNLo5048622 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Wed, 25 Jan 2012 13:23:22 GMT (envelope-from theraven@FreeBSD.ORG) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20120122192526.GA52071@zim.MIT.EDU> Date: Wed, 25 Jan 2012 13:23:22 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> To: David Schultz X-Mailer: Apple Mail (2.1251.1) Cc: freebsd-standards@FreeBSD.ORG, python@FreeBSD.ORG, Andriy Gapon , gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 13:50:56 -0000 On 22 Jan 2012, at 19:25, David Schultz wrote: > On Sat, Jan 21, 2012, Andriy Gapon wrote: >>=20 >> It seems that python27's pyconfig.h (artificially?) limits visibility = of system >> APIs by setting _POSIX_C_SOURCE to 200112L and _XOPEN_SOURCE to 600. >> This might not actually change much for earlier FreeBSD versions. >>=20 >> But in FreeBSD 10 we now have interfaces from POSIX 200809, = specifically some >> things that are then used by xlocale.h. >>=20 >> Now take an example of py-lxml port. It depends on both libxslt and = python >> (obviously). libxslt doesn't have any limitations in POSIX = interfaces that it >> uses, so it detects xlocale.h and uses it. xlocale.h depends on = definition of >> locale_t in locale.h. But since locale_t has been introduced in = POSIX 2008 its >> declaration is under __POSIX_VISIBLE >=3D 200809. And because of = pyconfig.h, >> py-lxml build doesn't see locale_t and so the build fails. >>=20 >> This is probably an issue that the upstream should also consider. >>=20 >> Having briefly looked at python27's configure script I wonder if we = should set >> define_xopen_source=3Dno for FreeBSD 10 (like it has been done for = FreeBSD/4.*). >>=20 >> But in general I am not sure why python has to limit itself to those = levels of >> interfaces (_POSIX_C_SOURCE 200112L and _XOPEN_SOURCE 600). >>=20 >> Thoughts, ideas, suggestions? >> Thank you! >=20 > Technically it's a problem with python. If you ask for a strict > POSIX environment (doesn't matter what version) and also #include > a non-POSIX header, there's no guarantee about what you'll get. > I've CC'd the xlocale author in case he wants to comment or > voluntarily make xlocale work in an otherwise strict POSIX > environment, but that's not officially supported. The problem is really with glibc, which uses these macros in the = opposite way to everyone else (glibc thinks defining these macros means = expose functionality from this standard, don't expose it otherwise, = everyone else thinks they mean expose only the things defined by this = standard). This makes writing portable code a pain and, while I'd = usually be keen to blame Python for everything, in this case I = sympathise with their problem. =20 Would defining locale_t and the related functions in xlocale.h if we are = in a mode where they are not normally exposed fix the problem? =20 David= From owner-freebsd-standards@FreeBSD.ORG Wed Jan 25 20:51:45 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2E58B10656D1; Wed, 25 Jan 2012 20:51:45 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id D7D238FC17; Wed, 25 Jan 2012 20:51:43 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA14100; Wed, 25 Jan 2012 22:51:42 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Rq9oj-0006tc-UV; Wed, 25 Jan 2012 22:51:41 +0200 Message-ID: <4F206B5D.3080302@FreeBSD.org> Date: Wed, 25 Jan 2012 22:51:41 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111222 Thunderbird/9.0 MIME-Version: 1.0 To: David Chisnall References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> In-Reply-To: <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> X-Enigmail-Version: undefined Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: David Schultz , freebsd-standards@FreeBSD.org, python@FreeBSD.org, gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Jan 2012 20:51:45 -0000 on 25/01/2012 15:23 David Chisnall said the following: > On 22 Jan 2012, at 19:25, David Schultz wrote: >> Technically it's a problem with python. If you ask for a strict >> POSIX environment (doesn't matter what version) and also #include >> a non-POSIX header, there's no guarantee about what you'll get. >> I've CC'd the xlocale author in case he wants to comment or >> voluntarily make xlocale work in an otherwise strict POSIX >> environment, but that's not officially supported. > > The problem is really with glibc, which uses these macros in the opposite way to everyone else (glibc thinks defining these macros means expose functionality from this standard, don't expose it otherwise, everyone else thinks they mean expose only the things defined by this standard). This makes writing portable code a pain and, while I'd usually be keen to blame Python for everything, in this case I sympathise with their problem. Thank you for the insights. > Would defining locale_t and the related functions in xlocale.h if we are in a mode where they are not normally exposed fix the problem? I think that this should work. -- Andriy Gapon From owner-freebsd-standards@FreeBSD.ORG Thu Jan 26 05:15:40 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 506BC1065677; Thu, 26 Jan 2012 05:15:40 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 635E48FC0C; Thu, 26 Jan 2012 05:15:38 +0000 (UTC) Received: by lahj13 with SMTP id j13so143899lah.13 for ; Wed, 25 Jan 2012 21:15:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=c/3A3fGkzLCoJFC8ZPh3Ww2JU6l2K3iL/xKY/0QnBg0=; b=qsgP4mAWdMz9T6bnMEhgGP1DgfC0l8jNqogLOHW7K5BiFKzCCsnbJA2dGxaiYoyOJ4 RzbJwo+23abo1I+gXD7PMD6Yd/BG1G2fylT11FVckQpLxlPp762wLcitoL8J0E2gfp22 ldd216pqn9Ga3It5AQYF2UY92xhZ6yZwIA5Zs= Received: by 10.112.48.65 with SMTP id j1mr115128lbn.76.1327553291231; Wed, 25 Jan 2012 20:48:11 -0800 (PST) MIME-Version: 1.0 Received: by 10.112.25.196 with HTTP; Wed, 25 Jan 2012 20:47:41 -0800 (PST) In-Reply-To: <4F206B5D.3080302@FreeBSD.org> References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org> From: Eitan Adler Date: Wed, 25 Jan 2012 23:47:41 -0500 Message-ID: To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-standards@freebsd.org, David Schultz , David Chisnall , python@freebsd.org, gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 05:15:40 -0000 On Wed, Jan 25, 2012 at 3:51 PM, Andriy Gapon wrote: > on 25/01/2012 15:23 David Chisnall said the following: >> On 22 Jan 2012, at 19:25, David Schultz wrote: >>> Technically it's a problem with python. =C2=A0If you ask for a strict >>> POSIX environment (doesn't matter what version) and also #include >>> a non-POSIX header, there's no guarantee about what you'll get. >>> I've CC'd the xlocale author in case he wants to comment or >>> voluntarily make xlocale work in an otherwise strict POSIX >>> environment, but that's not officially supported. >> >> The problem is really with glibc, which uses these macros in the opposit= e way to everyone else (glibc thinks defining these macros means expose fun= ctionality from this standard, don't expose it otherwise, everyone else thi= nks they mean expose only the things defined by this standard). =C2=A0This = makes writing portable code a pain and, while I'd usually be keen to blame = Python for everything, in this case I sympathise with their problem. > > Thank you for the insights. > >> Would defining locale_t and the related functions in xlocale.h if we are= in a mode where they are not normally exposed fix the problem? > > I think that this should work. What about patching python to only define the POSIX macros iff glibc is being used (and getting this upstreamed) ? --=20 Eitan Adler From owner-freebsd-standards@FreeBSD.ORG Thu Jan 26 11:34:06 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9076E1065672; Thu, 26 Jan 2012 11:34:06 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id 1A45D8FC14; Thu, 26 Jan 2012 11:34:05 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q0QBXvcv058372 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 26 Jan 2012 11:33:57 GMT (envelope-from theraven@freebsd.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: Date: Thu, 26 Jan 2012 11:34:00 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <3B3BEEED-D1E4-4329-BE34-5CFF5CABB52C@freebsd.org> References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org> To: Eitan Adler X-Mailer: Apple Mail (2.1251.1) Cc: David Schultz , freebsd-standards@freebsd.org, python@freebsd.org, Andriy Gapon , gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 11:34:06 -0000 On 26 Jan 2012, at 04:47, Eitan Adler wrote: > On Wed, Jan 25, 2012 at 3:51 PM, Andriy Gapon wrote: >> on 25/01/2012 15:23 David Chisnall said the following: >>> On 22 Jan 2012, at 19:25, David Schultz wrote: >>>> Technically it's a problem with python. If you ask for a strict >>>> POSIX environment (doesn't matter what version) and also #include >>>> a non-POSIX header, there's no guarantee about what you'll get. >>>> I've CC'd the xlocale author in case he wants to comment or >>>> voluntarily make xlocale work in an otherwise strict POSIX >>>> environment, but that's not officially supported. >>>=20 >>> The problem is really with glibc, which uses these macros in the = opposite way to everyone else (glibc thinks defining these macros means = expose functionality from this standard, don't expose it otherwise, = everyone else thinks they mean expose only the things defined by this = standard). This makes writing portable code a pain and, while I'd = usually be keen to blame Python for everything, in this case I = sympathise with their problem. >>=20 >> Thank you for the insights. >>=20 >>> Would defining locale_t and the related functions in xlocale.h if we = are in a mode where they are not normally exposed fix the problem? >>=20 >> I think that this should work. >=20 > What about patching python to only define the POSIX macros iff glibc > is being used (and getting this upstreamed) ? That would be ideal, but I'd prefer that we did anything that we can = within the standard to ensure that people who do silly thing that work = on other platforms don't end up saying 'FreeBSD sucks!' because of their = code. Please can you someone verify that this patch fixes the problem? =20= David Index: include/locale.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- include/locale.h (revision 230510) +++ include/locale.h (working copy) @@ -79,7 +79,8 @@ char *setlocale(int, const char *); __END_DECLS =20 -#if __POSIX_VISIBLE >=3D 200809 +#if __POSIX_VISIBLE >=3D 200809 && !defined(__X_LOCALE_DEFINED) +#define __X_LOCALE_DEFINED =20 #define LC_COLLATE_MASK (1<<0) #define LC_CTYPE_MASK (1<<1) Index: include/xlocale.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --- include/xlocale.h (revision 230510) +++ include/xlocale.h (working copy) @@ -35,7 +35,33 @@ #include =20 __BEGIN_DECLS +/* + * If people turned off POSIX2008 stuff, but still explicitly included = the + * xlocale.h header, then assume that they actually do want these = functions and + * define them. + */ +#ifndef __X_LOCALE_DEFINED +#define __X_LOCALE_DEFINED =20 +#define LC_COLLATE_MASK (1<<0) +#define LC_CTYPE_MASK (1<<1) +#define LC_MESSAGES_MASK (1<<2) +#define LC_MONETARY_MASK (1<<3) +#define LC_NUMERIC_MASK (1<<4) +#define LC_TIME_MASK (1<<5) +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | = LC_MESSAGES_MASK | \ + LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) +#define LC_GLOBAL_LOCALE ((locale_t)-1) + +typedef struct _xlocale *locale_t; +locale_t newlocale(int mask, const char *locale, locale_t base); +locale_t duplocale(locale_t base); +int freelocale(locale_t loc); +const char *querylocale(int mask, locale_t loc); +locale_t uselocale(locale_t loc); + +#endif /* __X_LOCALE_DEFINED */ + /* * Extended locale versions of the locale-aware functions from = string.h. * From owner-freebsd-standards@FreeBSD.ORG Thu Jan 26 12:42:37 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 82E59106567B; Thu, 26 Jan 2012 12:42:37 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 2B4BB8FC21; Thu, 26 Jan 2012 12:42:35 +0000 (UTC) Received: from odyssey.starpoint.kiev.ua (alpha-e.starpoint.kiev.ua [212.40.38.101]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id OAA27737; Thu, 26 Jan 2012 14:42:33 +0200 (EET) (envelope-from avg@FreeBSD.org) Message-ID: <4F214A39.6050403@FreeBSD.org> Date: Thu, 26 Jan 2012 14:42:33 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120111 Thunderbird/9.0 MIME-Version: 1.0 To: Eitan Adler References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: freebsd-standards@FreeBSD.org, David Schultz , David Chisnall , python@FreeBSD.org, gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 12:42:37 -0000 on 26/01/2012 06:47 Eitan Adler said the following: > On Wed, Jan 25, 2012 at 3:51 PM, Andriy Gapon wrote: >> on 25/01/2012 15:23 David Chisnall said the following: >>> On 22 Jan 2012, at 19:25, David Schultz wrote: >>>> Technically it's a problem with python. If you ask for a strict >>>> POSIX environment (doesn't matter what version) and also #include >>>> a non-POSIX header, there's no guarantee about what you'll get. >>>> I've CC'd the xlocale author in case he wants to comment or >>>> voluntarily make xlocale work in an otherwise strict POSIX >>>> environment, but that's not officially supported. >>> >>> The problem is really with glibc, which uses these macros in the opposite way to everyone else (glibc thinks defining these macros means expose functionality from this standard, don't expose it otherwise, everyone else thinks they mean expose only the things defined by this standard). This makes writing portable code a pain and, while I'd usually be keen to blame Python for everything, in this case I sympathise with their problem. >> >> Thank you for the insights. >> >>> Would defining locale_t and the related functions in xlocale.h if we are in a mode where they are not normally exposed fix the problem? >> >> I think that this should work. > > What about patching python to only define the POSIX macros iff glibc > is being used (and getting this upstreamed) ? IMO, this should work too. At least for us :-) -- Andriy Gapon From owner-freebsd-standards@FreeBSD.ORG Thu Jan 26 14:00:31 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C4131065673; Thu, 26 Jan 2012 14:00:31 +0000 (UTC) (envelope-from das@freebsd.org) Received: from zim.MIT.EDU (ZIM.MIT.EDU [18.95.3.101]) by mx1.freebsd.org (Postfix) with ESMTP id B2BBF8FC0A; Thu, 26 Jan 2012 14:00:30 +0000 (UTC) Received: from zim.MIT.EDU (localhost [127.0.0.1]) by zim.MIT.EDU (8.14.5/8.14.2) with ESMTP id q0QE0LN6018208; Thu, 26 Jan 2012 09:00:21 -0500 (EST) (envelope-from das@freebsd.org) Received: (from das@localhost) by zim.MIT.EDU (8.14.5/8.14.2/Submit) id q0QE0LPs018207; Thu, 26 Jan 2012 09:00:21 -0500 (EST) (envelope-from das@freebsd.org) Date: Thu, 26 Jan 2012 09:00:21 -0500 From: David Schultz To: David Chisnall Message-ID: <20120126140021.GA18060@zim.MIT.EDU> Mail-Followup-To: David Chisnall , Eitan Adler , Andriy Gapon , freebsd-standards@freebsd.org, python@freebsd.org, gogo@cs.uni-sb.de References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org> <3B3BEEED-D1E4-4329-BE34-5CFF5CABB52C@freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3B3BEEED-D1E4-4329-BE34-5CFF5CABB52C@freebsd.org> Cc: freebsd-standards@freebsd.org, python@freebsd.org, Andriy Gapon , gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 14:00:31 -0000 On Thu, Jan 26, 2012, David Chisnall wrote: > > On 26 Jan 2012, at 04:47, Eitan Adler wrote: > > What about patching python to only define the POSIX macros iff glibc > > is being used (and getting this upstreamed) ? That's a good strategy regardless. As long as python is doing something bogus, it could easily break in the future. > Index: include/xlocale.h [...] > +/* > + * If people turned off POSIX2008 stuff, but still explicitly included the > + * xlocale.h header, then assume that they actually do want these functions and > + * define them. > + */ > +#ifndef __X_LOCALE_DEFINED > +#define __X_LOCALE_DEFINED > > +#define LC_COLLATE_MASK (1<<0) > +#define LC_CTYPE_MASK (1<<1) > +#define LC_MESSAGES_MASK (1<<2) > +#define LC_MONETARY_MASK (1<<3) > +#define LC_NUMERIC_MASK (1<<4) > +#define LC_TIME_MASK (1<<5) > +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ > + LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) > +#define LC_GLOBAL_LOCALE ((locale_t)-1) > + > +typedef struct _xlocale *locale_t; > +locale_t newlocale(int mask, const char *locale, locale_t base); > +locale_t duplocale(locale_t base); > +int freelocale(locale_t loc); > +const char *querylocale(int mask, locale_t loc); > +locale_t uselocale(locale_t loc); > + > +#endif /* __X_LOCALE_DEFINED */ It would be preferable not to have two copies of all the definitions and declarations in the source. This is often handled with separate headers like sys/_timeval.h and sys/_types.h. Perhaps that's too many hoops to jump through just to cope with buggy applications. (Incidentally, I noticed that the LC_* macros are in a slightly different order from the LC_*_MASK macros. For that reason, and only that reason, it's not possible to define the latter in terms of the former.) Would it suffice, perhaps, to simply change the xlocale declarations to use type `struct _xlocale' instead of locale_t? That won't fix apps that expect the LC_*_MASK macros to be defined, but it looks like it will at least make the header compile in a strict POSIX environment, and it avoids the duplication. By the way, struct _xlocale needs another underscore in front of it. Names prefixed with a single underscore and a lowercase letter are in the application's namespace. From owner-freebsd-standards@FreeBSD.ORG Thu Jan 26 16:56:17 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5B931106564A; Thu, 26 Jan 2012 16:56:17 +0000 (UTC) (envelope-from theraven@freebsd.org) Received: from theravensnest.org (theravensnest.org [109.169.23.128]) by mx1.freebsd.org (Postfix) with ESMTP id E48668FC0C; Thu, 26 Jan 2012 16:56:16 +0000 (UTC) Received: from [192.168.0.2] (cpc1-cwma8-2-0-cust257.7-3.cable.virginmedia.com [82.20.153.2]) (authenticated bits=0) by theravensnest.org (8.14.4/8.14.4) with ESMTP id q0QGu72J060492 (version=TLSv1/SSLv3 cipher=DHE-DSS-AES128-SHA bits=128 verify=NO); Thu, 26 Jan 2012 16:56:08 GMT (envelope-from theraven@freebsd.org) Mime-Version: 1.0 (Apple Message framework v1251.1) Content-Type: text/plain; charset=us-ascii From: David Chisnall In-Reply-To: <20120126140021.GA18060@zim.MIT.EDU> Date: Thu, 26 Jan 2012 16:56:02 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <4BC83792-2FE3-4B7A-8CB1-18B4FF82A8CD@freebsd.org> References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org> <3B3BEEED-D1E4-4329-BE34-5CFF5CABB52C@freebsd.org> <20120126140021.GA18060@zim.MIT.EDU> To: David Schultz X-Mailer: Apple Mail (2.1251.1) Cc: freebsd-standards@freebsd.org, python@freebsd.org, Andriy Gapon , gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 16:56:17 -0000 On 26 Jan 2012, at 14:00, David Schultz wrote: > On Thu, Jan 26, 2012, David Chisnall wrote: >>=20 >> On 26 Jan 2012, at 04:47, Eitan Adler wrote: >>> What about patching python to only define the POSIX macros iff glibc >>> is being used (and getting this upstreamed) ? >=20 > That's a good strategy regardless. As long as python is doing > something bogus, it could easily break in the future. >=20 >> Index: include/xlocale.h > [...] >> +/* >> + * If people turned off POSIX2008 stuff, but still explicitly = included the >> + * xlocale.h header, then assume that they actually do want these = functions and >> + * define them. >> + */ >> +#ifndef __X_LOCALE_DEFINED >> +#define __X_LOCALE_DEFINED >>=20 >> +#define LC_COLLATE_MASK (1<<0) >> +#define LC_CTYPE_MASK (1<<1) >> +#define LC_MESSAGES_MASK (1<<2) >> +#define LC_MONETARY_MASK (1<<3) >> +#define LC_NUMERIC_MASK (1<<4) >> +#define LC_TIME_MASK (1<<5) >> +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | = LC_MESSAGES_MASK | \ >> + LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) >> +#define LC_GLOBAL_LOCALE ((locale_t)-1) >> + >> +typedef struct _xlocale *locale_t; >> +locale_t newlocale(int mask, const char *locale, locale_t base); >> +locale_t duplocale(locale_t base); >> +int freelocale(locale_t loc); >> +const char *querylocale(int mask, locale_t loc); >> +locale_t uselocale(locale_t loc); >> + >> +#endif /* __X_LOCALE_DEFINED */ >=20 > It would be preferable not to have two copies of all the > definitions and declarations in the source. This is often handled > with separate headers like sys/_timeval.h and sys/_types.h. > Perhaps that's too many hoops to jump through just to cope with > buggy applications. (Incidentally, I noticed that the LC_* macros > are in a slightly different order from the LC_*_MASK macros. For > that reason, and only that reason, it's not possible to define the > latter in terms of the former.) >=20 > Would it suffice, perhaps, to simply change the xlocale > declarations to use type `struct _xlocale' instead of locale_t? > That won't fix apps that expect the LC_*_MASK macros to be > defined, but it looks like it will at least make the header > compile in a strict POSIX environment, and it avoids the=20 > duplication. Yup, that would probably be fine. > By the way, struct _xlocale needs another underscore in front of > it. Names prefixed with a single underscore and a lowercase > letter are in the application's namespace. It is struct _xlocale on Darwin, where this API was introduced as an = extension before making it into POSIX, so I kept the name in case anyone = depends on this. David= From owner-freebsd-standards@FreeBSD.ORG Thu Jan 26 16:59:17 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D54C8106568B; Thu, 26 Jan 2012 16:59:17 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from fallbackmx08.syd.optusnet.com.au (fallbackmx08.syd.optusnet.com.au [211.29.132.10]) by mx1.freebsd.org (Postfix) with ESMTP id 669788FC18; Thu, 26 Jan 2012 16:59:16 +0000 (UTC) Received: from mail08.syd.optusnet.com.au (mail08.syd.optusnet.com.au [211.29.132.189]) by fallbackmx08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0QEx0pn004440; Fri, 27 Jan 2012 01:59:02 +1100 Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail08.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q0QEwdoj025929 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 27 Jan 2012 01:58:40 +1100 Date: Fri, 27 Jan 2012 01:58:39 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: David Schultz In-Reply-To: <20120126140021.GA18060@zim.MIT.EDU> Message-ID: <20120127012410.A1336@besplex.bde.org> References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> <9F9CC3ED-0686-4BC5-BF01-1839A30ABA9C@FreeBSD.ORG> <4F206B5D.3080302@FreeBSD.org> <3B3BEEED-D1E4-4329-BE34-5CFF5CABB52C@freebsd.org> <20120126140021.GA18060@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: freebsd-standards@freebsd.org, David Chisnall , python@freebsd.org, Andriy Gapon , gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jan 2012 16:59:18 -0000 On Thu, 26 Jan 2012, David Schultz wrote: > On Thu, Jan 26, 2012, David Chisnall wrote: >> >> On 26 Jan 2012, at 04:47, Eitan Adler wrote: >>> What about patching python to only define the POSIX macros iff glibc >>> is being used (and getting this upstreamed) ? > > That's a good strategy regardless. As long as python is doing > something bogus, it could easily break in the future. > >> Index: include/xlocale.h > [...] >> +/* >> + * If people turned off POSIX2008 stuff, but still explicitly included the >> + * xlocale.h header, then assume that they actually do want these functions and >> + * define them. >> + */ >> +#ifndef __X_LOCALE_DEFINED >> +#define __X_LOCALE_DEFINED >> >> +#define LC_COLLATE_MASK (1<<0) >> +#define LC_CTYPE_MASK (1<<1) >> +#define LC_MESSAGES_MASK (1<<2) >> +#define LC_MONETARY_MASK (1<<3) >> +#define LC_NUMERIC_MASK (1<<4) >> +#define LC_TIME_MASK (1<<5) >> +#define LC_ALL_MASK (LC_COLLATE_MASK | LC_CTYPE_MASK | LC_MESSAGES_MASK | \ >> + LC_MONETARY_MASK | LC_NUMERIC_MASK | LC_TIME_MASK) >> +#define LC_GLOBAL_LOCALE ((locale_t)-1) >> + >> +typedef struct _xlocale *locale_t; >> +locale_t newlocale(int mask, const char *locale, locale_t base); >> +locale_t duplocale(locale_t base); >> +int freelocale(locale_t loc); >> +const char *querylocale(int mask, locale_t loc); >> +locale_t uselocale(locale_t loc); This file has mounds of style bugs. This change adds many more: - all tabs after #define are corrupt - all spaces around the binary operator `<<' are missing. - the prototype for newlocale() is disordered. The prototypes have mounds of namespace pollution. All their parameters have names in the application namespace. locale.h used to have only 1 corrupt tab after #define (the one, but now has the above. It also has verbose comments on the prototypes which make the actual prototypes hard to read. Normally, prototypes have no comment, as for old prototypes in locale.h. Some of the comments are not formatted normally. >> + >> +#endif /* __X_LOCALE_DEFINED */ > > It would be preferable not to have two copies of all the > definitions and declarations in the source. This is often handled > with separate headers like sys/_timeval.h and sys/_types.h. > Perhaps that's too many hoops to jump through just to cope with > buggy applications. (Incidentally, I noticed that the LC_* macros > are in a slightly different order from the LC_*_MASK macros. For > that reason, and only that reason, it's not possible to define the > latter in terms of the former.) > > Would it suffice, perhaps, to simply change the xlocale > declarations to use type `struct _xlocale' instead of locale_t? > That won't fix apps that expect the LC_*_MASK macros to be > defined, but it looks like it will at least make the header > compile in a strict POSIX environment, and it avoids the > duplication. > > By the way, struct _xlocale needs another underscore in front of > it. Names prefixed with a single underscore and a lowercase > letter are in the application's namespace. No, this is not one of the many missing underscores in the above. Identifiers that begin with a single underscore which is followed by any character that gives a valid identifier (an upper or lower case letter, or a digit) are reserved for use as identifiers with file scope in both the ordinary and tag name spaces. The above only uses _xlocale in file scope (in a typedef), so application use of it can't clobber this use. Only use of it in macros is likely to require 2 underscores, but there is no such use. Using it for only a tag name limits problems with underscores even more than usual. Bruce From owner-freebsd-standards@FreeBSD.ORG Fri Jan 27 16:09:58 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE75A106566C; Fri, 27 Jan 2012 16:09:58 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay006.isp.belgacom.be (mailrelay006.isp.belgacom.be [195.238.6.172]) by mx1.freebsd.org (Postfix) with ESMTP id 95F168FC0C; Fri, 27 Jan 2012 16:09:57 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EAO/IIk9bsYWl/2dsb2JhbABErB+CMYEGgXIBAQVWIxALGC45HogXuCWJEAElBgkBCAEGBAMDBAwZgmyBNQUhAQIggxwEiAyWOYkj Received: from 165.133-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.133.165]) by relay.skynet.be with ESMTP; 27 Jan 2012 16:59:49 +0100 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.5/8.14.5) with ESMTP id q0RFxmga003618; Fri, 27 Jan 2012 16:59:48 +0100 (CET) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: freebsd-standards@freebsd.org Date: Fri, 27 Jan 2012 16:59:40 +0100 User-Agent: KMail/1.13.7 (FreeBSD/10.0-CURRENT; KDE/4.7.3; i386; ; ) References: <4F1AAA75.5050500@FreeBSD.org> <20120122192526.GA52071@zim.MIT.EDU> In-Reply-To: <20120122192526.GA52071@zim.MIT.EDU> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1395942.TgWN4u9Efg"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201201271659.45930.tijl@coosemans.org> Cc: David Schultz , theraven@freebsd.org, python@freebsd.org, Andriy Gapon , gogo@cs.uni-sb.de Subject: Re: pyconfig.h and freebsd10: _POSIX_C_SOURCE and _XOPEN_SOURCE X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jan 2012 16:09:59 -0000 --nextPart1395942.TgWN4u9Efg Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable On Sunday 22 January 2012 20:25:26 David Schultz wrote: > On Sat, Jan 21, 2012, Andriy Gapon wrote: >> It seems that python27's pyconfig.h (artificially?) limits visibility of= system >> APIs by setting _POSIX_C_SOURCE to 200112L and _XOPEN_SOURCE to 600. >> This might not actually change much for earlier FreeBSD versions. >>=20 >> But in FreeBSD 10 we now have interfaces from POSIX 200809, specifically= some >> things that are then used by xlocale.h. >>=20 >> Now take an example of py-lxml port. It depends on both libxslt and pyt= hon >> (obviously). libxslt doesn't have any limitations in POSIX interfaces t= hat it >> uses, so it detects xlocale.h and uses it. xlocale.h depends on definit= ion of >> locale_t in locale.h. But since locale_t has been introduced in POSIX 2= 008 its >> declaration is under __POSIX_VISIBLE >=3D 200809. And because of pyconf= ig.h, >> py-lxml build doesn't see locale_t and so the build fails. >>=20 >> This is probably an issue that the upstream should also consider. >>=20 >> Having briefly looked at python27's configure script I wonder if we shou= ld set >> define_xopen_source=3Dno for FreeBSD 10 (like it has been done for FreeB= SD/4.*). >>=20 >> But in general I am not sure why python has to limit itself to those lev= els of >> interfaces (_POSIX_C_SOURCE 200112L and _XOPEN_SOURCE 600). >>=20 >> Thoughts, ideas, suggestions? >> Thank you! >=20 > Technically it's a problem with python. If you ask for a strict > POSIX environment (doesn't matter what version) and also #include > a non-POSIX header, there's no guarantee about what you'll get. > I've CC'd the xlocale author in case he wants to comment or > voluntarily make xlocale work in an otherwise strict POSIX > environment, but that's not officially supported. The POSIX feature macros only mean that headers that are part of the standard need to behave as defined by the standard. Non-standard headers like xlocale.h can do whatever they want. So if that header wants to expose a new locale API it can do so, but then it must also expose locale_t of course, because you cannot use the API without it. However, xlocale.h is a very ugly header (does different things depending on which headers have been included already), and some of the function prototypes have become part of the latest POSIX standard and need to be moved to different headers (strxfrm_l, strcoll_l,...). So it may be better to move all prototypes to their respective headers and remove xlocale.h (or leave a minimal header like glibc seems to have done). Then libxslt would have to be patched to support plain POSIX and not require xlocale.h. --nextPart1395942.TgWN4u9Efg Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iF4EABEIAAYFAk8iyfEACgkQfoCS2CCgtivNfwD/SQkWxgm2V9qcsXIBAOa0M2mT uydibAy1gl2NJ3pwBR4A/3IMuWBTkF9lac5SUuydEEICUzS/IA3iDV6UK2vwV9dZ =pFYg -----END PGP SIGNATURE----- --nextPart1395942.TgWN4u9Efg--