From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Pip Cet Newsgroups: gmane.emacs.devel Subject: Re: MPS: Win64 testers? Date: Sun, 28 Jul 2024 20:22:40 +0000 Message-ID: References: <86h6ca1xfz.fsf@gnu.org> <867cd61412.fsf@gnu.org> <86y15lzjg6.fsf@gnu.org> <86ttg9zgpb.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19412"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, rms@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jul 29 04:22:38 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1sYG21-0004rL-3P for ged-emacs-devel@m.gmane-mx.org; Mon, 29 Jul 2024 04:22:37 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sYG15-00071S-Ru; Sun, 28 Jul 2024 22:21:39 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYAPq-0005zT-SO for emacs-devel@gnu.org; Sun, 28 Jul 2024 16:22:50 -0400 Original-Received: from mail-4316.protonmail.ch ([185.70.43.16]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sYAPo-0006zC-KH; Sun, 28 Jul 2024 16:22:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1722198165; x=1722457365; bh=1ycUqtyL0DlBJKOvjMd7qmYsESQcm/o147fH7Kc4cG4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=LQKQLwtQ5D/99yE7kta8UaKhse36C2ne1ocMUpsAkUwL0zuk9ZZjQAp8IHfij1AB2 +ikSw6CzJREzSpzataZtnal3UV0nAWgr2kPraK7Iz9oY7jkQZW+NeZQ+lw724DUZYx K7xky/UVoPbK9Z67TUJiPhjCyHACZp8tMR38kmPfEJMbHKC9jCgf3nc5oIjB1AV0iz 98x88M84X1M5lUVAWv7F8zP+CHUB+/JFUS82fnXWh5QFp6CScNJVfToRemZJXtzCMS bXIJZ0ldV8wmYnlMJ62CC89RQFIA89P42Md+iyx3v/PmvSppqClRVCePy8F5XK0Pn8 ofdh5PbtfDHtg== In-Reply-To: <86ttg9zgpb.fsf@gnu.org> Feedback-ID: 112775352:user:proton X-Pm-Message-ID: 6b290fa29f892e27dc4505a25ec96fc14c9b1a63 Received-SPF: pass client-ip=185.70.43.16; envelope-from=pipcet@protonmail.com; helo=mail-4316.protonmail.ch X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 28 Jul 2024 22:21:37 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:322181 Archived-At: On Sunday, July 28th, 2024 at 15:20, Eli Zaretskii wrote: > > Date: Sun, 28 Jul 2024 15:00:52 +0000 >=20 > > From: Pip Cet pipcet@protonmail.com > > Cc: emacs-devel@gnu.org, "rms@gnu.org" rms@gnu.org > >=20 > > > It seems to be doing the same as MSVCRT, at least if the UCRT sources > > > available out there are to be believed. > >=20 > > By my reading of the source code I found, it's doing the same as Wine, = not as MSVCRT. >=20 > If someone steps through that code in the UCRT build and reports that > fdopen returns a different FILE pointer, I will believe you. I've verified this by running a GitHub action (I won't provide a link becau= se it's probably impossible to use without running proprietary GitHub JavaS= cript), though I couldn't work out how to make clang link against msvcrt ra= ther than its own libraries. The result of=20 printf("%p\n", stdin); fclose(stdin); int fd =3D _open ("nul", _O_RDWR); printf("%d =3D 0\n", fd); FILE *f =3D _fdopen (fd, "r"); printf("%p =3D %p\n", stdin, f); return 0; is, for a MINGW32-built msvcrt binary on windows-latest: 761f7600 0 =3D 0 761f7600 =3D 761f7600 but, for a UCRT64-built ucrt binary on windows-latest: 00007FF8E7E9E4A0 0 =3D 0 00007FF8E7E9E4A0 =3D 000001F74AFF5660 > > > Is there any way for a program running on Wine to detect that this is > > > what happens? like some special version number or something? If so, > > > I'd just avoid all that code in init_ntproc on Wine, since leaving th= e > > > standard streams inheritable is a much smaller trouble than losing th= e > > > standard streams. > >=20 > > I don't think we should have Wine-specific workarounds, particularly no= t for such questionable code. IIUC, Wine discourages attempts of programs t= o detect whether they're running on Wine or Microsoft Windows. >=20 >=20 > We don't have to behave like Wine intends us to behave. We have our > own considerations. So I don't really care whether Wine endorses > detection of Wine, if we decide we need that. Let's see whether the Wine people want to provide bug-for-bug compatibility= in this case first? > > > > As for the code in question, if I understand it correctly, the curr= ent Windows idiom would be simply (I assume _open_osfhandle clears the flag= ?): > > > >=20 > > > > SetHandleInformation (GetStdHandle (STD_INPUT_HANDLE), HANDLE_FLAG_= INHERIT, 0); > > >=20 > > > I'm not sure you can do this without closing the stream, since the > > > program has already started by that time. And SetHandleInformation is > > > only available since Windows 2K, so we'd need to call it through a > > > function pointer. > >=20 > > Thanks. Microsoft doesn't appear to provide version information pre-Win= dows-2000... >=20 > I use this resource to overcome the deficiencies of the official docs: >=20 > http://winapi.freetechsecrets.com/win32/ Thanks for the link! > > > Not sure if that is justified just to support Wine > >=20 > > And UCRT, if and when the time comes. >=20 > If that's the same problem, which we are not yet sure. Of course. > And, as I > said, support for UCRT will only become official if someone volunteers > to come on board and handle that build. That's what I meant by "if and when the time comes". > > And any other implementation of the Windows API that doesn't provide bu= g-for-bug compatibility with MSVCRT. > > For now, only the MSVCRT support is official. Of course, and I think it's more likely it will cease being official than o= ther builds becoming official. > > Wine is the only significant free implementation of the Windows API, so= I disagree with the "just". If I understand RMS correctly, whether there i= s a free implementation of an OS is an important factor in deciding to redi= rect resources to supporting it in GNU software. > =20 > Such decisions can only be relevant if there are resources to allocate > and redirect. I think the community of Emacs developers decides by consensus (or bickerin= g) what to work on. My understanding was that we're considering whether to = stop working on at least some variants of the Windows port. > Since we don't have them, this is entirely academic. Well, I disagree. Official guidance by the GNU Emacs project does have some= influence on what volunteers will work on. I consider that a resource. > For now, the only person who actively works on the Windows port is > myself, and I'm unable to support UCRT, for more than one reason. Are you working on MINGW64 systems at all, or is it mingw exclusively? Pip