mirror of
git://code.qt.io/qt/qt5.git
synced 2026-10-16 20:07:08 +08:00
install-ffmpeg-common.ps1: Wait only for Bash process to finish
When building FFmpeg for MSVC, the toolchain may boot up other processes for telemetry. These processes are long-running and outlive the actual compilation. When we run MSYS with -Wait, we end up stalling until all sub-processes shut down. This was observed when running this script locally for MSVC, and caused compilation to freeze. This patch makes us only wait for the Bash process spawned by MSYS to finish. Pick-to: 6.12 Change-Id: Iff89db8e7d3785713e1124b6169cd8a1230eefbc Reviewed-by: Artem Dyomin <[email protected]>
This commit is contained in:
@@ -123,7 +123,12 @@ function InstallFfmpeg {
|
||||
|
||||
Write-Host "MSYS cmd:"
|
||||
Write-Host $cmd
|
||||
$buildResult = Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath "$bash" -ArgumentList ("-lc", "`"$cmd`"")
|
||||
# Don't use Start-Process -Wait. It waits for the whole process tree, which hangs when
|
||||
# MSVC leaves detached helpers behind (e.g. vctip.exe). Wait for bash itself instead.
|
||||
$buildResult = Start-Process -NoNewWindow -PassThru -ErrorAction Stop -FilePath "$bash" -ArgumentList ("-lc", "`"$cmd`"")
|
||||
# Cache the process handle so ExitCode stays available after the process exits
|
||||
$null = $buildResult.Handle
|
||||
$buildResult.WaitForExit()
|
||||
|
||||
$env:PATH = $oldPath
|
||||
|
||||
|
||||
Reference in New Issue
Block a user