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 11:44:43 +0100 Message-ID: References: <86zfw5rbpb.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="7874"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Feb 13 13:00:45 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 1rZrSu-0001oC-Hu for ged-emacs-devel@m.gmane-mx.org; Tue, 13 Feb 2024 13:00:45 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rZrSB-0000Qb-LL; Tue, 13 Feb 2024 06:59:59 -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 1rZqHV-0006C2-NE for emacs-devel@gnu.org; Tue, 13 Feb 2024 05:44:53 -0500 Original-Received: from mail-he1eur04olkn2025.outbound.protection.outlook.com ([40.92.73.25] helo=EUR04-HE1-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 1rZqHT-0003Cx-OJ; Tue, 13 Feb 2024 05:44:53 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=d5c4zArmSWKMWMNiUd8v4xBpJprSmzBbdFQPB1EereZWNX595jlRfXNaa2e3wxj1hKuLbEz/fJcfSKXleQ6Gx1kcOECkbmlvklmyZUZKmZYxZFP0t/ytTxkNGFTWWPygOfNXftc7ezI64dImzMSkysNbACcgKDap6gxCMKdMD/sqqTuaKgJWup1QF/IVpxdeWNoTPPXQMMjXKoW/K6Hzj7mNfXXVv/3A5irhGxEEDo1op50bpGTsP9BV2tGxIOUCbhIEpLaRyqRolSbtJ1jMqDB+cMoCMf9o2zGiUiFhfnNj051wYKgikqJwD0ocTpDxPELxEFjTs/3pF6uG/v9JHQ== 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=hhgipk/mHNMvAOGYdvtMeCeATfd1XVTRK+8oZSerzLo=; b=AYhmWok7t6uLxUtKhUU+aNMw66d4/8mVxgiHJw9vsQW3s5dnN3Kw/jPtAP+oosFqhgqK6WsS1t5o+F7wUkv1eK1/MTuRLxNmdUDDaQL2G2t98kCAn8cvooFk053Xi1dWIMcALPdIT7NBcPdAK4Plhfvtc+/ZQLvRZ5c5yFhGemB5so/1yssy6cO1hSZCtbksObJzblZk596RsBuFJgCa63WmT4MDHcqvdAht9UxftvRv65UTADcZXOM0wPnd3zsvUvFhL4WFklp39fEp0YB5iay/IEPWXg8GTG8uww05DbL6pmrRQol+5WUoBAfAq5g+mcXYOHMgSRy623LtDlnVSw== 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=hhgipk/mHNMvAOGYdvtMeCeATfd1XVTRK+8oZSerzLo=; b=BO7R7CndzER33gPOAH8ZJNY2tsKpg+GWo9oWGrwDkVLcBfShV4A45+JOsqNppxfXPBz4vYu2tctFChqQ4K5faSg5kRd6ufzXJmT2Nn6xUQtQhbT+r9MStYpMx0arWr0fQ4CYXVgV37nlS8hV5o8NbLBu3UVBly5B420+XVG9Hl5C9wtAW0JWpbyyNCYumxbxWC7IuYDmRQDovaAsdvrdEq35JH7SuIOovlOFIrC/gn7v9onWYEa+3k6W7Tk95/d02Y0sOIgjcXZUxLR7MuwJZcr4IjhMUCR8X5wkMCRZ0EYRZHous1C5F5PTR4ZIoWRISL3yxLkZRTRAN8oAirzylw== Original-Received: from DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) by AM9PR02MB6500.eurprd02.prod.outlook.com (2603:10a6:20b:2d2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.38; Tue, 13 Feb 2024 10:44:46 +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 10:44:45 +0000 In-Reply-To: <86zfw5rbpb.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 12 Feb 2024 09:36:55 -0500") X-TMN: [YnzH9HTtaxjKF6tlMH6YkHVFwG5iMbZZ] X-ClientProxiedBy: OS6P279CA0056.NORP279.PROD.OUTLOOK.COM (2603:10a6:e10:31::11) To DU2PR02MB10109.eurprd02.prod.outlook.com (2603:10a6:10:497::14) X-Microsoft-Original-Message-ID: <867cj8lk2s.fsf@live.com> X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR02MB10109:EE_|AM9PR02MB6500:EE_ X-MS-Office365-Filtering-Correlation-Id: 55e8aa19-3082-4360-085a-08dc2c80cb19 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Oal0TZYaIa7gPPf4we65hzpnnhXyPb/VD80Z1Vg26NegAvzgxfUEZhCvqkoeWl6wtEM8YMDNLddFMfemSfcJ34er8GeYfqag2a54r8YCFdqAb0lwLyKG3ROXV31zd93nRgZhLmDw/W5OB5ha1cL2/oVzniwTDfZ9Xzi7/uCd2lwWa7Soz6JOnAPreHOIV+mMB0YbxvwEhCOswhBtoXqzE1H2aDJjK/DsIYBMNJ2MD/JOSauPqKrxmoOfj1X5bkY/OYX1FGI/pa+RJrjnYbautYJBPwFgstKmQKK1mzQzzjxc6lDWJYOkmC9zDf7m0VZVn+RNmAqb7TJhuyweODjeF1DI1jqFj30zHeii8w6LmMZhQhfKK7AFzL7zjKkXeJ1/pSg/7b5k6jEPMdtaY4lqt2nK6+hb6Y2FtZAqvixT3HJjc8B/KTTpBS4glC/CSzMlSMqY0B2OkwHvOYzCf3105tcXxrO4jJKkMWWpbUbSbV6t/7goV3+tNoUCCZuqSQzNXM82jQLItQLB6WtjDaDxTMZXb2Tv3MHNle+8BasOxQFx7OrdeqfarjG4iwr4LbUq X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?vyIcfADoW8CfGGAegsdpm/7AxoDxOdP7BOlcOD/WD/vtO06t7wINVmnMaYHW?= =?us-ascii?Q?E+FStKS4FGfagxSJ7TRjbDHNQGQ4e86E8i74LRQS9xwtn7cUkvIi6KtXsUIw?= =?us-ascii?Q?4akHojrXQf335HZB8HVysScYr97XL3kKuQqLBXPKMTWch1ZWl9Nmyjyl7Lin?= =?us-ascii?Q?0uMfJF1clF9PAm6Lkcga4yuOlhYgjv42PEtNzepJvevoA7Po5CqABFbyHhN4?= =?us-ascii?Q?kTX8q1Vf4Qq2ufnnz1c6sxepZ0cgE3jgJrjR5UbhXGhScnAII1k3Qo1jQ+X1?= =?us-ascii?Q?P8sP7c47qWirOT9h8Je8gZfmZ8k3u8z8Q7558ifsArHby4Iuf+HvW3fZgSD7?= =?us-ascii?Q?bwxfXCwBCmTJkNv524JY4V3xUc0MecSd4irbJlCcXyz0JVr6m9O+CLqjW3h+?= =?us-ascii?Q?CLxUMBXBL1I7PtVfJ1GLCT2kJ1Rd1RDNMrC+9kZD3j8uFUt1JTWWGqIzH/63?= =?us-ascii?Q?c66vDJkYmBHM4WGVZTpEtLIdrugcDBsg8yaJnGTe1GMNTaCuWeMHgEcAA1v7?= =?us-ascii?Q?AAIxLk78POBwFukEte467xO95ETqI0HVV3r3BZgvbelVrEzIxD4KswzAAMvU?= =?us-ascii?Q?fJj1oaAYh0KgBQL6hELU44nc5ptShypomYAMfgIhu98Ahzc78oxEwoC4v2ly?= =?us-ascii?Q?Vp X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-ab7de.templateTenant X-MS-Exchange-CrossTenant-Network-Message-Id: 55e8aa19-3082-4360-085a-08dc2c80cb19 X-MS-Exchange-CrossTenant-AuthSource: DU2PR02MB10109.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Feb 2024 10:44:45.8545 (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: AM9PR02MB6500 Received-SPF: pass client-ip=40.92.73.25; envelope-from=arthur.miller@live.com; helo=EUR04-HE1-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 06:59:57 -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:316170 Archived-At: Eli Zaretskii writes: >> From: Arthur Miller >> Date: Mon, 12 Feb 2024 11:06:02 +0100 >> >> I am trying to compile Emacs on a new computer with freshly installed Windows 11 >> and mingw and having some troubles. >> >> ld is complaining about missing snprintf. Seems like I can't get past that >> one. I am using mingw ucrt toolchain/runtime since m4 failed for "ordinary" >> mingw-w64 toolchain which I used on Windows 10 (m4 failed creating configure >> script). Any idea why and what to do? It is defined in stdio.h so I would expect >> it to be included in basic libc. Do I need to pass some extra flag >> compiler/linker flag? > > Which problem do you want to solve? the one with creating the > configure script, so you could use the "ordinary" MinGW toolchain, or > the one with snprintf? Seems, like ordinary one works today; but if we can figure out why it does not link with correct library in ucrt build, it would be nice. > I don't really understand why you have a problem creating the > configure script (nor why you think it's m4's fault). What is Needer do I; but before I did a git pull today, ./autogen.sh resulted in error from M4 that some macro was already defined. I don't remember which one. I tried to trigger it today just to show the error message, but I did a git pull without thinking before createing a worktree for the build, and autogen suddenly worked. > different from what you had on Windows 10? Are you using the same > development tools copied from the old computer, or did you install I didn't copy over; that option did cross my mind, but the old one is old since 2016, so I thought it would good to install new stuff a fresh so to say. But nothing special; just msys2 out of the box, with deps needed to build Emacs. > them anew? If the former, there should be no problems with creating > the configure script. If all else fails, please show the error > messages you get trying to create the configure script. > > One thing to watch out is to make sure your Git installation doesn't > perform any EOL conversions. Yes. I am aware of that one. > For the snprintf problem, my suggestion is to review the patches the > MSYS2 folks use for the UCRT build of Emacs. No one submitted to us > patches to support UCRT builds, so that build is currently unsupported > by the upstream project, but AFAIU MSYS2 folks do succeed in building > it, so I guess they do have patches for it. It is better to use those > patches as a starting point. I didn't know they have one; I'll check it, and come back if I manage to build it in ucrt runtime. >> Since I removed msys mingw-w64 from my PATH to be sure mingw-w64-ucrt runtime >> don't mix with other mingw runtime(s), Git also got removed from the path (I am >> using mingw-64 one), and than my running Emacs couldn't open a file from a Git >> repo. > > The simple fix for that is to have on PATH a git.cmd batch file that > invokes Git after setting PATH locally (with setlocal) to include the > directory where you have Git installed. > >> The backtrace shows find-file is calling vc-refresh which realized I am in a Git >> repo and is trying to call Git. If I start emacs -q afresh without Git in the >> path, it works fine, so I assume Emacs registers Git program at some point and >> does not check for it on every call, perhaps I am wrong about that one? > > You don't tell enough to figure out what could be the reason for this. > What are your customizations doing that could cause Emacs find Git > even though it is not on PATH? No no; Emacs does not find it when it is not in the PATH. :) >> If that would be the case, I think it is a bug to assume that environment can't >> change under running Emacs. > > Modifying PATH from within a running Emacs session is not recommended, > precisely because it can cause subtle issues. It wasn't modified from within Emacs; but from Windows GUI; but the effect is the same of course. >> Also, calling vc-refresh obviously results in a quite expensive call to git >> process everytime I open a file from git repo. Is it really a good default >> option? At least I interpret it so since emacs -q has vc-refresh in >> find-file-hook. Why do we even need vc-refresh by default in find-file-hook? > > We show the VC status on the mode line. If that is *the only* reason, can we make that status refresh optional? It can trigger checks even in files I am not currently working on. For example I have .emacs.d as a git repo so I can back it up, and I believe I am not the only one. Save place and recentf for example, and basically every other configuration that saves something is saving it in .emacs.d. It can be quite many status checks if it automatically checks git status for all files. There can be other reasons why I wouldn't like/need those checks in some repos. You can see the answer to Dmitry for a suggestion. Thanks for the help. /a