Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
/MODULE.bazel* @DataDog/agent-build
# Temporary during Bazel migration
/**/BUILD.bazel @DataDog/agent-build
/deps/ @DataDog/agent-build

# The owner should really be to a team that does not exist yet. It would cover supply chain in general.
# For now, agent-build are the experts in that.
Expand Down
22 changes: 20 additions & 2 deletions deps/cpython/build_python.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set script_errorlevel=0

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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%
Expand Down Expand Up @@ -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%
goto :cleanup
)

@echo on

Expand All @@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set script_errorlevel=%errorlevel%
goto :cleanup
set script_errorlevel=%errorlevel%
goto :cleanup
exit /b %script_errorlevel%

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line after the goto would never get executed. It's not a subroutine call, it's a direct jump. I think that also answers most of the other comments.

https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/goto

Copy link
Contributor

@rdesgroppes rdesgroppes Dec 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

f*k, I confused goto :label (jump) and call :label (routine/function). I'm terribly sorry, @alopezz!

)

:: 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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if %script_errorlevel% neq 0 (
exit /b %script_errorlevel%
)
exit /b %script_errorlevel%

Loading