Skip to content

Commit 942538f

Browse files
Adapt testing patches for the move away from host Python
1 parent d59c59d commit 942538f

File tree

1 file changed

+23
-7
lines changed

1 file changed

+23
-7
lines changed

utils/build.ps1

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -779,6 +779,28 @@ function Fetch-Dependencies {
779779
Write-Output "Installing 'setuptools-75.1.0-py3-none-any.whl' ..."
780780
Invoke-Program -OutNull $Python '-I' -m pip install "$BinaryCache\python\setuptools-75.1.0-py3-none-any.whl" --disable-pip-version-check
781781
}
782+
if ($Test -contains "lldb") {
783+
# 'psutil' is required for testing LLDB
784+
try {
785+
Invoke-Program -OutNull $Python -c 'import psutil' *> $null
786+
} catch {
787+
$WheelURL = "https://files.pythonhosted.org/packages/11/91/87fa6f060e649b1e1a7b19a4f5869709fbf750b7c8c262ee776ec32f3028/psutil-6.1.0-cp37-abi3-win_amd64.whl"
788+
$WheelHash = "a8fb3752b491d246034fa4d279ff076501588ce8cbcdbb62c32fd7a377d996be"
789+
DownloadAndVerify $WheelURL "$BinaryCache\python\psutil-6.1.0-cp37-abi3-win_amd64.whl" $WheelHash
790+
Write-Output "Installing 'psutil-6.1.0-cp37-abi3-win_amd64.whl' ..."
791+
Invoke-Program -OutNull $Python '-I' -m pip install "$BinaryCache\python\psutil-6.1.0-cp37-abi3-win_amd64.whl" --disable-pip-version-check
792+
}
793+
# 'unittest2' is required for testing LLDB
794+
try {
795+
Invoke-Program -OutNull $Python -c 'import unittest2' *> $null
796+
} catch {
797+
$WheelURL = "https://files.pythonhosted.org/packages/72/20/7f0f433060a962200b7272b8c12ba90ef5b903e218174301d0abfd523813/unittest2-1.1.0-py2.py3-none-any.whl"
798+
$WheelHash = "13f77d0875db6d9b435e1d4f41e74ad4cc2eb6e1d5c824996092b3430f088bb8"
799+
DownloadAndVerify $WheelURL "$BinaryCache\python\unittest2-1.1.0-py2.py3-none-any.whl" $WheelHash
800+
Write-Output "Installing 'unittest2-1.1.0-py2.py3-none-any.whl' ..."
801+
Invoke-Program -OutNull $Python '-I' -m pip install "$BinaryCache\python\unittest2-1.1.0-py2.py3-none-any.whl" --disable-pip-version-check
802+
}
803+
}
782804
}
783805

784806
Download-Python $HostArchName
@@ -1496,14 +1518,8 @@ function Build-Compilers() {
14961518
$env:LIT_XFAIL=$TestsToXFail -join ";"
14971519
$env:LIT_FILTER_OUT="($($TestsToSkip -join '|'))"
14981520

1499-
# Install packages that the test suite requires
1500-
& $python -m pip install --user psutil
1501-
& $python -m pip install --user packaging
1502-
& $python -m pip install --user unittest2
1503-
1504-
$RuntimeBinaryCache = Get-TargetProjectBinaryCache $Arch Runtime
1505-
15061521
# Transitive dependency of _lldb.pyd
1522+
$RuntimeBinaryCache = Get-TargetProjectBinaryCache $Arch Runtime
15071523
cp $RuntimeBinaryCache\bin\swiftCore.dll "$CompilersBinaryCache\lib\site-packages\lldb"
15081524

15091525
# Runtime dependencies of repl_swift.exe

0 commit comments

Comments
 (0)