Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKUuS-0003uF-OG for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jan 2023 01:49:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pKUuQ-0005NX-Qj for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jan 2023 01:49:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKUuP-0005Mk-TF for pgsql-hackers@lists.postgresql.org; Wed, 25 Jan 2023 01:49:06 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pKUuM-0005IC-LP for pgsql-hackers@postgresql.org; Wed, 25 Jan 2023 01:49:05 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 9B8A5320092F; Tue, 24 Jan 2023 20:48:59 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 24 Jan 2023 20:49:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm3; t=1674611339; x=1674697739; bh=iel+pFhaHu iYIJNGzKXeURn0HcDZgumrGPKJgMdqpQw=; b=1pAGE525a1rnl3cphrqYL3Y+B/ clcYkr0xcQCLZdKVFt0jpcaYRQ25OrG9iu1F2KkKMohVhltp56Lkw+n37WOVEoRC Fdj/iRT51rJoqTfqJs+Hv7YIeHWeXjNUForE9i/yFKCOv1jvPk6j38kfkMgctEeb MkqJMJPNUtsMNpybN9B5SyPMTo0YMtSnNf5UWDugSDcVKPPMuA3w280s/kCQ6Qa0 LpsM3ryU+aiAHvfHvO/IXK+1jymcgP0DzH8JCsgdLa3f2eTUZu4IrE5iF1OHSLxw V6A9mr1EixDLQj8elFvxd9hLYwAtaJPKr7DAxJHXUD6pk0GFLkMksGAxyDog== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; t=1674611339; x=1674697739; bh=iel+pFhaHuiYIJNGzKXeURn0HcDZ gumrGPKJgMdqpQw=; b=j0HBp0p1xDs10CYNq0y+/ywoVOtmwdo9NWh27uDMvR6f P/yoPHzAB+XVmZvuDvnqghT4wb4Qt2uDd4OWaOYnUwQ+i2Yn443kEfeWsZHTfUqX D88SGpoxtDcwmJC1jnFjycR44ndWMqj0IWKhsMiELl8xJhWVHo8WQeNndzB+Q+hg BX6mWRogqehBrRS5PptiLvg5/wHagu3tCFi/Xcpl66cgb79HM3muyCBfJUwCph7E ilGt0BCwl379G5oDJGKkNMIWLx8VW1rtYxzu0rP0Iu3dIQDYGGHHBBoQGcgNdRa2 t4PudfeMxCsxpQD6yIkISXcc/B7eDKVv61/BDvDx3Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedruddvuddggedvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughr vghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrf grthhtvghrnhepvdfffeevhfetveffgeeiteefhfdtvdffjeevhfeuteegleduheetvedu ieettddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh eprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 24 Jan 2023 20:48:58 -0500 (EST) Date: Tue, 24 Jan 2023 17:48:56 -0800 From: Andres Freund To: Tom Lane , Noah Misch Cc: pgsql-hackers@postgresql.org, Peter Eisentraut , Andrew Dunstan Subject: Re: plpython vs _POSIX_C_SOURCE Message-ID: <20230125014856.j3ndx2cftjxdvqul@awork3.anarazel.de> References: <20230124165814.2njc7gnvubn2amh6@awork3.anarazel.de> <2265665.1674582915@sss.pgh.pa.us> <20230124190721.mi7l5c3n2tsrqjno@awork3.anarazel.de> <2320614.1674594966@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2320614.1674594966@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-01-24 16:16:06 -0500, Tom Lane wrote: > Andres Freund writes: > > Python's _POSIX_C_SOURCE value is set to a specific value in their configure > > script: > > > if test $define_xopen_source = yes > > then > > ... > > AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008) > > fi > > Hm. I looked into Python 3.2 (the oldest release we still support) > and it has similar code but > > AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001) > > So yeah it's fixed (or else not defined) for any particular Python > release, but could vary across releases. Looks like it changed in 3.3: $ git grep -E 'AC_DEFINE.*_POSIX_C_SOURCE' v3.2 v3.3.0 v3.2:configure.in: AC_DEFINE(_POSIX_C_SOURCE, 200112L, Define to activate features from IEEE Stds 1003.1-2001) v3.3.0:configure.ac: AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008) I'm not sure we need to care a lot about a build with python 3.3 triggering a bunch of warnings. Personally I'd just bump the python requirements to well above it - the last 3.2 release was Oct. 12, 2014. Official EOL date: Ver Last Release EOL Date 3.2 2014-10-11 2016-02-20 3.3 2017-09-19 2017-09-29 From 3.4 on there's just an official last release: 3.4 2019-03-18 3.5 2020-09-05 3.6 2021-09-04 3.7 2023-06-?? > > Solaris and AIX are the ones missing. > > I guess I'll test them manually. It seems promising not to need this stuff > > anymore? > > Given that hoverfly is AIX, I'm betting there's an issue there. Doesn't look that way. I found plenty problems on AIX, but all independent of _POSIX_C_SOURCE. Both autoconf and meson builds seem to need externally specified -D_LARGE_FILES=1 to build successfully when using plpython, otherwise we end up with conflicting signatures with lseek. I see that Noah has that in his buildfarm config. ISTM that we should just move that into our build specs. To get 64 bit autoconf to link plpython3.so correctly, I needed to add to manually add -lpthread: ld: 0711-317 ERROR: Undefined symbol: .pthread_init ... I suspect Noah might not hit this, because one of the dependencies he has enabled already adds it to the backend LDFLAGS. Also for autoconf, I needed to link $prefix/lib/python3.11/config-3.11/libpython3.11.a to $prefix/lib/libpython3.11.a That might be a python version difference or be related to building python with --enable-shared - but I see saw other problems without --enable-shared. I ran out of energy to test on aix with xlc, I spent way more time on this than I have already. I'll pick it up later. I also tested 64bit solaris. No relevant warnings (lots of other warnings though), tests pass, with both acc and gcc. > >> Anyway, I'm still of the opinion that what a11cf433413 tried to do > >> was the best available fix, and we need to do whatever we have to do > >> to plpython's headers to reinstate that coding rule. > > > You think it's not a viable path to just remove the _POSIX_C_SOURCE, > > _XOPEN_SOURCE undefines? > > I think at the least that will result in warnings on some platforms, > and at the worst in actual build problems. Maybe there are no more > of the latter a dozen years after the fact, but ... I think it might be ok. I tested nearly all OSs that we support, with the exception of DragonFlyBSD and Illumos, which both are very similar to tested operating systems. > Nice idea. We did not have that option while we were using HAVE_SNPRINTF > ourselves, but now that we are not I concur that this should work. Cool. > (I confirmed that their code looks the same in Python 3.2.) > Note that you'd better make it > > #define HAVE_SNPRINTF 1 > > or you risk macro-redefinition warnings. Good point. I guess I'll push that part first, given that we have agreement how it should look like. Greetings, Andres Freund