-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Improve error handling on python build batch script #43640
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,6 +6,8 @@ for %%F in (%MSBUILD%) do set MSBUILD=%%~fF | |||||||||||
|
|
||||||||||||
| set build_outdir=%sourcedir%\PCbuild\amd64 | ||||||||||||
|
|
||||||||||||
| set script_errorlevel=0 | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+9
to
+10
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why? Because we're setting this wherever is needed? Because it's effectively a no-op? |
||||||||||||
| :: Start from a clean state | ||||||||||||
| %MSBUILD% "%sourcedir%\PCbuild\pcbuild.proj" /t:CleanAll | ||||||||||||
| rmdir /q /s %build_outdir% | ||||||||||||
|
|
@@ -51,7 +53,10 @@ echo "/p:SkipCopySSLDLL=1" >> %response_file% | |||||||||||
| :: won't be built. | ||||||||||||
| call %sourcedir%\PCbuild\build.bat -e --pgo | ||||||||||||
|
|
||||||||||||
| if ERRORLEVEL 1 exit /b %ERRORLEVEL% | ||||||||||||
| if %errorlevel% neq 0 ( | ||||||||||||
| set script_errorlevel=%errorlevel% | ||||||||||||
rdesgroppes marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||||||||
| goto :cleanup | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| @echo on | ||||||||||||
|
|
||||||||||||
|
|
@@ -70,15 +75,28 @@ xcopy /f %OPENSSL_DIR%*.dll %build_outdir%\ | |||||||||||
| :: --include-stable - adds python3.dll | ||||||||||||
| %build_outdir%\python.exe %sourcedir%PC\layout\main.py --build %build_outdir% --precompile --copy %destdir% --include-dev --include-venv --include-stable -vv | ||||||||||||
|
|
||||||||||||
| if ERRORLEVEL 1 exit /b %ERRORLEVEL% | ||||||||||||
| if %errorlevel% neq 0 ( | ||||||||||||
| set script_errorlevel=%errorlevel% | ||||||||||||
| goto :cleanup | ||||||||||||
|
Comment on lines
+79
to
+80
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The line after the https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/goto
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. f*k, I confused |
||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| :: Bootstrap pip | ||||||||||||
| %destdir%\python.exe -m ensurepip | ||||||||||||
|
|
||||||||||||
| if %errorlevel% neq 0 ( | ||||||||||||
| set script_errorlevel=%errorlevel% | ||||||||||||
| goto :cleanup | ||||||||||||
| ) | ||||||||||||
|
|
||||||||||||
| :cleanup | ||||||||||||
| :: Clean so that no artifacts produced by the build remain | ||||||||||||
| %MSBUILD% "%sourcedir%\PCbuild\pcbuild.proj" /t:CleanAll | ||||||||||||
| rmdir /q /s %build_outdir% | ||||||||||||
| rmdir /q /s %sourcedir%\PCbuild\obj | ||||||||||||
| rmdir /q /s %sourcedir%\PCbuild\win32 | ||||||||||||
| del /q %response_file% | ||||||||||||
| del /q %sourcedir%\python.bat | ||||||||||||
|
|
||||||||||||
| if %script_errorlevel% neq 0 ( | ||||||||||||
| exit /b %script_errorlevel% | ||||||||||||
| ) | ||||||||||||
|
Comment on lines
+100
to
+102
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||
Uh oh!
There was an error while loading. Please reload this page.