Subject: bug#72335: closed (Re: bug#72335: An attempt to fix UCRT64 build failure)

From: [email-masked] (GNU bug Tracking System)
Date: Tue, 11 Feb 2025 07:35:02 +0000

Your bug report

#72335: An attempt to fix UCRT64 build failure

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
72335: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=72335
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#72335: An attempt to fix UCRT64 build failure
From: Stefan Kangas <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], YI Yue <[email-masked]>
Date: Mon, 10 Feb 2025 23:34:17 -0800
List-Id: <debbugs-submit.debbugs.gnu.org>

Eli Zaretskii <[email-masked]> writes:

> tags 72335 wontfix
> thanks
>
>> Date: Sun, 28 Jul 2024 22:55:48 +0900
>> From:  "YI Yue" via "Bug reports for GNU Emacs,
>>  the Swiss army knife of text editors" <[email-masked]>
>>
>> I occasionally try to compile Emacs to get the latest commits. But on Windows, I
>> only use Mingw64 because it's the only one officially supported by Emacs.[1]
>> When I try to build Emacs in MSYS2/UCRT64, I'll get these outputs:
>>
>> ./temacs --batch  -l loadup --temacs=pbootstrap \
>>         --bin-dest '/d/user/yy/emacs-build/bin/' --eln-dest '/d/user/yy/emacs-build/lib/emacs/31.0.50/'
>> D:\user\yy\emacs-master\src\temacs.exe: Write error to standard output: No such file or directory
>
> The UCRT build of Emacs on MS-Windows is not officially supported.
> And it will remain unsupported until some volunteer steps forward to
> take the responsibility for testing, maintaining, and developing Emacs
> on Windows when linked with UCRT.  I asked several times for such a
> volunteer, but no one picked up the gauntlet.

I'm therefore closing this bug report.

Subject: An attempt to fix UCRT64 build failure
From: "YI Yue" <[email-masked]>
To: "bug-gnu-emacs" <[email-masked]>
Date: Sun, 28 Jul 2024 22:55:48 +0900
List-Id: <debbugs-submit.debbugs.gnu.org>

Hello, everyone

I occasionally try to compile Emacs to get the latest commits. But on Windows, I
only use Mingw64 because it's the only one officially supported by Emacs.[1]
When I try to build Emacs in MSYS2/UCRT64, I'll get these outputs:

./temacs --batch  -l loadup --temacs=pbootstrap \
        --bin-dest '/d/user/yy/emacs-build/bin/' --eln-dest '/d/user/yy/emacs-build/lib/emacs/31.0.50/'
D:\user\yy\emacs-master\src\temacs.exe: Write error to standard output: No such file or directory

MSYS2 do provides a patch[2] that do something about function
`close_output_streams' in src/sysdep.c. By applying it, I can get these results:

***
*** "make all" succeeded, but Emacs is not functional.
***

Sometimes I'll check emacs-devel to see if there are any progress in solving
this problem, such as this[3]. Two days ago I saw Pip Cet's "MPS: Win64
testers?"[4] and it inspired me that the problem may come from `init_ntproc' in
src/w32.c. After seeing UCRT's documentation[5], I think maybe we can use
`_fcloseall' instead of `fclose'? By using this, I get no error above when building 
in MSYS2/UCRT64.

I have little knowledge of MSVCRT and UCRT, it just works :)

Here is my patch, regards.

[1]: https://lists.gnu.org/archive/html/help-gnu-emacs/2022-01/msg00441.html
[2]: https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-emacs/001-ucrt.patch
[3]: https://lists.gnu.org/archive/html/emacs-devel/2024-02/msg00744.html
[4]: https://lists.gnu.org/archive/html/emacs-devel/2024-07/msg01055.html
[5]: https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/fclose-fcloseall