@@ -129,7 +129,7 @@ param
129
129
[string ] $PinnedSHA256 = " " ,
130
130
[string ] $PinnedVersion = " " ,
131
131
[ValidatePattern (' ^\d+(\.\d+)*$' )]
132
- [string ] $PythonVersion = " 3.9.10 " ,
132
+ [string ] $PythonVersion = " 3.10.1 " ,
133
133
[ValidatePattern (" ^r(?:[1-9]|[1-9][0-9])(?:[a-z])?$" )]
134
134
[string ] $AndroidNDKVersion = " r27c" ,
135
135
[ValidatePattern (" ^\d+\.\d+\.\d+(?:-\w+)?" )]
@@ -321,14 +321,22 @@ $WiX = @{
321
321
}
322
322
323
323
$KnownPythons = @ {
324
- " 3.9.10 " = @ {
324
+ " 3.10.1 " = @ {
325
325
AMD64 = @ {
326
- URL = " https://www.nuget.org/api/v2/package/python/3.9.10" ;
327
- SHA256 = " ac43b491e9488ac926ed31c5594f0c9409a21ecbaf99dc7a93f8c7b24cf85867" ;
326
+ URL = " https://www.nuget.org/api/v2/package/python/3.10.1" ;
327
+ SHA256 = " 987a0e446d68900f58297bc47dc7a235ee4640a49dace58bc9f573797d3a8b33" ;
328
+ };
329
+ AMD64_Embedded = @ {
330
+ URL = " https://www.python.org/ftp/python/3.10.1/python-3.10.1-embed-amd64.zip" ;
331
+ SHA256 = " 502670dcdff0083847abf6a33f30be666594e7e5201cd6fccd4a523b577403de" ;
328
332
};
329
333
ARM64 = @ {
330
- URL = " https://www.nuget.org/api/v2/package/pythonarm64/3.9.10" ;
331
- SHA256 = " 429ada77e7f30e4bd8ff22953a1f35f98b2728e84c9b1d006712561785641f69" ;
334
+ URL = " https://www.nuget.org/api/v2/package/pythonarm64/3.10.1" ;
335
+ SHA256 = " 16becfccedf1269ff0b8695a13c64fac2102a524d66cecf69a8f9229a43b10d3" ;
336
+ };
337
+ ARM64_Embedded = @ {
338
+ URL = " https://www.python.org/ftp/python/3.10.1/python-3.10.1-embed-arm64.zip" ;
339
+ SHA256 = " 1f9e215fe4e8f22a8e8fba1859efb1426437044fb3103ce85794630e3b511bc2" ;
332
340
};
333
341
}
334
342
}
@@ -349,11 +357,6 @@ $PythonModules = @{
349
357
SHA256 = " 353815f59a7f64cdaca1c0307ee13558a0512f6db064e92fe833784f08539c7a" ;
350
358
Dependencies = @ ();
351
359
};
352
- " unittest2" = @ {
353
- Version = " 1.1.0" ;
354
- SHA256 = " 22882a0e418c284e1f718a822b3b022944d53d2d908e1690b319a9d3eb2c0579" ;
355
- Dependencies = @ (" argparse" , " six" , " traceback2" , " linecache2" );
356
- };
357
360
" argparse" = @ {
358
361
Version = " 1.4.0" ;
359
362
SHA256 = " c31647edb69fd3d465a847ea3157d37bed1f95f19760b11a47aa91c04b666314" ;
@@ -590,6 +593,10 @@ function Get-PythonPath([Hashtable] $Platform) {
590
593
return [IO.Path ]::Combine(" $BinaryCache \" , " Python$ ( $Platform.Architecture.CMakeName ) -$PythonVersion " )
591
594
}
592
595
596
+ function Get-EmbeddedPythonPath ([Hashtable ] $Platform ) {
597
+ return [IO.Path ]::Combine(" $BinaryCache \" , " EmbeddedPython$ ( $Platform.Architecture.CMakeName ) -$PythonVersion " )
598
+ }
599
+
593
600
function Get-PythonExecutable {
594
601
return [IO.Path ]::Combine((Get-PythonPath $BuildPlatform ), " tools" , " python.exe" )
595
602
}
@@ -1067,11 +1074,26 @@ function Get-Dependencies {
1067
1074
return $KnownPythons [$PythonVersion ].$ArchName
1068
1075
}
1069
1076
1077
+ function Get-KnownEmbeddedPython ([string ] $ArchName ) {
1078
+ if (-not $KnownPythons.ContainsKey ($PythonVersion )) {
1079
+ throw " Unknown python version: $PythonVersion "
1080
+ }
1081
+ return $KnownPythons [$PythonVersion ][" ${ArchName} _Embedded" ]
1082
+ }
1083
+
1070
1084
function Install-Python ([string ] $ArchName ) {
1071
1085
$Python = Get-KnownPython $ArchName
1072
1086
DownloadAndVerify $Python.URL " $BinaryCache \Python$ArchName -$PythonVersion .zip" $Python.SHA256
1073
1087
if (-not $ToBatch ) {
1074
- Expand-ZipFile Python$ArchName - $PythonVersion.zip " $BinaryCache " Python$ArchName - $PythonVersion
1088
+ Expand-ZipFile " Python$ArchName -$PythonVersion .zip" " $BinaryCache " " Python$ArchName -$PythonVersion "
1089
+ }
1090
+ }
1091
+
1092
+ function Install-EmbeddedPython ([string ] $ArchName ) {
1093
+ $Python = Get-KnownEmbeddedPython $ArchName
1094
+ DownloadAndVerify $Python.URL " $BinaryCache \EmbeddedPython$ArchName -$PythonVersion .zip" $Python.SHA256
1095
+ if (-not $ToBatch ) {
1096
+ Expand-ZipFile " EmbeddedPython$ArchName -$PythonVersion .zip" " $BinaryCache " " EmbeddedPython$ArchName -$PythonVersion "
1075
1097
}
1076
1098
}
1077
1099
@@ -1119,11 +1141,11 @@ function Get-Dependencies {
1119
1141
if ($Test -contains " lldb" ) {
1120
1142
Install-PythonModule " psutil" # Required for testing LLDB
1121
1143
$env: Path = " $ ( Get-PythonScriptsPath ) ;$env: Path " # For unit.exe
1122
- Install-PythonModule " unittest2" # Required for testing LLDB
1123
1144
}
1124
1145
}
1125
1146
1126
1147
Install-Python $HostArchName
1148
+ Install-EmbeddedPython $HostArchName
1127
1149
if ($IsCrossCompiling ) {
1128
1150
Install-Python $BuildArchName
1129
1151
}
@@ -3442,16 +3464,22 @@ function Install-HostToolchain() {
3442
3464
3443
3465
# Restructure _InternalSwiftScan (keep the original one for the installer)
3444
3466
Copy-Item - Force `
3445
- " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\lib\swift\_InternalSwiftScan" `
3446
- " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\include"
3467
+ - Path " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\lib\swift\_InternalSwiftScan" `
3468
+ - Destination " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\include"
3447
3469
Copy-Item - Force `
3448
- " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\lib\swift\windows\_InternalSwiftScan.lib" `
3449
- " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\lib"
3470
+ - Path " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\lib\swift\windows\_InternalSwiftScan.lib" `
3471
+ - Destination " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\lib"
3450
3472
3451
3473
# Switch to swift-driver
3452
3474
$SwiftDriver = ([IO.Path ]::Combine((Get-ProjectBinaryCache $HostPlatform Driver), " bin" , " swift-driver.exe" ))
3453
3475
Copy-Item - Force $SwiftDriver " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\bin\swift.exe"
3454
3476
Copy-Item - Force $SwiftDriver " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\bin\swiftc.exe"
3477
+
3478
+ # Embed Python
3479
+ Copy-Item - Force `
3480
+ - Path " $ ( Get-EmbeddedPythonPath $HostPlatform ) \*" `
3481
+ - Destination " $ ( $HostPlatform.ToolchainInstallRoot ) \usr\bin" `
3482
+ - Recurse
3455
3483
}
3456
3484
3457
3485
function Build-Inspect ([Hashtable ] $Platform ) {
0 commit comments