Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROS libraries on macOS leave it to the application to load a Python shared library #1

Merged
merged 1 commit into from
Mar 20, 2025

Conversation

EliaCereda
Copy link

@EliaCereda EliaCereda commented Mar 20, 2025

Without this change, Coppelia fails to dlopen the libsimROS2.dylib because it needs Python symbols but does load libpython itself.

Error in Coppelia log window

plugin simROS2: Cannot load library /Applications/coppeliaSim.app/Contents/MacOS/libsimROS2.dylib: (dlopen(/Applications/coppeliaSim.app/Contents/MacOS/libsimROS2.dylib, 0x0005): symbol not found in flat namespace '_PyExc_RuntimeError')

@EliaCereda EliaCereda changed the base branch from master to iron-4.6 March 20, 2025 17:06
@jeguzzi jeguzzi added the hack label Mar 20, 2025
@jeguzzi
Copy link
Owner

jeguzzi commented Mar 20, 2025

Note: this is not a bug of the CoppeliaSim plugin but an hack to force loading the python shared lib, which is needed to overcome a problem when using ROS installed with pixi+robostack on macOS.

@jeguzzi jeguzzi merged commit 66cf4ba into jeguzzi:iron-4.6 Mar 20, 2025
@traversaro
Copy link

Note: this is not a bug of the CoppeliaSim plugin but an hack to force loading the python shared lib, which is needed to overcome a problem when using ROS installed with pixi+robostack on macOS.

Just to clarify (as I spent some time to fully grasp the problem myself in other case) the reason for that is that conda-forge Python interpreter statically links the libpython library, and so Python extensions on conda-forge (or in related distros, like robostack) do not link the libpython libraries to avoid crashes at runtime (as far as I know, just on macOS).

@traversaro
Copy link

traversaro commented Mar 27, 2025

xref to the related discussion in astral-sh/python-build-standalone#540 and ros2/rclpy#1305 for a related ROS 2 upstream fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants