From nobody Thu Sep 11 16:09:19 2025 X-Original-To: freebsd-current@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 4cN2Z60Vglz66rb5 for ; Thu, 11 Sep 2025 16:09:34 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (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 did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4cN2Z53CJlz3GWn; Thu, 11 Sep 2025 16:09:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 58BG9JDe067670; Thu, 11 Sep 2025 19:09:22 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 58BG9JDe067670 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 58BG9JXu067669; Thu, 11 Sep 2025 19:09:19 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 11 Sep 2025 19:09:19 +0300 From: Konstantin Belousov To: Alan Somers Cc: Dag-Erling =?utf-8?B?U23DuHJncmF2?= , Mark Millard , FreeBSD Current , Konstantin Belousov Subject: Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88] Message-ID: References: <1F6A4621-1505-4F78-97C6-85EA556B2165.ref@yahoo.com> <1F6A4621-1505-4F78-97C6-85EA556B2165@yahoo.com> <86bjnhi7s2.fsf@ltc.des.dev> <86zfb1ghj7.fsf@ltc.des.dev> List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4cN2Z53CJlz3GWn On Thu, Sep 11, 2025 at 09:45:19AM -0600, Alan Somers wrote: > On Thu, Sep 11, 2025 at 9:01 AM Dag-Erling Smørgrav wrote: > > > Alan Somers writes: > > > Dag-Erling Smørgrav writes: > > > > Tell that to the Rust developers. They have been repeatedly warned > > > > against using readdir_r(3) for years, as far back as 2016. > > > Have they? Looking at rust's github page, I see discussions about > > > using readdir_r on Fuchsia and Linux, but nothing about BSD. > > > > If you look at these tickets, there are people pointing out that > > readdir_r() doesn't work correctly even on platforms where it isn't > > formally deprecated. The Rust developers chose to fix the Linux case > > because it produced a link-time warning and ignored the rest. That's on > > them. > > > > They also seem to be providing their own prototype for readdir_r(), > > which suppresses the deprecation warning they should be getting on > > FreeBSD 15, and turns the issue from a failure to compile into a failure > > to link. That's also on them. > > > > Where do you see that? I suppose you must be talking about this line in > libc. That's not due to anything special about readdir_r; it's just the > way that Rust links to _every_ libc function. There is a CI step that > ensures these FFI definitions are accurate. > https://github.com/rust-lang/libc/blob/61b722e2517775cea98428702710ee9ef00f02a0/src/unix/mod.rs#L1769C22-L1769C23 > > > > > > > possibly with the aid of installing misc/compat14x > > > > That won't make any difference since readdir_r() is still in our libc. > > > > DES > > -- > > Dag-Erling Smørgrav - des@FreeBSD.org > > > > There's another problem that we haven't discussed, which is the ability to > run older Rust toolchains. Even if we fix Rust 1.89.0 to no longer use > readdir_r, older versions will continue to do so. And Rust developers > frequently must test with older toolchains. For example, any change to > Rust's libc requires testing with version 1.63.0, released in August 2022. > We can't remove readdir_r without breaking all of those workflows. We > could probably remove the prototype, but not the function itself. Binaries that were succesfully linked, continue to work. If you take any binary that already used readdir_r@FBSD_1.5, it is unchanged. Symbol is there, but the default version of it not.