From 123411948bcb8d616896a774ab456e447b25d752 Mon Sep 17 00:00:00 2001 From: Sebastian Castro Date: Sun, 18 Oct 2026 21:30:00 -0400 Subject: [PATCH] Windows: Exit on all nonzero error codes, not just 1 --- vinca/templates/bld_ament_cmake.bat.in | 4 ++-- vinca/templates/bld_ament_python.bat.in | 2 +- vinca/templates/bld_catkin.bat.in | 21 ++++++++------------- vinca/templates/bld_catkin_merge.bat.in | 2 +- vinca/templates/bld_colcon_merge.bat.in | 2 +- 5 files changed, 13 insertions(+), 18 deletions(-) diff --git a/vinca/templates/bld_ament_cmake.bat.in b/vinca/templates/bld_ament_cmake.bat.in index efb2af6d..182adc4b 100644 --- a/vinca/templates/bld_ament_cmake.bat.in +++ b/vinca/templates/bld_ament_cmake.bat.in @@ -53,9 +53,9 @@ cmake ^ -DPYTHON_INSTALL_DIR=%PYTHON_INSTALL_DIR% ^ @(additional_cmake_args) ^ %SRC_DIR%\%PKG_NAME%\src\work\@(additional_folder) -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit 1 :: We explicitly pass %CPU_COUNT% to cmake --build as we are not using Ninja, :: see the comment before setting the CMAKE_GENERATOR env variable cmake --build . --config Release --parallel %CPU_COUNT% --target install -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit 1 diff --git a/vinca/templates/bld_ament_python.bat.in b/vinca/templates/bld_ament_python.bat.in index 56407244..fb1d96ce 100644 --- a/vinca/templates/bld_ament_python.bat.in +++ b/vinca/templates/bld_ament_python.bat.in @@ -22,4 +22,4 @@ if "%errorlevel%" == "0" ( --install-scripts=%LIBRARY_PREFIX%\bin ) -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit 1 diff --git a/vinca/templates/bld_catkin.bat.in b/vinca/templates/bld_catkin.bat.in index f534ce36..20b865cd 100644 --- a/vinca/templates/bld_catkin.bat.in +++ b/vinca/templates/bld_catkin.bat.in @@ -44,23 +44,18 @@ cmake ^ -DCATKIN_SKIP_TESTING=%SKIP_TESTING% ^ @(additional_cmake_args) ^ %SRC_DIR%\%PKG_NAME%\src\work\@(additional_folder) -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit 1 -if "%PKG_NAME%" == "@(ros_package_prefix)-eigenpy" ( - cmake --build . --config Release --target all --parallel 1 - if errorlevel 1 exit 1 -) else ( - cmake --build . --config Release --target all - if errorlevel 1 exit 1 -) +set "BUILD_PARALLEL_ARGS=" +if "%PKG_NAME%" == "@(ros_package_prefix)-eigenpy" set "BUILD_PARALLEL_ARGS=--parallel 1" +cmake --build . --config Release --target all %BUILD_PARALLEL_ARGS% +if %errorlevel% neq 0 exit 1 -if "%SKIP_TESTING%" == "OFF" ( - cmake --build . --config Release --target run_tests - if errorlevel 1 exit 1 -) +if "%SKIP_TESTING%" == "OFF" cmake --build . --config Release --target run_tests +if %errorlevel% neq 0 exit 1 cmake --build . --config Release --target install -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit 1 if "%PKG_NAME%" == "@(ros_package_prefix)-catkin" ( :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. diff --git a/vinca/templates/bld_catkin_merge.bat.in b/vinca/templates/bld_catkin_merge.bat.in index 24512c20..aa88a6b5 100644 --- a/vinca/templates/bld_catkin_merge.bat.in +++ b/vinca/templates/bld_catkin_merge.bat.in @@ -24,7 +24,7 @@ set CMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH:\=/% -DBUILD_SHARED_LIBS=ON ^ -DPYTHON_EXECUTABLE=%PYTHON% ^ -DCATKIN_SKIP_TESTING=ON -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit 1 :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. :: This will allow them to be run on environment activation. diff --git a/vinca/templates/bld_colcon_merge.bat.in b/vinca/templates/bld_colcon_merge.bat.in index b795d97d..d62f4c41 100644 --- a/vinca/templates/bld_colcon_merge.bat.in +++ b/vinca/templates/bld_colcon_merge.bat.in @@ -28,7 +28,7 @@ colcon build ^ -DBUILD_TESTING=OFF ^ -DPYTHON_INSTALL_DIR=%PYTHON_INSTALL_DIR% ^ -DPYTHON_EXECUTABLE=%PYTHON% -if errorlevel 1 exit 1 +if %errorlevel% neq 0 exit 1 :: Copy the [de]activate scripts to %PREFIX%\etc\conda\[de]activate.d. :: This will allow them to be run on environment activation.