Skip to content

Commit 8d61fb0

Browse files
committed
Add build files 2026-03-22-2148
1 parent 1152b88 commit 8d61fb0

File tree

7 files changed

+470
-0
lines changed

7 files changed

+470
-0
lines changed

.github/workflows/win.yml

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
jobs:
2+
stage_0_job_0:
3+
name: controller-manager
4+
runs-on: windows-2022
5+
strategy:
6+
fail-fast: false
7+
needs: []
8+
env:
9+
CONDA_BLD_PATH: C:\\bld\\
10+
VINCA_CUSTOM_CMAKE_BUILD_DIR: C:\\x\\
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v6
14+
- name: Setup pixi
15+
uses: prefix-dev/setup-pixi@v0.9.4
16+
with:
17+
pixi-version: v0.63.2
18+
cache: 'true'
19+
- uses: egor-tensin/cleanup-path@v5
20+
with:
21+
dirs: C:\Program Files\Git\usr\bin;C:\Program Files\Git\bin;C:\Program Files\Git\cmd;C:\Program
22+
Files\Git\mingw64\bin
23+
- shell: cmd
24+
run: |
25+
set "CI=true"
26+
27+
:: 4 cores available on GHA: https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
28+
:: CPU_COUNT is passed through conda build: https://github.com/conda/conda-build/pull/1149
29+
set CPU_COUNT=4
30+
31+
set PYTHONUNBUFFERED=1
32+
33+
call setup_x64
34+
35+
:: Set the conda-build working directory to a smaller path
36+
if "%CONDA_BLD_PATH%" == "" (
37+
set "CONDA_BLD_PATH=C:\\bld\\"
38+
)
39+
40+
:: On azure, there are libcrypto*.dll & libssl*.dll under
41+
:: C:\\Windows\\System32, which should not be there (no vendor dlls in windows folder).
42+
:: They would be found before the openssl libs of the conda environment, so we delete them.
43+
if defined CI (
44+
DEL C:\\Windows\\System32\\libcrypto-1_1-x64.dll || (Echo Ignoring failure to delete C:\\Windows\\System32\\libcrypto-1_1-x64.dll)
45+
DEL C:\\Windows\\System32\\libssl-1_1-x64.dll || (Echo Ignoring failure to delete C:\\Windows\\System32\\libssl-1_1-x64.dll)
46+
)
47+
48+
:: Make paths like C:\\hostedtoolcache\\windows\\Ruby\\2.5.7\\x64\\bin garbage
49+
set "PATH=%PATH:ostedtoolcache=%"
50+
name: conda-forge build setup
51+
- shell: cmd
52+
run: |
53+
setlocal EnableExtensions EnableDelayedExpansion
54+
55+
set CONDA_BLD_PATH=C:\bld
56+
echo "PATH is %PATH%"
57+
58+
rmdir /Q/S C:\Strawberry\
59+
rmdir /Q/S "C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\"
60+
61+
set "FEEDSTOCK_ROOT=%cd%"
62+
63+
mkdir %CONDA_BLD_PATH%
64+
65+
:: Enable long path names on Windows
66+
reg add HKLM\SYSTEM\CurrentControlSet\Control\FileSystem /v LongPathsEnabled /t REG_DWORD /d 1 /f
67+
68+
for %%X in (%CURRENT_RECIPES%) do (
69+
echo "BUILDING RECIPE %%X"
70+
cd %FEEDSTOCK_ROOT%\recipes\%%X\
71+
pixi run -v rattler-build build --recipe %FEEDSTOCK_ROOT%\recipes\%%X\ ^
72+
-m %FEEDSTOCK_ROOT%\conda_build_config.yaml ^
73+
-c conda-forge -c robostack-staging ^
74+
--output-dir %CONDA_BLD_PATH%
75+
76+
if errorlevel 1 exit 1
77+
rem -m %FEEDSTOCK_ROOT%\.ci_support\conda_forge_pinnings.yaml
78+
)
79+
80+
:: Check if .conda files exist in the win-64 directory
81+
if exist "%CONDA_BLD_PATH%\win-64\*.conda" (
82+
echo Found .conda files, starting upload...
83+
for %%F in ("%CONDA_BLD_PATH%\win-64\*.conda") do (
84+
echo Uploading %%F
85+
pixi run upload "%%F" --force
86+
if errorlevel 1 exit 1
87+
)
88+
) else (
89+
echo Warning: No .conda files found in %CONDA_BLD_PATH%\win-64
90+
echo This might be due to all the packages being skipped
91+
)
92+
env:
93+
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_API_TOKEN }}
94+
CURRENT_RECIPES: ros-humble-controller-manager
95+
PYTHONUNBUFFERED: 1
96+
name: Build ros-humble-controller-manager
97+
name: build_win
98+
on:
99+
push:
100+
branches:
101+
- buildbranch_win

