@@ -212,10 +212,6 @@ $Components = @{
212212 URL = " https://github.com/lexxmark/winflexbison/releases/download/v$WinFlexBisonVersion /win_flex_bison-$WinFlexBisonVersion .zip"
213213 Hash = " 8D324B62BE33604B2C45AD1DD34AB93D722534448F55A16CA7292DE32B6AC135"
214214 }
215- GnuWin32Make = @ {
216- URL = " https://downloads.sourceforge.net/project/ezwinports/make-4.4.1-without-guile-w32-bin.zip"
217- Hash = " fb66a02b530f7466f6222ce53c0b602c5288e601547a034e4156a512dd895ee7"
218- }
219215 packaging = @ {
220216 URL = " https://files.pythonhosted.org/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl"
221217 Hash = " 5b8f2217dbdbd2f7f384c41c628544e6d52f2d0f53c6d0c3ea61aa5d1d7ff124"
@@ -226,14 +222,6 @@ $Components = @{
226222 URL = " https://files.pythonhosted.org/packages/ff/ae/f19306b5a221f6a436d8f2238d5b80925004093fa3edea59835b514d9057/setuptools-75.1.0-py3-none-any.whl"
227223 Hash = " 35ab7fd3bcd95e6b7fd704e4a1539513edad446c097797f2985e0e4b960772f2"
228224 }
229- psutil = @ {
230- URL = " https://files.pythonhosted.org/packages/11/91/87fa6f060e649b1e1a7b19a4f5869709fbf750b7c8c262ee776ec32f3028/psutil-6.1.0-cp37-abi3-win_amd64.whl"
231- Hash = " a8fb3752b491d246034fa4d279ff076501588ce8cbcdbb62c32fd7a377d996be"
232- }
233- unittest2 = @ {
234- URL = " https://files.pythonhosted.org/packages/72/20/7f0f433060a962200b7272b8c12ba90ef5b903e218174301d0abfd523813/unittest2-1.1.0-py2.py3-none-any.whl"
235- Hash = " 13f77d0875db6d9b435e1d4f41e74ad4cc2eb6e1d5c824996092b3430f088bb8"
236- }
237225}
238226
239227if ($PinnedBuild -eq " " ) {
@@ -771,7 +759,7 @@ function Fetch-Dependencies {
771759 Get-ChildItem " $BinaryCache \toolchains\WixAttachedContainer" - Filter " *.msi" | ForEach-Object {
772760 $LogFile = [System.IO.Path ]::ChangeExtension($_.Name , " log" )
773761 $TARGETDIR = if ($_.Name -eq " rtl.msi" ) { " $BinaryCache \toolchains\$ToolchainName \LocalApp\Programs\Swift\Runtimes\$ ( Get-PinnedToolchainVersion ) \usr\bin" } else { " $BinaryCache \toolchains\$ToolchainName " }
774- Invoke-Program - OutNull msiexec.exe / lvx! $BinaryCache \toolchains\$LogFile / qn / a $BinaryCache \toolchains\WixAttachedContainer\$ ($_.Name ) ALLUSERS= 0 TARGETDIR= $TARGETDIR
762+ Invoke-Program - OutNull msiexec.exe / lvx! $BinaryCache \toolchains\$LogFile / qn / a $BinaryCache \toolchains\WixAttachedContainer\$ ($_.Name ) ALLUSERS= 0 TARGETDIR= $TARGETDIR
775763 }
776764 }
777765
@@ -795,37 +783,38 @@ function Fetch-Dependencies {
795783 }
796784 }
797785
798- function Ensure-PythonModules ($Python ) {
799- # First ensure pip is installed, else bootstrap it
800- try {
801- Invoke-Program - OutNull $Python - m pip * > $null
802- } catch {
803- Write-Output " Installing pip ..."
804- Invoke-Program - OutNull $Python ' -I' - m ensurepip - U -- default- pip
805- }
806- # 'packaging' is required for building LLVM 18+
807- try {
808- Invoke-Program - OutNull $Python - c ' import packaging' * > $null
809- } catch {
810- DownloadAndVerify " packaging" " $BinaryCache \python\packaging-24.1-py3-none-any.whl"
811- Write-Output " Installing 'packaging-24.1-py3-none-any.whl' ..."
812- Invoke-Program - OutNull $Python ' -I' - m pip install " $BinaryCache \python\packaging-24.1-py3-none-any.whl" -- disable-pip - version- check
786+ Download- Python $HostArchName
787+ if ($IsCrossCompiling ) {
788+ Download- Python $BuildArchName
789+ }
790+
791+ # Ensure pip is installed, else bootstrap it
792+ try {
793+ Invoke-Program - OutNull $ (Get-PythonExecutable ) - m pip * > $null
794+ } catch {
795+ Write-Output " Installing pip ..."
796+ Invoke-Program - OutNull $ (Get-PythonExecutable ) ' -I' - m ensurepip - U -- default- pip
797+ }
798+
799+ function Ensure-PythonModule ($Name ) {
800+ $Info = $Components [$Name ]
801+ if ($Info -eq $null ) {
802+ throw " Unknown component requested"
813803 }
804+ $CanonicalName = [IO.Path ]::GetFileNameWithoutExtension($Info.URL )
805+
814806 try {
815- Invoke-Program - OutNull $Python - c ' import distutils ' * > $null
807+ Invoke-Program - OutNull $ ( Get-PythonExecutable ) - c ' import $name ' * > $null
816808 } catch {
817- DownloadAndVerify " distutils " " $BinaryCache \python\setuptools-75.1.0-py3-none-any .whl"
818- Write-Output " Installing 'setuptools-75.1.0-py3-none-any .whl' ..."
819- Invoke-Program - OutNull $Python ' -I' - m pip install " $BinaryCache \python\setuptools-75.1.0-py3-none-any .whl" -- disable-pip - version- check
809+ DownloadAndVerify $Name " $BinaryCache \python\$CanonicalName .whl"
810+ Write-Output " Installing '$CanonicalName .whl' ..."
811+ Invoke-Program - OutNull $ ( Get-PythonExecutable ) ' -I' - m pip install " $BinaryCache \python\$CanonicalName .whl" -- disable-pip - version- check
820812 }
821813 }
822814
823- Download- Python $HostArchName
824- if ($IsCrossCompiling ) {
825- Download- Python $BuildArchName
826- }
827815 # Ensure Python modules that are required as host build tools
828- Ensure- PythonModules " $ ( Get-PythonExecutable ) "
816+ Ensure- PythonModule " packaging"
817+ Ensure- PythonModule " distutils"
829818
830819 if ($Android ) {
831820 # Only a specific NDK version is supported right now.
0 commit comments