From 32b1adb487ac5c538e986efcbe05241019ae8225 Mon Sep 17 00:00:00 2001 From: Alex Lopez Date: Fri, 28 Nov 2025 13:31:13 +0100 Subject: [PATCH 1/2] Improve error handling on python build batch script --- deps/cpython/build_python.bat | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/deps/cpython/build_python.bat b/deps/cpython/build_python.bat index 947fd37d2b90e5..da10f8722e43da 100644 --- a/deps/cpython/build_python.bat +++ b/deps/cpython/build_python.bat @@ -6,6 +6,8 @@ for %%F in (%MSBUILD%) do set MSBUILD=%%~fF set build_outdir=%sourcedir%\PCbuild\amd64 +set script_errorlevel=0 + :: 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% + goto :cleanup +) @echo on @@ -70,11 +75,20 @@ 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 +) :: 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% @@ -82,3 +96,7 @@ 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% +) From 026cf2d03765f0acc552220e54098d07a676e7c3 Mon Sep 17 00:00:00 2001 From: Alex Lopez Date: Mon, 1 Dec 2025 14:57:18 +0100 Subject: [PATCH 2/2] Update codeowners to cover deps folder --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0f2264677f8d3b..551676c26033fc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -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.