buildorder.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ros-humble-controller-manager
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
:: Generated by vinca http://github.com/RoboStack/vinca.
2+
:: DO NOT EDIT!
3+
setlocal EnableDelayedExpansion
4+
5+
set "PYTHONPATH=%LIBRARY_PREFIX%\lib\site-packages;%SP_DIR%"
6+
7+
:: MSVC is preferred.
8+
set CC=cl.exe
9+
set CXX=cl.exe
10+
11+
:: If defined, can use a custom CMake build directory which can be useful
12+
:: to avoid too long path problems on windows
13+
if defined VINCA_CUSTOM_CMAKE_BUILD_DIR (
14+
if not exist "%VINCA_CUSTOM_CMAKE_BUILD_DIR%\" (
15+
mkdir "%VINCA_CUSTOM_CMAKE_BUILD_DIR%"
16+
)
17+
cd /d "%VINCA_CUSTOM_CMAKE_BUILD_DIR%"
18+
)
19+
rd /s /q build
20+
mkdir build
21+
pushd build
22+
23+
:: set "CMAKE_GENERATOR=Ninja"
24+
:: We use the Visual Studio generator as a workaround for
25+
:: problems in Ninja when using long paths, see https://github.com/RoboStack/ros-humble/pull/229#issuecomment-2564856467
26+
:: Once those are solved, we can switch back to use Ninja
27+
set "CMAKE_GENERATOR=Visual Studio %VS_MAJOR% %VS_YEAR%"
28+
29+
:: PYTHON_INSTALL_DIR should be a relative path, see
30+
:: https://github.com/ament/ament_cmake/blob/2.3.2/ament_cmake_python/README.md
31+
:: So we compute the relative path of %SP_DIR% w.r.t. to LIBRARY_PREFIX,
32+
:: but it is not trivial to do this in Command Prompt scripting, so let's do it via
33+
:: python
34+
35+
:: This line is scary, but it basically assigns the output of the command inside (` and `)
36+
:: to the variable specified after DO SET
37+
:: The equivalent in bash is PYTHON_INSTALL_DIR=`python -c ...`
38+
FOR /F "tokens=* USEBACKQ" %%i IN (`python -c "import os;print(os.path.relpath(os.environ['SP_DIR'],os.environ['LIBRARY_PREFIX']).replace('\\','/'))"`) DO SET PYTHON_INSTALL_DIR=%%i
39+
40+
cmake ^
41+
-G "%CMAKE_GENERATOR%" ^
42+
-DCMAKE_INSTALL_PREFIX=%LIBRARY_PREFIX% ^
43+
-DCMAKE_BUILD_TYPE=Release ^
44+
-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True ^
45+
-DPYTHON_EXECUTABLE=%PYTHON% ^
46+
-DPython_EXECUTABLE=%PYTHON% ^
47+
-DPython3_EXECUTABLE=%PYTHON% ^
48+
-DSETUPTOOLS_DEB_LAYOUT=OFF ^
49+
-DBUILD_SHARED_LIBS=ON ^
50+
-DBUILD_TESTING=OFF ^
51+
-DCMAKE_OBJECT_PATH_MAX=255 ^
52+
--compile-no-warning-as-error ^
53+
-DPYTHON_INSTALL_DIR=%PYTHON_INSTALL_DIR% ^
54+
^
55+
%SRC_DIR%\%PKG_NAME%\src\work\
56+
if errorlevel 1 exit 1
57+
58+
:: We explicitly pass %CPU_COUNT% to cmake --build as we are not using Ninja,
59+
:: see the comment before setting the CMAKE_GENERATOR env variable
60+
cmake --build . --config Release --parallel %CPU_COUNT% --target install
61+
if errorlevel 1 exit 1
Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
# Generated by vinca http://github.com/RoboStack/vinca.
2+
# DO NOT EDIT!
3+
4+
set -eo pipefail
5+
6+
if [[ -n "$VINCA_CUSTOM_CMAKE_BUILD_DIR" ]]; then
7+
mkdir -p "$VINCA_CUSTOM_CMAKE_BUILD_DIR"
8+
cd "$VINCA_CUSTOM_CMAKE_BUILD_DIR"
9+
fi
10+
rm -rf build
11+
mkdir build
12+
cd build
13+
14+
# necessary for correctly linking SIP files (from python_qt_bindings)
15+
export LINK=$CXX
16+
17+
if [[ "$CONDA_BUILD_CROSS_COMPILATION" != "1" ]]; then
18+
PYTHON_EXECUTABLE=$PREFIX/bin/python
19+
PKG_CONFIG_EXECUTABLE=$PREFIX/bin/pkg-config
20+
OSX_DEPLOYMENT_TARGET="10.15"
21+
else
22+
PYTHON_EXECUTABLE=$BUILD_PREFIX/bin/python
23+
PKG_CONFIG_EXECUTABLE=$BUILD_PREFIX/bin/pkg-config
24+
OSX_DEPLOYMENT_TARGET="11.0"
25+
fi
26+
27+
if [[ "${CONDA_BUILD_CROSS_COMPILATION:-}" == "1" ]]; then
28+
export QT_HOST_PATH="$BUILD_PREFIX"
29+
else
30+
export QT_HOST_PATH="$PREFIX"
31+
fi
32+
33+
echo "USING PYTHON_EXECUTABLE=${PYTHON_EXECUTABLE}"
34+
echo "USING PKG_CONFIG_EXECUTABLE=${PKG_CONFIG_EXECUTABLE}"
35+
36+
export ROS_PYTHON_VERSION=`$PYTHON_EXECUTABLE -c "import sys; print('%i.%i' % (sys.version_info[0:2]))"`
37+
echo "Using Python ${ROS_PYTHON_VERSION}"
38+
39+
export ROS_DISTRO="humble"
40+
41+
# see https://github.com/conda-forge/cross-python-feedstock/issues/24
42+
if [[ "$CONDA_BUILD_CROSS_COMPILATION" == "1" ]]; then
43+
find $PREFIX/lib/cmake -type f -exec sed -i "s~\${_IMPORT_PREFIX}/lib/python${ROS_PYTHON_VERSION}/site-packages~${BUILD_PREFIX}/lib/python${ROS_PYTHON_VERSION}/site-packages~g" {} + || true
44+
find $PREFIX/share/rosidl* -type f -exec sed -i "s~${PREFIX}/lib/python${ROS_PYTHON_VERSION}/site-packages~${BUILD_PREFIX}/lib/python${ROS_PYTHON_VERSION}/site-packages~g" {} + || true
45+
find $PREFIX/share/rosidl* -type f -exec sed -i "s~\${_IMPORT_PREFIX}/lib/python${ROS_PYTHON_VERSION}/site-packages~${BUILD_PREFIX}/lib/python${ROS_PYTHON_VERSION}/site-packages~g" {} + || true
46+
find $PREFIX/lib/cmake -type f -exec sed -i "s~message(FATAL_ERROR \"The imported target~message(WARNING \"The imported target~g" {} + || true
47+
fi
48+
49+
if [[ $target_platform =~ linux.* ]]; then
50+
export CFLAGS="${CFLAGS} -D__STDC_FORMAT_MACROS=1"
51+
export CXXFLAGS="${CXXFLAGS} -D__STDC_FORMAT_MACROS=1"
52+
fi;
53+
54+
# Needed for qt-gui-cpp ..
55+
if [[ $target_platform =~ linux.* ]]; then
56+
ln -s $GCC ${BUILD_PREFIX}/bin/gcc
57+
ln -s $GXX ${BUILD_PREFIX}/bin/g++
58+
fi;
59+
60+
# PYTHON_INSTALL_DIR should be a relative path, see
61+
# https://github.com/ament/ament_cmake/blob/2.3.2/ament_cmake_python/README.md
62+
# So we compute the relative path of $SP_DIR w.r.t. to $PREFIX,
63+
# but it is not trivial to do this in bash scripting, so let's do it via python
64+
export PYTHON_INSTALL_DIR=`python -c "import os;print(os.path.relpath(os.environ['SP_DIR'],os.environ['PREFIX']))"`
65+
echo "Using PYTHON_INSTALL_DIR: $PYTHON_INSTALL_DIR"
66+
67+
if [[ $target_platform =~ emscripten.* ]]; then
68+
export CONDA_BUILD_CROSS_COMPILATION="1"
69+
PYTHON_EXECUTABLE=$BUILD_PREFIX/bin/python$PY_VER
70+
echo "set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)"> $SRC_DIR/__vinca_shared_lib_patch.cmake
71+
echo "set(CMAKE_STRIP FALSE) # used by default in pybind11 on .so modules">> $SRC_DIR/__vinca_shared_lib_patch.cmake
72+
echo "set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH) # fixes an error where numpy header files are not found correctly">> $SRC_DIR/__vinca_shared_lib_patch.cmake
73+
74+
# if [ "${PKG_NAME}" == "ros-humble-examples-rclcpp-minimal-publisher" ] || [ "${PKG_NAME}" == "ros-humble-examples-rclcpp-minimal-subscriber" ] || [ "${PKG_NAME}" == "ros-humble-rclcpp-components" ]; then
75+
# echo "set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS \"-s ASSERTIONS=1 -s SIDE_MODULE=1 -sWASM_BIGINT -s USE_PTHREADS=0 -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 \")">> $SRC_DIR/__vinca_shared_lib_patch.cmake
76+
# echo "set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS \"-s ASSERTIONS=1 -s SIDE_MODULE=1 -sWASM_BIGINT -s USE_PTHREADS=0 -s DEMANGLE_SUPPORT=1 -s ALLOW_MEMORY_GROWTH=1 -sASYNCIFY -O3 -s ASYNCIFY_STACK_SIZE=24576 \")">> $SRC_DIR/__vinca_shared_lib_patch.cmake
77+
# echo "set(CMAKE_EXE_LINKER_FLAGS \"-sMAIN_MODULE=1 -sASSERTIONS=1 -fexceptions -lembind -sWASM_BIGINT -s USE_PTHREADS=0 -s DEMANGLE_SUPPORT=1 -sALLOW_MEMORY_GROWTH=1 -sASYNCIFY -O3 -s ASYNCIFY_STACK_SIZE=24576 -L$SRC_DIR/build -L$PREFIX/lib\") # remove SIDE_MODULE from exe linker flags">> $SRC_DIR/__vinca_shared_lib_patch.cmake
78+
# else
79+
echo "set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS \"-s ASSERTIONS=1 -s SIDE_MODULE=1 -sWASM_BIGINT -s USE_PTHREADS=0 -s ALLOW_MEMORY_GROWTH=1 -s DEMANGLE_SUPPORT=1 \")">> $SRC_DIR/__vinca_shared_lib_patch.cmake
80+
echo "set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS \"-s ASSERTIONS=1 -s SIDE_MODULE=1 -sWASM_BIGINT -s USE_PTHREADS=0 -s ALLOW_MEMORY_GROWTH=1 -s DEMANGLE_SUPPORT=1 \")">> $SRC_DIR/__vinca_shared_lib_patch.cmake
81+
echo "set(CMAKE_EXE_LINKER_FLAGS \"-sMAIN_MODULE=1 -sASSERTIONS=1 -fexceptions -lembind -sWASM_BIGINT -s USE_PTHREADS=0 -sALLOW_MEMORY_GROWTH=1 -s DEMANGLE_SUPPORT=1 -L$SRC_DIR/build -L$PREFIX/lib\") # remove SIDE_MODULE from exe linker flags">> $SRC_DIR/__vinca_shared_lib_patch.cmake
82+
# fi
83+
84+
export BUILD_TYPE="Debug"
85+
export EXTRA_CMAKE_ARGS=" \
86+
-DPYTHON_SOABI="cpython-${ROS_PYTHON_VERSION//./}-wasm32-emscripten" \
87+
-DRMW_IMPLEMENTATION=rmw_wasm_cpp \
88+
-DCMAKE_FIND_ROOT_PATH=$PREFIX \
89+
-DCMAKE_POSITION_INDEPENDENT_CODE=TRUE \
90+
-DCMAKE_PROJECT_INCLUDE=$SRC_DIR/__vinca_shared_lib_patch.cmake \
91+
"
92+
93+
unset -f cmake
94+
export CMAKE_GEN="emcmake cmake"
95+
export CMAKE_BLD="cmake"
96+
97+
export STATIC_ROSIDL_TYPESUPPORT_C=rosidl_typesupport_introspection_c
98+
export STATIC_ROSIDL_TYPESUPPORT_CPP=rosidl_typesupport_introspection_cpp
99+
else
100+
export BUILD_TYPE="Release"
101+
export CMAKE_GEN="cmake"
102+
export CMAKE_BLD="cmake"
103+
fi;
104+
105+
if [ "${PKG_NAME}" == "ros-humble-rmw-wasm-cpp" ]; then
106+
WORK_DIR=$SRC_DIR/$PKG_NAME/src/work/rmw_wasm_cpp
107+
elif [ "${PKG_NAME}" == "ros-humble-wasm-cpp" ]; then
108+
WORK_DIR=$SRC_DIR/$PKG_NAME/src/work/wasm_cpp
109+
elif [ "${PKG_NAME}" == "dynmsg" ]; then
110+
WORK_DIR=$SRC_DIR/$PKG_NAME/src/work/dynmsg
111+
else
112+
WORK_DIR=$SRC_DIR/$PKG_NAME/src/work/
113+
fi;
114+
115+
$CMAKE_GEN \
116+
-G "Ninja" \
117+
-DCMAKE_BUILD_TYPE=$BUILD_TYPE \
118+
-DCMAKE_INSTALL_PREFIX=$PREFIX \
119+
-DCMAKE_PREFIX_PATH=$PREFIX \
120+
-DAMENT_PREFIX_PATH=$PREFIX \
121+
-DCMAKE_INSTALL_LIBDIR=lib \
122+
-DPYTHON_EXECUTABLE=$PYTHON_EXECUTABLE \
123+
-DPython_EXECUTABLE=$PYTHON_EXECUTABLE \
124+
-DPython3_EXECUTABLE=$PYTHON_EXECUTABLE \
125+
-DPython3_FIND_STRATEGY=LOCATION \
126+
-DPKG_CONFIG_EXECUTABLE=$PKG_CONFIG_EXECUTABLE \
127+
-DPYTHON_INSTALL_DIR=$PYTHON_INSTALL_DIR \
128+
-DSETUPTOOLS_DEB_LAYOUT=OFF \
129+
-DCATKIN_SKIP_TESTING=$SKIP_TESTING \
130+
-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=True \
131+
-DBUILD_SHARED_LIBS=ON \
132+
-DBUILD_TESTING=OFF \
133+
-DCMAKE_IGNORE_PREFIX_PATH="/opt/homebrew;/usr/local/homebrew" \
134+
-DCMAKE_OSX_DEPLOYMENT_TARGET=$OSX_DEPLOYMENT_TARGET \
135+
--compile-no-warning-as-error \
136+
$EXTRA_CMAKE_ARGS \
137+
\
138+
$WORK_DIR
139+
140+
$CMAKE_BLD --build . --config $BUILD_TYPE --target install
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp
2+
index 6e088a2e..feca559f 100644
3+
--- a/controller_manager/src/controller_manager.cpp
4+
+++ b/controller_manager/src/controller_manager.cpp
5+
@@ -94,7 +94,7 @@ bool controller_name_compare(const controller_manager::ControllerSpec & a, const
6+
* \return true if interface has a controller name as prefix, false otherwise.
7+
*/
8+
bool command_interface_is_reference_interface_of_controller(
9+
- const std::string interface_name,
10+
+ const std::string & interface_name,
11+
const std::vector<controller_manager::ControllerSpec> & controllers,
12+
controller_manager::ControllersListIterator & following_controller_it)
13+
{
14+
@@ -146,7 +146,7 @@ bool command_interface_is_reference_interface_of_controller(
15+
* empty.
16+
*/
17+
std::vector<std::string> get_following_controller_names(
18+
- const std::string controller_name,
19+
+ const std::string & controller_name,
20+
const std::vector<controller_manager::ControllerSpec> & controllers)
21+
{
22+
std::vector<std::string> following_controllers;
23+
@@ -208,7 +208,7 @@ std::vector<std::string> get_following_controller_names(
24+
* empty.
25+
*/
26+
std::vector<std::string> get_preceding_controller_names(
27+
- const std::string controller_name,
28+
+ const std::string & controller_name,
29+
const std::vector<controller_manager::ControllerSpec> & controllers)
30+
{
31+
std::vector<std::string> preceding_controllers;
32+
@@ -1319,7 +1319,7 @@ controller_interface::return_type ControllerManager::switch_controller(
33+
switch_params_.do_switch = true;
34+
// wait until switch is finished
35+
RCLCPP_DEBUG(get_logger(), "Requested atomic controller switch from realtime loop");
36+
- std::unique_lock<std::mutex> switch_params_guard(switch_params_.mutex, std::defer_lock);
37+
+ std::unique_lock<std::mutex> switch_params_guard(switch_params_.mutex);
38+
if (!switch_params_.cv.wait_for(
39+
switch_params_guard, switch_params_.timeout, [this] { return !switch_params_.do_switch; }))
40+
{
41+

0 commit comments

Comments
 (0)