[FFmpeg-devel] [PATCH] configure: Make MSVC version grabbing more robust

Martin Storsjö martin at martin.st
Sat Jun 21 22:49:48 EEST 2025


On Sat, 21 Jun 2025, Kacper Michajlow wrote:

> On Sat, 21 Jun 2025 at 19:18, Alexander Strasser via ffmpeg-devel
> <ffmpeg-devel at ffmpeg.org> wrote:
>>
>>
>>
>>
>> ---------- Forwarded message ----------
>> From: Alexander Strasser <eclipse7 at gmx.net>
>> To: FFmpeg development discussions and patches <ffmpeg-devel at ffmpeg.org>
>> Cc:
>> Bcc:
>> Date: Sat, 21 Jun 2025 19:18:03 +0200
>> Subject: Re: [FFmpeg-devel] [PATCH] configure: Make MSVC version grabbing more robust
>> Hi Martin!
>>
>> On 2025-06-21 13:37 +0300, Martin Storsjö wrote:
>> > > On 21. Jun 2025, at 12.20, Alexander Strasser via ffmpeg-devel <ffmpeg-devel at ffmpeg.org> wrote:
>> > >
>> > >
>> > > On 2025-06-21 00:03 +0200, Kacper Michajlow wrote:
>> > >> On Fri, 20 Jun 2025 at 22:26, Hendrik Leppkes
>> > >> <h.leppkes-at-gmail.com at ffmpeg.org> wrote:
>> > >>>
>> > >>> On Fri, Jun 20, 2025 at 9:25 PM Timo Rothenpieler <timo at rothenpieler.org> wrote:
>> > >>>>
>> > >>>> 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.
>> > >>>>
>> > >>>> nevcairiel 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 else
>> > >>>> 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)
>> > >>
>> > >> 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=$($_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
>> > > <0001-configure-Fix-a-regression-when-probing-link.exe.patch>
>> >
>> > Thanks, this patch looks good to me, feel free to push! (And I can push it later today if nobody else does it before that.)
>> >
>> > If you want to, one can also extend the commit message further to say more explicitly, that 45a30e03613a3c63d74a40f7ac86ce28dce14ff8 caused configure to hang in some configurations, which this fixes.
>>
>> I have attached an updated version. Hope you like the commit message
>> better.
>>
>> I can push it tomorrow or you can do earlier.
>
> LGTM. I tested locally for link.exe and cl.exe. As for server/fate
> testing, I think we can push and monitor if runners are unblocked.
> People have things automated, so it probably takes "effort" to just do
> manual patch testing out-of-tree.

Thanks! I also managed to reproduce the issue now, and can confirm that 
this seems to fix it - so I pushed it.

// Martin


More information about the ffmpeg-devel mailing list