Windows, FFmpeg: Handle exception when downloading patchelf

The script 'install-ffmpeg.ps1' contains logic for building all targets
even if some targets fail, and then report all results at the end. When
building Android specifically, we download patchelf sources from CI,
it's possible for it to throw an exception if CI-files is not
available. This breaks the logic and makes us terminate early.

This patch encloses the Invoke-WebRequest in a try-catch.

This also makes it easier to run this script locally.

Pick-to: 6.11 6.8
Change-Id: I93d4ec905c61dc7b44b87100353353f24c27d276
Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
This commit is contained in:
Nils Petter Skålerud
2026-03-03 15:14:43 +01:00
parent 43a37ecafa
commit 2911978176

View File

@@ -271,10 +271,16 @@ function InstallAndroidArmv7 {
$patchelf_sources = "https://ci-files01-hki.ci.qt.io/input/android/patchelf/0.17.2.tar.gz"
$patchelf_download_location = "C:\Windows\Temp\0.17.2.tar.gz"
Invoke-WebRequest -UseBasicParsing $patchelf_sources -OutFile $patchelf_download_location
Verify-Checksum $patchelf_download_location $patchelf_sha1
Extract-tar_gz $patchelf_download_location $unzip_location
Remove $patchelf_download_location
try {
Invoke-WebRequest -UseBasicParsing $patchelf_sources -OutFile $patchelf_download_location
Verify-Checksum $patchelf_download_location $patchelf_sha1
Extract-tar_gz $patchelf_download_location $unzip_location
Remove $patchelf_download_location
} catch {
Write-Host "Error grabbing sources when installing patchelf:"
Write-Host $_
return $false
}
Start-Process -NoNewWindow -Wait -PassThru -ErrorAction Stop -FilePath $msys -ArgumentList ("-lc", "`"cd C:/patchelf-0.17.2 && ./bootstrap.sh && ./configure && make install`"")