From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Arthur Miller Newsgroups: gmane.emacs.devel Subject: Compiling in mingw-ucrt runtime Date: Thu, 22 Feb 2024 01:01:17 +0100 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15689"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Feb 22 07:16:22 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 1rd2NY-0003qj-AA for ged-emacs-devel@m.gmane-mx.org; Thu, 22 Feb 2024 07:16:21 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rd2Mr-0006de-FC; Thu, 22 Feb 2024 01:15:38 -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 1rcwbZ-0008M5-EF for emacs-devel@gnu.org; Wed, 21 Feb 2024 19:06:25 -0500 Original-Received: from mail-am6eur05olkn20801.outbound.protection.outlook.com ([2a01:111:f403:2e12::801] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rcwbW-00059i-3t for emacs-devel@gnu.org; Wed, 21 Feb 2024 19:06:24 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=h5CszOEMVoGFEFvrhEOvAdfobWPxS7JmuZWqqfwqDM4Te2Yejs8Uwt/HXRQDdHkalxx/vYmvr1btkH4I0snfu1eFaaoljDqNu2yo9z3xUbFK4xsuzOTIn9s7dVO3Cizr49YEB7dV0mW3tHwhLBdKt4wiWXP7SL8BdK8kMDUQdifjlOiOOiMhfsrLMXfIBc4dIKqiDwPLdBgMNsAAx51iTPi9q4dEBvUDgbPjz16bFeGvQvM98ZgVOGggjeDG2FgEck4NApC78KScETzk1VoVV7Spht7XtNFYJneuOA4Oosxld3GGCzEAZPebTP6pvo/UoSWsz2JzzrzI7AgRrem6gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VrTjsut1MbUzJFcqsch88MiFvkZVQZdROmwlNgRUvPs=; b=Mny2omnJZAbrUUQZTh0gJRqy+NwYzpFTW7aBh/1k4/HZYPpiq3rGts7rJ1ps+YCV/2cNIEuuLUuADR09o5/7lmHD6npd6twCU2xzVZ37HoQheO6Ewx0i7DLbW0PwNKEbgUUkDwf5RQ8k39LUbYFiZ30A2BM+S3Sz2ufIW9x+NCXBFcsSLBS82VZErVWx2D4xe1Vo6BHxgeTlG5ke7/YL9MOLh3NMlCc6rFy6SEENTJLZiUrpumBpg8ZW2Tewi9zN9VsXjUoavd+uNeKOMTDHiy4FaFyVOBL+H7Cd3HDzxlX3qM9uFMFvM9DYUFmuvkQw4MYt3gGsPfX8F2pGdvdolA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VrTjsut1MbUzJFcqsch88MiFvkZVQZdROmwlNgRUvPs=; b=pTegUp1mSKv8pldbKxm3zqaiz/RoyzRocd+8eYVo/9nKr7qREVgmQ/pIDF4GpFBG8Hr3Z+PcTmcKoX9XIMaD+1Wk5ueSMEOizrK7pk0FatcEsjunmTOpGDybLnpFUaw7ma/O3DKuV2R1adVNf/zNioAxa9aTN3DMX0TuJQOFd8or/DlWnFkZVaxl9blhHiH+impsyyilRg7zyN/dRuY1k7weEyl8/wuh0QRnyAvg8yiPN+CxbfL9DCheG7GCWyVpDGnSnnqkP3CGMo8BI//n+iVrxjBPxUcK2huEyhQTNYpN5IXizbr82M7pOI5SQkXrZevLDlx2P7w/z47CCRRARw== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by DU0PR02MB8340.eurprd02.prod.outlook.com (2603:10a6:10:3b8::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7316.21; Thu, 22 Feb 2024 00:01:16 +0000 Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b4ad:e01a:924c:52e]) by DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::b4ad:e01a:924c:52e%7]) with mapi id 15.20.7316.018; Thu, 22 Feb 2024 00:01:16 +0000 X-TMN: [Hhjmf/Gthf/9H0U2Z7jO/cPZaJcdxtby] X-ClientProxiedBy: OS6P279CA0016.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:33::6) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <86plwpgyeq.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|DU0PR02MB8340:EE_ X-MS-Office365-Filtering-Correlation-Id: 60ffd234-a6c1-47e1-2a61-08dc333963aa X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zP+esV2Vvt9GMhTOV833bocGGTfx7Irot3cRbLoGIdXANfgoQSk2MXw4Rv2MH3hyYoZEYecSWn528OETsaNuaO5g1EH1n+gCsskMe60lY3E1BxpPluGo8mz0/VEhgNcjN4msP5cNWi3DYCTwRiBJtKMeof79OfbSSQvmc2JhrfhuijH3D5+dcTzcvV8PbLpOwXcpt+QotTgdWpeN4n6QHUhD098/+mppAbvXWfZAkzOmLlwUp1+3iPK6d/W6+LlrTjJHinDA5xK4uHc1T8mlmlcaWh7cBjJrTgC2pMcupiOex08HaBYb2c7wmDn55OcXqY8bU40d++GhsJKcE1pdDYPOQXbwR7t4sUkVeN9xes52s56ZWldV3UyzH+85fhBk3cuMdg1k1t88fh9z8lzuLQXqtpCycceXpa30EP2F7DOC8eBCMztKwnOrJ/BqrmnkxlVI2MVfCDZpIvH30ALc9Q3D4poDqchHyc8e4TKNbOtGUEighcCIonsxfMR694fGfvlpolQExqNZN/9T3TKBW+MBxsSzhkC9uwljeI7fqNNjwQy3kHcfmKo1zdGswrvM2z5jCF02fM1Eb6nbl0jn0itZWNVH2haLufAzVWZP3I5J7KESrlbPR4zw00hm2l1K X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?JvE6jyvLdpLOd9nkurdVufSUATuVFMZm2sojnM774QT0ji4MPtqUuax22zRu?= =?us-ascii?Q?335gfovaSQ7T3jZucbL8fJjRqUs/ggVpP2HXS7oihGkq8YLdO3X0dGN5Mjnj?= =?us-ascii?Q?jXeFG0Heu/0GBFavW5sMd25hDt1S45jLYwRBpVQMuOQrGnn5+cv1eFM1F7Hb?= =?us-ascii?Q?8vBYvt/PvXn8OZMYrpZTKy/vtRA5fhSSUoPKf2QdQ1uJwfZjiHDOSoGqjuUd?= =?us-ascii?Q?wS1qOD9E3hSdBqy9G7h63AjEwMnT86kE5PM9qX7OLDovurgCDLvIjn0r1Cl7?= =?us-ascii?Q?7HVIcA0rjk9Ye2ZL4vQmJM9RKS0Aze0XMiH+LriUBpBXJimlqwGc2wQHTf2+?= =?us-ascii?Q?0Ooc8MTy1FLIJoy5NBgygtITJDFVjNl9zxpWYuLChQOXe/PBswPZPeBa0RFW?= =?us-ascii?Q?YZu4ivL/LQoTpi0/ux58QJSEWVb6V4FQDXTPkWn2GkN6M6nJIy7f+JB9PKyB?= =?us-ascii?Q?Gy505F/EKLjfNpQmXJMkhjwWfm1Yr+AH4HbcuQUIN2u1zB5IlxUNMjJO816N?= =?us-ascii?Q?qRLRBCgYluE6l11IZr3N8ueG9bzNCpkaIVZXjVgU/+gVQ8Y6oin7UIxJhW1x?= =?us-ascii?Q?/0I9pnZLiuqQ+MDrnTnxujv4QYJna4DHmiAvWunOldiWHritXhPZSIWcKKcB?= =?us-ascii?Q?zq X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 60ffd234-a6c1-47e1-2a61-08dc333963aa X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Feb 2024 00:01:16.2217 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR02MB8340 Received-SPF: pass client-ip=2a01:111:f403:2e12::801; envelope-from=arthur.miller@live.com; helo=EUR05-AM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Thu, 22 Feb 2024 01:15:29 -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:316436 Archived-At: --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Check-for-actuall-errno-ignore-EINTR.patch >From ffa8edca7bb60ed06f23f769a5fac723b3bc020d Mon Sep 17 00:00:00 2001 From: Arthur Miller Date: Thu, 22 Feb 2024 00:02:51 +0100 Subject: [PATCH] Check for actuall errno && ignore EINTR --- nt/cmdproxy.c | 3 +++ src/sysdep.c | 7 +++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/nt/cmdproxy.c b/nt/cmdproxy.c index 0500b653bb2..82592404d4c 100644 --- a/nt/cmdproxy.c +++ b/nt/cmdproxy.c @@ -38,6 +38,9 @@ #define DEFER_MS_W32_H #include /* strlen */ #include /* isspace, isalpha */ +#ifdef _UCRT +#define _snprintf snprintf +#endif /* We don't want to include stdio.h because we are already duplicating lots of it here */ extern int _snprintf (char *buffer, size_t count, const char *format, ...); diff --git a/src/sysdep.c b/src/sysdep.c index 3a6829dd27a..5d294ca1bdf 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -2981,7 +2981,7 @@ close_output_streams (void) fflush (stderr); fflush (stdout); #else /* !__ANDROID__ */ - if (close_stream (stdout) != 0) + if (close_stream (stdout) != 0 && errno && (errno != EINTR)) { emacs_perror ("Write error to standard output"); _exit (EXIT_FAILURE); @@ -2993,7 +2993,10 @@ close_output_streams (void) if (err | (ADDRESS_SANITIZER ? fflush (stderr) != 0 || ferror (stderr) : close_stream (stderr) != 0)) - _exit (EXIT_FAILURE); + { + if (errno && (errno != EINTR)) + _exit (EXIT_FAILURE); + } #endif /* __ANDROID__ */ } -- 2.43.2 --=-=-= Content-Type: text/plain I was a bit curios what is going on there. It turnes out, at least as I understand, that the errors were not real errors, in most cases, so it seems *almost* legit to brush them under carpet. I printed out errors and what I saw were endless "Write error to standard output: no error" messages when native compiler run its batch jobs (amongst other). Seems like close_stream in ucrt runtime does not return real errno but something else. Just checking if errno was set reduced almost everything; and I found that comment in posix_close aboutt EINTR. However; I am still not able to build emacs wihtout trolling away exit on failure, because temacs fails. I get this error: cp -f temacs.exe bootstrap-emacs.exe rm -f bootstrap-emacs.pdmp ./temacs --batch -l loadup --temacs=pbootstrap \ --bin-dest /ucrt64/bin/ --eln-dest /ucrt64/lib/emacs/30.0.50/ C:\Users\arthu\repos\emsrc\ucrt-02-21\src\temacs.exe: Write error to standard output: No such file or directory make[2]: *** [Makefile:1014: bootstrap-emacs.pdmp] Error 1 Question is which file or directory? Dump file? Bad path? Bad encoding? Something in loadup.el or elsewhere? If I comment away exit on failure as they do in mingw patch, than everything builds and seemnigly works. However I have experienced one crash where system killed Emacs, similar as those I have seen with the version from gnu ftp (29.2_1). How do I debug temacs bootstrap? --=-=-=--