Date: Thu, 11 Sep 2025 10:09:53 -0600 From: Warner Losh <imp@bsdimp.com> To: Alan Somers <asomers@freebsd.org> Cc: Toomas Soome <tsoome@me.com>, FreeBSD Current <freebsd-current@freebsd.org> Subject: Re: git: d549de769055 - main - libc: Remove readdir_r(3) [This broke building rust 1.88] Message-ID: <CANCZdfone23WmqjLPFDx5QdcswpFpGDS2rA75f3LsSnykJubng@mail.gmail.com> In-Reply-To: <CAOtMX2gS54kMJMsudth5AzCSWzELgP5o8%2B8gQ5ac2P3mcSVG%2BA@mail.gmail.com> References: <1F6A4621-1505-4F78-97C6-85EA556B2165@yahoo.com> <86bjnhi7s2.fsf@ltc.des.dev> <CAOtMX2gJJ-wGtK3%2BQwyz_eODYWK6pwaMA6gbnN74Pvqc1QW6Mw@mail.gmail.com> <86zfb1ghj7.fsf@ltc.des.dev> <aMLmbXgsjUm7GqEr@nuc> <C79DD894-11FD-4919-B3EE-147978D36AF8@me.com> <CAOtMX2gS54kMJMsudth5AzCSWzELgP5o8%2B8gQ5ac2P3mcSVG%2BA@mail.gmail.com>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] On Thu, Sep 11, 2025 at 9:48 AM Alan Somers <asomers@freebsd.org> wrote: > On Thu, Sep 11, 2025 at 9:45 AM Toomas Soome <tsoome@me.com> wrote: > >> >> >> On 11. Sep 2025, at 18:10, Mark Johnston <markj@FreeBSD.org> wrote: >> >> On Thu, Sep 11, 2025 at 05:01:16PM +0200, Dag-Erling Smørgrav wrote: >> >> Alan Somers <asomers@freebsd.org> writes: >> >> Dag-Erling Smørgrav <des@freebsd.org> 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. >> >> >> It doesn't really matter whose responsibility it is. If rust can't be >> compiled on FreeBSD after a FreeBSD change, then it's up to us to fix >> it. The purpose of FreeBSD, like any other useful OS, is to run the >> software that people want to run. >> >> +1 to Alan's request to back out the change for now. >> >> >> >> How about putting up pull request for rust to fix it?;) >> > > That should certainly be done. I'll try to do it this weekend, if I have > time. However, the need to revert this change will remain. FreeBSD 15 > needs the ability to run both current and old Rust toolchains. > So for current rust: it needs a pull request despite the revert. Rust is simply wrong here, due to their choices, and that has to be unwound in their code base. That's non-negotiable. We learned with the FreeBSD11 ABI troubles that we must be more proactively involved to see changes through to the end with Rust or the long legacy that creates problems for us. Here the risk extends beyond the rust ecosystem because we must continue to expose a broken-by-design interface to newly built code. Old rust toolchains run fine on 15. Regression testing can be done on those, but that's not a fully desirable answer. But t's only previously built rust toolchains that still run. Newly built ones do not. That's a problem. So, for building these old toolchains anew, we can't support them indefinitely. There needs to be a transition period for building old toolchains. We're in that now that the base change has been reverted. But the question is: How far back does Rust test? How old are the toolchains they do A/B testing against today? Is it 3 months? 6 months? 12 months? That will tell us the timeline we need to support this configuration. Given both the importance of Rust, and "history" we owe it to ourselves to be intentional about what we do here. Warner [-- Attachment #2 --] <div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Thu, Sep 11, 2025 at 9:48 AM Alan Somers <<a href="mailto:asomers@freebsd.org">asomers@freebsd.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Sep 11, 2025 at 9:45 AM Toomas Soome <<a href="mailto:tsoome@me.com" target="_blank">tsoome@me.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><br id="m_9041160432689891738m_895730608682361800lineBreakAtBeginningOfMessage"><div><br><blockquote type="cite"><div>On 11. Sep 2025, at 18:10, Mark Johnston <markj@FreeBSD.org> wrote:</div><br><div><span style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">On Thu, Sep 11, 2025 at 05:01:16PM +0200, Dag-Erling Smørgrav wrote:</span><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><blockquote type="cite" style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none">Alan Somers <<a href="mailto:asomers@freebsd.org" target="_blank">asomers@freebsd.org</a>> writes:<br><blockquote type="cite">Dag-Erling Smørgrav <<a href="mailto:des@freebsd.org" target="_blank">des@freebsd.org</a>> writes:<br><blockquote type="cite">Tell that to the Rust developers. They have been repeatedly warned<br>against using readdir_r(3) for years, as far back as 2016.<br></blockquote>Have they? Looking at rust's github page, I see discussions about<br>using readdir_r on Fuchsia and Linux, but nothing about BSD.<br></blockquote><br>If you look at these tickets, there are people pointing out that<br>readdir_r() doesn't work correctly even on platforms where it isn't<br>formally deprecated. The Rust developers chose to fix the Linux case<br>because it produced a link-time warning and ignored the rest. That's on<br>them.<br><br>They also seem to be providing their own prototype for readdir_r(),<br>which suppresses the deprecation warning they should be getting on<br>FreeBSD 15, and turns the issue from a failure to compile into a failure<br>to link. That's also on them.<br></blockquote><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">It doesn't really matter whose responsibility it is. If rust can't be</span><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">compiled on FreeBSD after a FreeBSD change, then it's up to us to fix</span><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">it. The purpose of FreeBSD, like any other useful OS, is to run the</span><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">software that people want to run.</span><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"><span style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none;float:none;display:inline">+1 to Alan's request to back out the change for now.</span><br style="font-family:Hack-Regular;font-size:12px;font-style:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration:none"></div></blockquote></div><br><div><br></div><div>How about putting up pull request for rust to fix it?;)</div></div></blockquote><div><br></div><div>That should certainly be done. I'll try to do it this weekend, if I have time. However, the need to revert this change will remain. FreeBSD 15 needs the ability to run both current and old Rust toolchains.</div></div></div></blockquote><div><br></div><div>So for current rust: it needs a pull request despite the revert. Rust is simply wrong here, due to their choices, and that has to be unwound in their code base. That's non-negotiable. We learned with the FreeBSD11 ABI troubles that we must be more proactively involved to see changes through to the end with Rust or the long legacy that creates problems for us. Here the risk extends beyond the rust ecosystem because we must continue to expose a broken-by-design interface to newly built code.</div><div><br></div><div>Old rust toolchains run fine on 15. Regression testing can be done on those, but that's not a fully desirable answer. But t's only previously built rust toolchains that still run. Newly built ones do not. That's a problem.</div><div><br></div><div>So, for building these old toolchains anew, we can't support them indefinitely. There needs to be a transition period for building old toolchains. We're in that now that the base change has been reverted. But the question is: How far back does Rust test? How old are the toolchains they do A/B testing against today? Is it 3 months? 6 months? 12 months? That will tell us the timeline we need to support this configuration. Given both the importance of Rust, and "history" we owe it to ourselves to be intentional about what we do here.</div><div><br></div><div>Warner </div></div></div>help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfone23WmqjLPFDx5QdcswpFpGDS2rA75f3LsSnykJubng>
