Skip to content

Commit f02639d

Browse files
author
Gorav Singal
committed
Debugging, commenting script parts
Debugging, commenting script parts Update build_python.ps1 Update build_python.ps1 Update build_python.ps1 Update build_python.ps1 Update build_python.ps1 Update build_python.ps1 Update build_python.ps1 Update build_python.ps1 Update build_python.ps1 Update build.bat Update build_python.ps1 Update build_python.ps1 Update build.bat Update build_python.ps1 Update build_python.ps1 Updating echo statements Updating echo statements FInalizing Script FInalizing Script
1 parent f0ddcdf commit f02639d

File tree

1 file changed

+24
-5
lines changed

1 file changed

+24
-5
lines changed

pkg/windows/python_build/build_python.ps1

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ if (!(Test-Path 'C:\python_dev')) {
44
if (!(Test-Path 'C:\buildtools')) {
55
New-Item 'C:\buildtools' -ItemType Directory
66
}
7+
8+
${Env:ProgramFiles(x86)}= "C:\Program Files (x86)"
9+
echo ${Env:ProgramFiles(x86)}
10+
711
Copy-Item 'build.bat' -Destination 'C:\python_dev\build.bat' -Force
812
Copy-Item 'fips_python.patch' -Destination 'C:\python_dev\fips_python.patch' -Force
913

@@ -17,23 +21,38 @@ Write-Host ('Installing Visual Studio 2017 Community Edition...')
1721
$process = Start-Process -FilePath C:\python_dev\vs_Community.exe -ArgumentList "--includeRecommended", "--includeOptional", "--quiet", "--nocache", "--norestart", "--wait", "--installPath", "c:\buildtools", "--add", "Microsoft.VisualStudio.Workload.Python", "--add", "Microsoft.ComponentGroup.PythonTools.NativeDevelopment", "--add", "Microsoft.Component.MSBuild", "--add", "Component.CPython3.x86" -Wait -PassThru
1822
Write-Output $process.ExitCode
1923

20-
Write-Host ('Downloading python...')
21-
Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tar.xz -OutFile 'C:\python_dev\Python-3.9.2.tar.xz'
22-
2324
Write-Host ('Installing Choco...')
2425
iex ((New-Object System.Net.WebClient).DownloadString("https://chocolatey.org/install.ps1"));
2526

26-
choco install git 7zip.install patch -y;
27+
# choco install git 7zip.install -y;
2728
cd C:\python_dev
2829

30+
if ((Test-Path 'C:\Python39')) {
31+
# Cleanup
32+
Remove-Item C:\Python39 -Recurse
33+
}
34+
if ((Test-Path 'C:\python_dev\Python-3.9.2')) {
35+
# Cleanup
36+
Remove-Item C:\python_dev\Python-3.9.2 -Recurse
37+
}
38+
39+
if (!(Test-Path 'C:\python_dev\Python-3.9.2.tar.xz')) {
40+
Write-Host ('Downloading python...')
41+
Invoke-WebRequest -Uri https://www.python.org/ftp/python/3.9.2/Python-3.9.2.tar.xz -OutFile 'C:\python_dev\Python-3.9.2.tar.xz'
42+
}
43+
2944
Write-Host ('Untar Python...')
3045
7z x Python-3.9.2.tar.xz
3146
7z x Python-3.9.2.tar
3247
Move-Item C:\python_dev\Python-3.9.2 C:\Python39
48+
3349
cd C:\Python39
34-
patch -p1 -i C:\python_dev\fips_python.patch
50+
cmd.exe /c "c:\Program Files\Git\usr\bin\patch.exe" -p1 -i C:\python_dev\fips_python.patch
51+
Write-Host ('Patch success...')
3552

53+
Write-Host ('Building Python...')
3654
cmd.exe /c C:\python_dev\build.bat
55+
Write-Host ('Build Python success...')
3756

3857
Copy-Item 'C:\Python39\PCbuild\amd64\python.exe' -Destination 'c:\Python39\PCbuild\amd64\python39.exe' -Force
3958
Write-Host ('Done...')

0 commit comments

Comments
 (0)