From nobody Thu Mar 20 11:14:31 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ZJNJT6JJvz5qhLg; Thu, 20 Mar 2025 11:14:33 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ZJNJT4YFvz3Xjs; Thu, 20 Mar 2025 11:14:33 +0000 (UTC) (envelope-from shurd@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742469273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iSD0hp37UIYBjYa3T3RG2267FTMli8LEhEng5ACGALc=; b=Nz2oE0FkSUex7mcLfLHVMEmt6lSKdPPsDvKvoYfEeN6x7g2G2hhe7a4sNs5Tw1tVGdioZx O52B4YsM4ygQqMCTsnwcOHgVPStpV1ZDa9ZW6XrVideJFYg01/1u0TWmMDZg8JJj5YUrof St8vJCiwCizHtsWvYBin9QfrZrYBWz39P06NAJ7Y5Jy5rJS1EIp88utmTjQfL84LTkWUq+ /5Uooi0lT9plORlXndHapPZIgcBE5clx8SaEVwP2eHqLbEvc2L70fVU3HqlJi3snme3SFV LdmZ8Sq8rjK6VJoflXcfPt0yFAqcB1ilr0aEita33McDCAiR+Oglzfy5xA53JA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1742469273; a=rsa-sha256; cv=none; b=ci4zrSqPgOPFfMdo9MsfzerdT1zorx/Q8DAphOQoHzc8fS2eOQKa1A94J2pnj7n9f+e2ml JO4ZvY2AEQhnbCSsoCNUj55yHEQzRWe30vPHGb3EkTd+mWmrsRuq+htTSKgRf1hug755Kn 2xlZol1m0lLa6Q8JlyATBX2snV+tKF3ISTbk+Fv9M3XEPPDt7ggFvO50MPCmHzrntFJ8h1 5p5SpPPTVosFAA3kmJe5rKgKc6+xj0fK2wJHM8HlpVm4cObtJuyM9uXIN6CO2FYzBzY7j0 v+FYILVoH4y8YDnMRI/edFNZjgzkR2U4N6Bjk+5KWOLWh36uuMAR10DIuskXYw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1742469273; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=iSD0hp37UIYBjYa3T3RG2267FTMli8LEhEng5ACGALc=; b=WwU7eBCQB4Kvn56IwAqbi45HtKc2lmn41CLlKi06kDSwFUJ3GpQYbVAvEGNamTPJ91tQRn c8xfA3zpNnW1g0sj4b9Ub1zruwG6jCDv0mlUT03STLnhnyLA9xLJfc8HfjDwi6qTEcUjdf pkp+F+sKGbx9Tj3QXks4p1Thq4J9Oi8wGMlzJO5fYggq3OV7Fqty0sOQ459unuuo5yu260 liC6UCwtoFh4fc0l6KGie8d0inXGhhOkkuhfXmmw+ZuwCyvWltR5Sr2nzP/701fb9PX/Yk ndO3LzXrsN9v9/lS33QswT8HENX0dpWvHHfRy2UbVdi0eMZEJRnh0pDTFs6qbg== Received: from [IPV6:2601:404:ce00:7c90:ec4:7aff:fec4:ac4a] (unknown [IPv6:2601:404:ce00:7c90:ec4:7aff:fec4:ac4a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: shurd) by smtp.freebsd.org (Postfix) with ESMTPSA id 4ZJNJT0rqzz1Bqh; Thu, 20 Mar 2025 11:14:32 +0000 (UTC) (envelope-from shurd@FreeBSD.org) Content-Type: multipart/alternative; boundary="------------WF10o1c7MsMLihyxeV7pRg8T" Message-ID: <8521154a-def4-4da4-97b1-d1d8df65e564@FreeBSD.org> Date: Thu, 20 Mar 2025 07:14:31 -0400 List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: git: 415a0ce02c9e - main - Revert Make newly POSIX functions visible To: Warner Losh , Stephen Hurd Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org References: <202503200741.52K7frms088363@gitrepo.freebsd.org> Content-Language: en-US From: shurd@FreeBSD.org In-Reply-To: This is a multi-part message in MIME format. --------------WF10o1c7MsMLihyxeV7pRg8T Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2025-03-20 05:55, Warner Losh wrote: > > > On Thu, Mar 20, 2025, 1:42 AM Stephen Hurd wrote: > > The branch main has been updated by shurd: > > URL: > https://cgit.FreeBSD.org/src/commit/?id=415a0ce02c9ee2c15c7973b2dfbddda71f6344a2 > > > commit 415a0ce02c9ee2c15c7973b2dfbddda71f6344a2 > Author:     Stephen Hurd > AuthorDate: 2025-03-20 07:15:15 +0000 > Commit:     Stephen Hurd > CommitDate: 2025-03-20 07:41:27 +0000 > >     Revert Make newly POSIX functions visible > >     Summary: >     This reverts commit d7efac1be1441c122f7fb9de51a409172f21326c. >     This reverts commit 9d0eea9422d075c8a6924b33161d2d5abfb4072a. > >     Some ports (specifically Python) define __BSD_VISIBLE > themselves, so >     the change from __BSD_VISIBLE to __POSIX_VISIBLE >= 202405 > makes them >     fail. > > > That's not legal. Defining __BSD_VISIBLE directly is illegal and won't > work right. Can't work right and should likely be a compile time > error. With am exp run to fix. The Python commit that added it for the curious: https://github.com/python/cpython/commit/abccf41a7d616cc950510ad4a3526b11e012ee24 22 years ago for 5.x The root of their usage appears to be the use of _XOPEN_SOURCE 700 with the following comment: # Some systems cannot stand _XOPEN_SOURCE being defined at all; they # disable features if it is defined, without any means to access these # features as extensions. For these systems, we skip the definition of # _XOPEN_SOURCE. Before adding a system to the list to gain access to # some feature, make sure there is no alternative way to access this # feature. Also, when using wildcards, make sure you have verified the # need for not defining _XOPEN_SOURCE on all systems matching the # wildcard, and that the wildcard does not include future systems # (which may remove their limitations). They mention _GNU_SOURCE to "re-enable" Linux extensions, so apparently went looking for the same thing on BSDs and found _NETBSD_SOURCE for NetBSD, _DARWIN_C_SOURCE for macOS... and __BSD_VISIBLE for FreeBSD I assume they started using _XOPEN_SOURCE for the wchar.h stuff and just followed the path of least resistance. I do note that the (new for 15?) cdefs(9) makes it clear that _BSD_SOURCE is the correct way to explicitly ask for everything now, though there doesn't seem to be any explicit support for that yet (basically, it's assumed unless one of the other mutually exclusive macros are defined). --------------WF10o1c7MsMLihyxeV7pRg8T Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
On 2025-03-20 05:55, Warner Losh wrote:


On Thu, Mar 20, 2025, 1:42 AM Stephen Hurd <shurd@freebsd.org> wrote:
The branch main has been updated by shurd:

URL: https://cgit.FreeBSD.org/src/commit/?id=415a0ce02c9ee2c15c7973b2dfbddda71f6344a2

commit 415a0ce02c9ee2c15c7973b2dfbddda71f6344a2
Author:     Stephen Hurd <shurd@FreeBSD.org>
AuthorDate: 2025-03-20 07:15:15 +0000
Commit:     Stephen Hurd <shurd@FreeBSD.org>
CommitDate: 2025-03-20 07:41:27 +0000

    Revert Make newly POSIX functions visible

    Summary:
    This reverts commit d7efac1be1441c122f7fb9de51a409172f21326c.
    This reverts commit 9d0eea9422d075c8a6924b33161d2d5abfb4072a.

    Some ports (specifically Python) define __BSD_VISIBLE themselves, so
    the change from __BSD_VISIBLE to __POSIX_VISIBLE >= 202405 makes them
    fail.

That's not legal. Defining __BSD_VISIBLE directly is illegal and won't work right. Can't work right and should likely be a compile time error. With am exp run to fix.

The Python commit that added it for the curious:

https://github.com/python/cpython/commit/abccf41a7d616cc950510ad4a3526b11e012ee24

22 years ago for 5.x

The root of their usage appears to be the use of _XOPEN_SOURCE 700 with the following comment:

# Some systems cannot stand _XOPEN_SOURCE being defined at all; they
# disable features if it is defined, without any means to access these
# features as extensions. For these systems, we skip the definition of
# _XOPEN_SOURCE. Before adding a system to the list to gain access to
# some feature, make sure there is no alternative way to access this
# feature. Also, when using wildcards, make sure you have verified the
# need for not defining _XOPEN_SOURCE on all systems matching the
# wildcard, and that the wildcard does not include future systems
# (which may remove their limitations).

They mention _GNU_SOURCE to "re-enable" Linux extensions, so apparently went looking for the same thing on BSDs and found _NETBSD_SOURCE for NetBSD, _DARWIN_C_SOURCE for macOS... and __BSD_VISIBLE for FreeBSD

I assume they started using _XOPEN_SOURCE for the wchar.h stuff and just followed the path of least resistance.

I do note that the (new for 15?) cdefs(9) makes it clear that _BSD_SOURCE is the correct way to explicitly ask for everything now, though there doesn't seem to be any explicit support for that yet (basically, it's assumed unless one of the other mutually exclusive macros are defined).

--------------WF10o1c7MsMLihyxeV7pRg8T--