-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
pybind: Should restore fork's latest commit in workspace pending mac fix #14047
Comments
So this issue is restoring the fork or fixing the underlying Mac issue? |
Fixing the underlying Mac issue for building in CMake that causes the RTTI mismatch, most likely due to some visibility changes that came from the fork updates. (RobotLocomotion/pybind11 itself is unchanged at present, and I don't think we should revert anything there) |
FTR On I confirmed that drake @ 690a7ea works (post-revert), and drake @ 0cc01f0 (pre-revert) reprodues the error: cd .../drake
bazel run //:install -- /tmp/drake
cd .../bazel-external-examples/drake_cmake_installed
mkdir build && cd build
cmake -DCMAKE_PREFIX_PATH=/tmp/drake ..
cd src/simple_bindings/
make && ctest -V -R |
Ok, can you update the title to match? |
Done. My money's on some change from upstream's CMake in |
Yuppers. It looks like pybind/pybind11@97aa54fefa is the culprit. Here's the patch-fix for diff --git a/drake_cmake_installed/src/simple_bindings/CMakeLists.txt b/drake_cmake_installed/src/simple_bindings/CMakeLists.txt
index 1fde04b..d8530c3 100644
--- a/drake_cmake_installed/src/simple_bindings/CMakeLists.txt
+++ b/drake_cmake_installed/src/simple_bindings/CMakeLists.txt
@@ -33,7 +33,14 @@
find_package(pybind11 CONFIG REQUIRED)
pybind11_add_module(simple_bindings MODULE simple_bindings.cc)
-target_link_libraries(simple_bindings PUBLIC drake::drake pybind11::module)
+target_link_libraries(simple_bindings PUBLIC drake::drake)
+# N.B. `pybind11_add_module` normally sets the default visibility to "hidden"
+# to avoid warnings. However, we generally take care in Drake to avoid mixing
+# hidden and public symbols, so we should we confidently re-enable this
+# setting.
+# For more information, see:
+# https://github.com/RobotLocomotion/drake/issues/14047
+set_target_properties(simple_bindings PROPERTIES CXX_VISIBILITY_PRESET "default")
add_test(NAME simple_bindings_test COMMAND
"${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/simple_bindings_test.py") My desire is to leave upstream's CMake logic as untouched as possible. I think just propogating this specific |
Filed upstream issue to pybind11: pybind/pybind11#2479 |
See: #14046 (comment)
This was reproducible on our
macsim
machine.@jamiesnape I will try this briefly. If I can't make this work today, can I ask you to put this at the top of your
pydrake
queue for the next two weeks?UPDATE: Plan of attack:
-fvisibility=default
. This should merge first.The text was updated successfully, but these errors were encountered: