Remove Qt DLLs from PySide6 and suppress errors

Add -ErrorAction SilentlyContinue to Get-ChildItem calls and add a check for a lib\PySide6 folder to remove matching Qt DLLs there as well. This prevents failures when no files match the patterns and ensures duplicate Qt DLLs packaged under PySide6 are cleaned up. Applied to both DLL-cleanup sections of the Windows build workflow.
This commit is contained in:
oop7
2026-02-03 15:20:09 +02:00
parent dab35a1a3a
commit 3ea5fedfa3
+12 -2
View File
@@ -229,7 +229,12 @@ jobs:
# Remove any duplicate or unnecessary DLLs (e.g., Qt6Qml, Qt6Quick, Qt6OpenGL from root lib) # Remove any duplicate or unnecessary DLLs (e.g., Qt6Qml, Qt6Quick, Qt6OpenGL from root lib)
$bloatDlls = @("Qt6Web*", "Qt6Pdf*", "Qt6Qml*", "Qt6Quick*", "Qt6VirtualKeyboard*", "Qt6OpenGL*") $bloatDlls = @("Qt6Web*", "Qt6Pdf*", "Qt6Qml*", "Qt6Quick*", "Qt6VirtualKeyboard*", "Qt6OpenGL*")
foreach ($pattern in $bloatDlls) { foreach ($pattern in $bloatDlls) {
Get-ChildItem -Path $libDir -Filter $pattern | Remove-Item -Force # Check in root lib
Get-ChildItem -Path $libDir -Filter $pattern -ErrorAction SilentlyContinue | Remove-Item -Force
# Check in PySide6 folder
if (Test-Path "$libDir\PySide6") {
Get-ChildItem -Path "$libDir\PySide6" -Filter $pattern -ErrorAction SilentlyContinue | Remove-Item -Force
}
} }
Write-Host "Removed unnecessary Qt DLLs" Write-Host "Removed unnecessary Qt DLLs"
@@ -373,7 +378,12 @@ jobs:
# Remove any duplicate or unnecessary DLLs (e.g., Qt6Qml, Qt6Quick, Qt6OpenGL from root lib) # Remove any duplicate or unnecessary DLLs (e.g., Qt6Qml, Qt6Quick, Qt6OpenGL from root lib)
$bloatDlls = @("Qt6Web*", "Qt6Pdf*", "Qt6Qml*", "Qt6Quick*", "Qt6VirtualKeyboard*", "Qt6OpenGL*") $bloatDlls = @("Qt6Web*", "Qt6Pdf*", "Qt6Qml*", "Qt6Quick*", "Qt6VirtualKeyboard*", "Qt6OpenGL*")
foreach ($pattern in $bloatDlls) { foreach ($pattern in $bloatDlls) {
Get-ChildItem -Path $libDir -Filter $pattern | Remove-Item -Force # Check in root lib
Get-ChildItem -Path $libDir -Filter $pattern -ErrorAction SilentlyContinue | Remove-Item -Force
# Check in PySide6 folder
if (Test-Path "$libDir\PySide6") {
Get-ChildItem -Path "$libDir\PySide6" -Filter $pattern -ErrorAction SilentlyContinue | Remove-Item -Force
}
} }
Write-Host "Removed unnecessary Qt DLLs" Write-Host "Removed unnecessary Qt DLLs"