From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: MinGW build on master fails with Error 127 Date: Sat, 24 Dec 2022 17:58:43 +0100 Message-ID: <87k02g20xo.fsf@telefonica.net> References: <83wn6wr5oz.fsf@gnu.org> <0c9519c9-add7-9fb1-ac7f-2f20e1916d65@bluewin.ch> <83tu20r4y7.fsf@gnu.org> <01b7362d-7d60-3054-5590-d4dbbcda76d7@bluewin.ch> <83r0x4r490.fsf@gnu.org> <837cyh71ft.fsf@gnu.org> <832966a5-bd27-76f9-4757-a8c246eca416@bluewin.ch> <835ye06ex7.fsf@gnu.org> <87sfh424ya.fsf@telefonica.net> <83y1qw4x8w.fsf@gnu.org> <87o7rs22yn.fsf@telefonica.net> <83v8m04un9.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13848"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Cancel-Lock: sha1:CCqpLOMyWB3N2AEECXGJDd0r1sE= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Dec 24 18:10:31 2022 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 1p982Y-0003VG-IQ for ged-emacs-devel@m.gmane-mx.org; Sat, 24 Dec 2022 18:10:30 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9828-0005EI-Qi; Sat, 24 Dec 2022 12:10:04 -0500 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 1p97rQ-0001EA-3F for emacs-devel@gnu.org; Sat, 24 Dec 2022 11:59:00 -0500 Original-Received: from ciao.gmane.io ([116.202.254.214]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p97rO-0007Sq-7U for emacs-devel@gnu.org; Sat, 24 Dec 2022 11:58:59 -0500 Original-Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1p97rJ-000ANT-9n for emacs-devel@gnu.org; Sat, 24 Dec 2022 17:58:53 +0100 X-Injected-Via-Gmane: http://gmane.org/ Received-SPF: pass client-ip=116.202.254.214; envelope-from=ged-emacs-devel@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sat, 24 Dec 2022 12:10:03 -0500 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:301868 Archived-At: Eli Zaretskii writes: > And as long as I have your attention: what about the switch to UCRT64? > Does Emacs need something in its Makefile's to specify linking against > MSVCRT, even though UCRT64 is the default? The information at > > https://www.msys2.org/news/#2022-10-29-changing-the-default-environment-from-mingw64-to-ucrt64 > > doesn't provide any details about that. See https://github.com/msys2/MINGW-packages/tree/master/mingw-w64-emacs There is a patch specific for UCRT support. It's quite simple although the workaround for close_stream doesn't inspire confidence, hints that there might be subtle differences on the behavior of C runtime functions. This is the relevant commit message: commit 01be90ce74e3b69e7b03ab886d5f4ac59da0f646 Author: Christoph Reiter Date: Thu Jun 23 21:34:12 2022 +0200 emacs: some hacky patches to make it work on ucrt64 for both stdout and stderr fclose fail during atexit as if they were already closed. the function in theory has a workaround for that in that it will continue if errno is EBADF, but fclose doesn't set that on Windows. This shows at least what is missing/broken if upstream wants to have a look. Of course the Emacs UCRT build lacks the real-world testing that the Mingw-w64 one has, so we need to wait for bug reports.