From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id 7353A44B3F for ; Sat, 21 Jun 2025 09:20:16 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 8459B68D3F8; Sat, 21 Jun 2025 12:20:11 +0300 (EEST) Date: Sat, 21 Jun 2025 11:20:03 +0200 To: FFmpeg development discussions and patches References: <20250613140555.121374-1-martin@martin.st> In-Reply-To: MIME-Version: 1.0 Message-ID: List-Id: FFmpeg development discussions and patches List-Post: From: Alexander Strasser via ffmpeg-devel Precedence: list Cc: Alexander Strasser X-Mailman-Version: 2.1.29 X-BeenThere: ffmpeg-devel@ffmpeg.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: FFmpeg development discussions and patches List-Help: Subject: Re: [FFmpeg-devel] [PATCH] configure: Make MSVC version grabbing more robust Content-Type: multipart/mixed; boundary="===============8598362120397960662==" Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: --===============8598362120397960662== Content-Type: message/rfc822 Content-Disposition: inline Return-Path: X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTPS id 9CFAA68CF8A for ; Sat, 21 Jun 2025 12:20:05 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1750497604; x=1751102404; i=eclipse7@gmx.net; bh=JmllDKDjs5wxSH7m3yVxeWMVw6CQ64eZhWf6BcYJoa8=; h=X-UI-Sender-Class:Date:From:To:Subject:Message-ID:References: MIME-Version:Content-Type:In-Reply-To:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=GYlyNlFfWVp4ZEb9rADRH3ccrORh4jD3+2I6Q2BVlFzwxSxpZuHXEwYo4jQg325e NNGOpeOcEkzBZ/Dc0hfu+N4MWZIScfVGzA9uTf0DMn49wNaIDAuKj1nHhR3L/V4zb F6CjdRRIN1MRMJuQblUrUTI0adJ4d/3pkfLJ+vLnsLvLwpK1myUxByiwgy3sNMPtx ZGAAhNCUjCtnpK51mrUv3wlfeZgA/Mp+2dbsEOvo7DShZIafc6Z0sVEOipAfYcceF 8iyWDyqyvU9kYh6mS/PY1asj/hU6SePv2DwKE81YwJOmGA14Sdf9lyTDnFXULa/5+ rtvwiXDfbA8dhv5CTg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from metallschleim.local ([91.4.236.20]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MD9XF-1ubwof2Sqf-001WQo for ; Sat, 21 Jun 2025 11:20:04 +0200 Date: Sat, 21 Jun 2025 11:20:03 +0200 From: Alexander Strasser To: FFmpeg development discussions and patches Subject: Re: [FFmpeg-devel] [PATCH] configure: Make MSVC version grabbing more robust Message-ID: References: <20250613140555.121374-1-martin@martin.st> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="4Ad9ngkXi1JFGXzI" Content-Disposition: inline In-Reply-To: X-Provags-ID: V03:K1:c5apHVBmkxYdHqDxqW0RF33bgCNgrlw01k6LOBMxN8O3Pj+b/kE M29j6YvJHNgKfL6kxaNE7yBtYBTivDoz1Jh1A2AHwDAZGvL5A+I88TmuPvyMXTc+TOwo58V PZ4I223/otaNpRttpr7x9oS5zXIB6GKPzf4FcBC1Zfrut2V/xRGPHdEQ9SDdpt0Vo8NgxOu funHbOHnMjeMfD1MqnoaQ== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:dyDZwke+dPc=;hhQSVymnqTSIMZV/jwZRSHzZWfX XMmM+1VGymLVM7ufE/rh3O37+3XhnGDK7ClJJ2QdH/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9anwno5TzrGxdCZL0 qWYB8TnJg3ZVLly5xJKc839HBEnLDILXr9J1U/ft81pRB2bk3UYYXBvN/u/xkXxdJP5l0ONfN 4NQmAnbN8s60zr3kKxs6AQ6m0OYOvwrVGs+Zkl4AOpGp7GUNdA= --4Ad9ngkXi1JFGXzI Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2025-06-21 00:03 +0200, Kacper Michajlow wrote: > On Fri, 20 Jun 2025 at 22:26, Hendrik Leppkes > wrote: > > > > On Fri, Jun 20, 2025 at 9:25=E2=80=AFPM Timo Rothenpieler wrote: > > > > > > On 19.06.2025 22:21, Martin Storsj=C3=B6 wrote: > > > > On Fri, 13 Jun 2025, Martin Storsj=C3=B6 wrote: > > > > > > > >> When running plain "cl", to get the MSVC version, it prints the > > > >> version header on stderr, while the usage instructions are printe= d > > > >> on stdout. Usually, the version on stderr gets flushed first, > > > >> so "head -n1" gets the line it expects, but some times (in partic= ular > > > >> when running MSVC wrapped in wine), it can get the usage line > > > >> first. > > > >> > > > >> Redirect stdout to /dev/null, so we only grab the version among > > > >> the lines printed to stderr. This should make the version number > > > >> grabbing more robust. > > > >> > > > >> At least all relevant versions of MSVC seem to print this specifi= cally > > > >> to stderr, not stdout (so we don't risk to miss it); checked down > > > >> to MSVC 2010. > > > >> --- > > > >> This should avoid the occasionally misdetected version number lin= es > > > >> as seen at https://fate.ffmpeg.org/history.cgi?slot=3Dx86_64-msvc= 2022-wine. > > > >> --- > > > >> configure | 5 ++++- > > > >> 1 file changed, 4 insertions(+), 1 deletion(-) > > > > > > > > Will push. > > > > > > Likely this patch broke multiple fate runners in a silent way. > > > On mine, configure simply never returns, and just sits there > > > indefinitely, with no CPU usage or any activity whatsoever. > > > > > > =EF=BB=BFnevcairiel confirmed seeing the same behaviour on IRC. > > > > > > The msys+clang builds from within the same environment work fine. > > > > > > > > > Didn't verify completely if it's caused by this patch, but nothing e= lse > > > happened with configure since the last successful run. > > > > I did some digging, and it happens when probe_cc probes link.exe > > > > link.exe has an interactive help output (its paginated) - previously > > piping stdout disabled the pagination automatically - but redirecting > > it to devnull does not, and it gets stuck waiting for input. > > Additionally, link.exe outputs the ident on stdout, so there is no > > result on stderr (not super bad, as LD_IDENT is never used - yet) >=20 > Instead of redirecting to devnull, we could use the same condition as > in if. We already look for specific ident line, so no need to head. > _ident=3D$($_cc -nologo- 2>&1 | grep ^Microsoft | tr -d '\r') > should work, no? I would be happy to see a better solution, though. I think making sure to only use the first line that starts with Microsoft is more robust; there could be (in the future) more lines that start with Microsoft. > btw. running cl.exe 3 times to just get its name is interesting :) Yes, so that as well. Could be optimized, but is probably not so relevant in total. I propose the attached patch. Alexander --4Ad9ngkXi1JFGXzI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=0001-configure-Fix-a-regression-when-probing-link.exe.patch Content-Transfer-Encoding: quoted-printable =46rom f97df3657ab73573659d7738ac55d688c5744bf9 Mon Sep 17 00:00:00 2001 From: Alexander Strasser Date: Sat, 21 Jun 2025 11:13:22 +0200 Subject: [PATCH] configure: Fix a regression when probing link.exe The version ident is printed on stdout for link.exe and redirecting stdout to /dev/null will cause the output of link.exe to be paged. =2D-- configure | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/configure b/configure index 708ecd9025..ce027d3845 100755 =2D-- a/configure +++ b/configure @@ -5130,10 +5130,9 @@ probe_cc(){ elif $_cc -nologo- 2>&1 | grep -q ^Microsoft || { $_cc -v 2>&1 | grep= -q clang && $_cc -? > /dev/null 2>&1; }; then _type=3Dmsvc if $_cc -nologo- 2>&1 | grep -q ^Microsoft; then - # The version number is printed on the first line on stderr, = stdout - # gets the usage instructions. Only include stderr, to avoid - # potential ordering race conditions. - _ident=3D$($_cc 2>&1 >/dev/null | head -n1 | tr -d '\r') + # Depending on the tool (cl.exe or link.exe), the version num= ber + # is printed on the first line of stderr or stdout + _ident=3D$($_cc 2>&1 | grep ^Microsoft | head -n1 | tr -d '\r= ') else _ident=3D$($_cc --version 2>/dev/null | head -n1 | tr -d '\r'= ) fi =2D-=20 2.49.0 --4Ad9ngkXi1JFGXzI-- --===============8598362120397960662== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe". --===============8598362120397960662==--