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: Re: Missing snprintf in ucrt mingw + vc-refresh in find-file hook? Date: Tue, 13 Feb 2024 23:05:00 +0100 Message-ID: References: <86h6icp20d.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="36502"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: angelo.g0@libero.it, emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Feb 14 04:21:12 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 1ra5pd-0009H6-TN for ged-emacs-devel@m.gmane-mx.org; Wed, 14 Feb 2024 04:21:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ra5ox-00040c-Ry; Tue, 13 Feb 2024 22:20:27 -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 1ra0ts-0007sV-Gi for emacs-devel@gnu.org; Tue, 13 Feb 2024 17:05:12 -0500 Original-Received: from mail-db3eur04olkn2039.outbound.protection.outlook.com ([40.92.74.39] helo=EUR04-DB3-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 1ra0tq-0006wh-FF; Tue, 13 Feb 2024 17:05:12 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kTxDPWRE8NkU+ly1jg7JEG8PAGGwSf4ZXccbhdSjJz5DoYQ+tmZyqmuuBx5/mH/Z0tG6X9ruY5TH7TlTR2WPQ4s8ud2SDM0PxPsvvVsudd6kMOFBYaHlJs48r/Iyesz/BeE5EAmN5dwAsiH7zJ3G1gVYr5+I3oSM7SobpxEsESv7/VAjmN2FEEkiMr7KeJv+/5JGqKShtKdZXKQwxAyc6HqsCnGmOKnUl2HBj7RPlMeYUFASD0nat7EcmtFDWlpFyfhTjtvTp/gmKaO6TurB8naQxb48sgkN3IwQ0JZWLHBT23N4q3q8axfx5JImJT5K7iexX4gNo2A646J7iPejdQ== 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=gJo4bKifFVTFn8pkj+c5sPdtJUuU9Yb3APX+NKDVkZ8=; b=IWSMSyG/hbdANGen4zUswueF1yFmRJECgNuNz97bfnyGEXG5L8PeEcmO0qRPFq/6Z8S66aP1JmmclyAgx1q87ap8HvDcL7UP9Y+ZgYx12irWlbgcQ5p6FOt7/EtlueBYHFj7TQo3WaOkd9HuV1V1rv8TWTo76RRFkNXXWZtfQC3FAd/Lwq7vCh59lb9uLDEj83zm+AuL33QqcJRK/kuwyGm4PrR+sHzAZtdHSRNah82L+0f1gmMYHfgxg2dKOrmF8OTGeB7hxZdnf2+Zu2NboHEdzrfBj9Lzz4E4QBEYPzVX/G6RtA4NIc3SujzswMZx70BjCk6zx9aHF89X+eAfSA== 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=gJo4bKifFVTFn8pkj+c5sPdtJUuU9Yb3APX+NKDVkZ8=; b=MZXWcQa5IgH5L4nWtIq26OfmRUCk5xM9ZmxR3wENZM0a3F1Ur+fkRRyqqs+iqOAIIcf79b2uZ7uc9TkYcprbm0DMMKSCtqlIGF4fRGbL3zoivNjyxV9vEIJSZuL2IKo5wa4fXeYvTD+U5y8kWC1rvNq7Lr8gyXsA41MMwscoWeieYmuKRvCkjVFtdUDy35fScWzURPrTL5Uw47cEBO2yBfYxNvqDLVafXnHppRkaQIzgIJqGTuJltHZM+dkdWjD7HRbW+puT0AS9BGnb8K8IOESb+B50mKUmcgVUcz3EdKgU0iC3x9atW5KJgktmDXg7TChwic+rWWKOgNu+JPkurQ== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by DU0PR02MB7921.eurprd02.prod.outlook.com (2603:10a6:10:349::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.45; Tue, 13 Feb 2024 22:05:06 +0000 Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::1752:9b0:4c48:15f8]) by DU2PR02MB10109.eurprd02.prod.outlook.com ([fe80::1752:9b0:4c48:15f8%7]) with mapi id 15.20.7270.036; Tue, 13 Feb 2024 22:05:05 +0000 In-Reply-To: <86h6icp20d.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 13 Feb 2024 15:01:33 -0500") X-TMN: [el50hqyHZaFpNTrx91RXbk5jiR4i8VCP1XMvKwvy9Vs=] X-ClientProxiedBy: FR4P281CA0169.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:b7::15) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <865xysaulv.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|DU0PR02MB7921:EE_ X-MS-Office365-Filtering-Correlation-Id: 3b406eaf-2a0f-47ae-792e-08dc2cdfd5be X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: paTMJWi7Ffg1zNBpc883uE6DnIBa1l9L/e9LC8txuv6jhNcGrfQ/5cbre5INCbdxbRhDu0pLQfEbqnNUt7eH3M5rbVh3Waal4XM6jnjm1zQyeH94yOtuzdHb44c0Fy2ciW3JXeZy4HafeN/KnVBZEP3eKRQnEeNcI/ilsK756Iad3aZnjaSKxKuXkdH13vi+odFIAUAN9gIDFWm93URBUvCxLBOeM/TV/qRhJz+ry3s6blolUf7wURqkj9YAkii1LBw8C2JrOmBSVnaVsljcn9GMFp2tvcIIP6x2z5Lcn3Ysc4rU+uYb9rnYMOP8M2cPi6OQSjTy3etXyFw0HDJ2oBbKgjfZLaNlhOqvpSNdsjyU1nBAT7J7DDb0njZorD8o4hkIlgquu6T48aM62LfYsQwzroUSMXa40JSI0ru2ZDylZwBkZwbIWXam/wk+Kp+qBsy24bvGiamqANquyfq+iDoQU0rUolqu185ohSTzAEcVJXS1zDl+GrMHLg3FAxKE+qXIa21gI03eEwTLFR0PJ8Ojxh23nlkN5GDVpCNjfwBPK/Tc9Hi06D0D1gMxLzJh X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?Eg1NzNsm9vb1qxhgccCm/RL5Rvg9e6xaf4AjbZDK2Ogggi8/lAxZYslOkrd4?= =?us-ascii?Q?3N8rCJsHeHBkbo97ianoZgDv8HA08N+4jIc7k0x+EJV1/3m8ohUEEbAoBK58?= =?us-ascii?Q?MbDLB0BWdi5TaB1f0HEp8btjIyBjGvG9bWLEF+GGnm5Of97HmeUswnDD9CVr?= =?us-ascii?Q?G90U0w8PLGoa+HFz7WgLUuyUiNGmROb6ClVhx0L/Mz/VDGgi7+9+8HiUaYW+?= =?us-ascii?Q?DhGwyFk8s7zDFEx+sbpOkAqA3P6LNZjvn8UheExxuQxRb/L9JBQrI8gMpV6e?= =?us-ascii?Q?Za0d06dLl9R07pOgeyKkEynoibgJW0W6udtyKKU+5srEd2zb9H0GQ5ppAQ6s?= =?us-ascii?Q?YbGDH3O/c7NMNf/H2UQrTASSuLY6XSigKolg1NNwFUIlfcBs0Uo6AGxi6Vak?= =?us-ascii?Q?Ol0NXoyMvtfHSV8KiR1Ev28c1JZC8FmtoVXF7wsceCfQTUj6WVl5poJqA4XY?= =?us-ascii?Q?yaYwr8qfdnbZE1CCWq/CJ0cRS3O8T0z1q4Oa3TgN79N8NrqFh8cTMnvb43hv?= =?us-ascii?Q?3WhkqDElhq1sqRkNQ8xGoHBM/btB2kxGoNuF7pecjtkNMyKEEw30WSL/Slg1?= =?us-ascii?Q?81d6WMayxdgyb1mcnkrEuF6VssoY88mj7OY8d9SvzVf3vyDWO6oXvJ7FKPD+?= =?us-ascii?Q?1K X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 3b406eaf-2a0f-47ae-792e-08dc2cdfd5be X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 22:05:05.8524 (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: DU0PR02MB7921 Received-SPF: pass client-ip=40.92.74.39; envelope-from=arthur.miller@live.com; helo=EUR04-DB3-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, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-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: Tue, 13 Feb 2024 22:20:25 -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:316194 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Cc: emacs-devel@gnu.org, eliz@gnu.org >> Date: Tue, 13 Feb 2024 20:00:16 +0100 >> >> More than the patch, I also had to copy over cp.exe from msys/bin to ucrt64/bin, >> because the cp.exe included in ucrt runtime failed in autogen or configure; I >> don't remember, with message that --force flag is not implemented yet, when some >> script was installing git hooks. > > This seems to indicate that your system is misconfigured: when you run If they say that cp.exe does not support --force flag, it means it is for some reason incomplete. I actually looked in scripts to see what is using -f flag to cp to rewrite the script but didn't found it. So I had to use another cp executable. Option was to download EZports :), but it seemed like overkill in this case. > MSYS Bash to build Emacs, the MSYS's bin directory should be on PATH > _ahead_ of the MinGW bin directory, because Bash wants to run MSYS > ports, not MinGW (a.k.a. "native Windows") ports. Isn't that what their "shell launcher" does for me; sets the correct path(s) for all the forest of stuff they have? This is the path the tool itself sets up; nothing is modified by me; this is what echo $PATH shows: /ucrt64/bin:/ucrt64/bin/site_perl/5.32.1:/ucrt64/bin/vendor_perl:/ucrt64/bin/core_perl:/usr/local/bin:/usr/bin:/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/ This is what OS sees as the path: C:\Users\arthu>echo %PATH% C:\Program Files\Common Files\Oracle\Java\javapath;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Steel Bank Common Lisp\;C:\Users\arthu\AppData\Local\Microsoft\WindowsApps;C:\Program\emacs-29.2\bin;C:\Program\Java\jdk-21\bin; I have just added openssh, sbcl and java to the path :). > Copying MSYS programs into the MinGW bin directory is a bad idea Yes, I know; I don't do that at all; but I can't imagine that cp.exe is pulling crap load of libraries behind; it should be quite self-contained, and it worked. > will at some point bite you, so my recommendation is not to do so. In > general, my advice is to keep MSYS and MinGW executables separate, and > have separate environments for each one. In my setup, when I run the > MSYS Bash, the MSYS executables are found first, but when I run the > Windows cmd.exe it's the other way around. I only keep mingw in the system path; no msys at all; but now I removed everything msys/mingw/ucrt related while I was building Emacs to not pull in something wrong by a chance. There are three runtime involved, chances some executable from a wrong runtime gets involved is unfortunately not so small. >> Emacs seems to work as usual thus far, but the native compiler complains about >> missing function: >> >> Debugger entered--Lisp error: (void-function comp-write-bytecode-file) >> comp-write-bytecode-file("c:/Users/arthu/.emacs.d/eln-cache/30.0.50-ccd5287a/dired-auto-readme-d510bed9-ac3fa899.eln") >> emacs-lisp-native-compile() >> emacs-lisp-native-compile-and-load() >> funcall-interactively(emacs-lisp-native-compile-and-load) >> command-execute(emacs-lisp-native-compile-and-load) > > This should be fixed now on the master branch. > >> I also did got the message that Emacs is not functional at the end of the build: >> >> GEN ../../info/efaq-w32.info >> org.texi:15658: warning: @anchor should not appear on @item line >> org.texi:15671: warning: @anchor should not appear on @item line > > This is a harmless warning, so it shouldn't stop the build. I though so; but I wasn't sure. I am a bit suspicious about discarding those close_stream errors ad they do in the patch, but thus far it seems to work. >> make[2]: Leaving directory '/c/Users/arthu/repos/emsrc/ucrt-w64/doc/misc' >> make[1]: Leaving directory '/c/Users/arthu/repos/emsrc/ucrt-w64' >> make sanity-check make-target=all >> make[1]: Entering directory '/c/Users/arthu/repos/emsrc/ucrt-w64' >> *** >> *** "make all" succeeded, but Emacs is not functional. > > Maybe it's because of the problem with comp-write-bytecode-file. Could be. Anyway, that was what I needed to build it on ucrt runtime with GCC. Guys at msys are pointing out that their repo is bsd3 license and gpl compatible and thus free for all, so they are not sending in any patches. It is anyway just 3 ifdefs; less than 10 lines of code, so decide yourself if you are going to patch it in and test further or you prefer to keep Emacs as unsuported under ucrt runtime. Thanks for looking through this. /a