Closed traversaro closed 2 years ago
A workaround is renaming %CONDA_PREFIX%\Lib\site-packages\rclpy\_rclpy_pybind11.dll
and %CONDA_PREFIX%\Lib\site-packages\rclpy\_rclpy_signal_handler.dll
to %CONDA_PREFIX%\Lib\site-packages\rclpy\_rclpy_pybind11.pyd
and %CONDA_PREFIX%\Lib\site-packages\rclpy\_rclpy_signal_handler.pyd
.
Out of the packages installed by ros-galactic-desktop, the two packages affected by this are rclpy
and rosbag2_py
. There are a lot of other packages that instead have correctly named .pyd
files, but most of them are packages of msgs that have <..>__rosidl_typesupport_c.pyd
, <..>__rosidl_typesupport_fastrtps_c.pyd
and <..>__rosidl_typesupport_introspection_c.pyd
files.
Fixing osx-arm64 seems to have led to this error. I think all it takes is setting the IMPORT_SUFFIX as in https://cmake.cmake.narkive.com/azPoFCCq/can-i-change-the-extension-of-a-dll in the patches (see https://github.com/RoboStack/ros-galactic/blob/main/patch/ros-galactic-rclpy.patch for rclypy)
I think IMPORT_SUFFIX
is to specify the extention of the .lib
libraries. The code called by pybind11_add_module
is https://github.com/pybind/pybind11/blob/b3ebd11d9851007f525e2e41de53b7913b24787c/tools/pybind11Tools.cmake#L132 :
# The prefix and extension are provided by FindPythonLibsNew.cmake
set_target_properties(${name} PROPERTIES PREFIX "${PYTHON_MODULE_PREFIX}"
SUFFIX "${PYTHON_MODULE_EXTENSION}")
I tried to provid a fix in https://github.com/RoboStack/ros-galactic/issues/97 , as all the new code is guarded by if(WIN32)
it should not affect the other environments.
Working fine after https://github.com/RoboStack/ros-galactic/pull/97 :
(ros2) C:\Users\STraversaro>ros2 run demo_nodes_py demo_talker
[INFO] [1648985579.630156000] [talker]: Publishing: "Hello World: 0"
[INFO] [1648985580.556038200] [talker]: Publishing: "Hello World: 1"
[INFO] [1648985581.542916100] [talker]: Publishing: "Hello World: 2"
[INFO] [1648985582.546812300] [talker]: Publishing: "Hello World: 3"
See https://github.com/RoboStack/ros-galactic/issues/74#issuecomment-1085925657 .