GithubHelp home page GithubHelp logo

pybind / pybind11_abseil Goto Github PK

View Code? Open in Web Editor NEW
24.0 24.0 14.0 208 KB

Pybind11 bindings for the Abseil C++ Common Libraries

License: Other

Starlark 8.37% C++ 56.81% Python 26.30% Shell 1.59% C 0.15% CMake 6.78%

pybind11_abseil's Issues

status target conflict with abseil-cpp ones

If a super build project use set(ABSL_ENABLE_INSTALL ON) or modify the pybind11_abseil CMakelists.txt as fallow

diff --git a/CMakeLists.txt b/CMakeLists.txt
index ceb65a8..4f4ed9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,8 +19,11 @@ endif()
 FetchContent_Declare(
   abseil-cpp
   URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
   URL_HASH
     SHA256=59d2976af9d6ecf001a81a35749a6e551a335b949d34918cfade07737b9d93c5)
+  #GIT_REPOSITORY "https://github.com/abseil/abseil-cpp.git"
+  #GIT_TAG "20230802.1"
+)
+set(ABSL_ENABLE_INSTALL ON)
 
 FetchContent_Declare(
   pybind11

note: same behaviour with the last abseil-cpp release

we got:

$ cmake -S. -Bbuild
-- The CXX compiler identification is GNU 13.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test ABSL_INTERNAL_AT_LEAST_CXX17
-- Performing Test ABSL_INTERNAL_AT_LEAST_CXX17 - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE  
-- pybind11 v2.12.0 dev1
-- Found Python: /usr/bin/python3.11 (found suitable version "3.11.6", minimum required is "3.6") found components: Interpreter Development.Module Development.Embed 
CMake Error at pybind11_abseil/CMakeLists.txt:153 (add_library):
add_library cannot create target "status" because another target with the
same name already exists.  The existing target is a static library created
in source directory
"/usr/local/google/home/corentinl/work/pybind11_abseil/build/_deps/abseil-cpp-src/absl/status".
See documentation for policy CMP0002 for more details.


CMake Error at pybind11_abseil/CMakeLists.txt:160 (target_link_libraries):
Attempt to add link library "status_pyinit_google3" to target "status"
which is not built in this directory.

This is allowed only when policy CMP0079 is set to NEW.


-- Configuring incomplete, errors occurred!

The code:

# status ====================================================================
add_library(status SHARED status_py_extension_stub.cc)
add_library(pybind11_abseil::status ALIAS status)
target_include_directories(status INTERFACE $<BUILD_INTERFACE:${TOP_LEVEL_DIR}>)
set_target_properties(status PROPERTIES PREFIX "")
target_link_libraries(status PUBLIC status_pyinit_google3 absl::status)
# import_status_module =========================================================
add_library(import_status_module STATIC import_status_module.cc)
add_library(pybind11_abseil::import_status_module ALIAS import_status_module)
target_include_directories(import_status_module
INTERFACE $<BUILD_INTERFACE:${TOP_LEVEL_DIR}>)
target_link_libraries(import_status_module PUBLIC status)

The problem is that cmake TARGET names are not scoped thus the name clash, on my way to provide a patch in google/or-tools then a PR here...
would go for

# change logical target name
add_library(status_py_extension_stub SHARED status_py_extension_stub.cc)
# but keep the previous base name, "status" for the output file...
set_target_properties(status_py_extension_stub  PROPERTIES LIBRARY_OUTPUT_NAME "status")
# we can keep the ALIAS unchanged to pybind11_abseil::status
add_library(pybind11_abseil::status ALIAS status_py_extension_stub)

Deprecated Abseil types ie.(`Breakdown`) in use

It appears that pybind11_abseil uses deprecated types. ie. Breakdown, From_Datetime. Will/when will this be updated?

These issues seem to appear even when using the 20230802.0 tag of abseil-cpp as specified in the WORKSPACE file.

For a more complete example of the deprecated features see a failed build:

external/pybind11_abseil/pybind11_abseil/absl_casters.h:132:33: error: 'Breakdown' is deprecated: Use `absl::TimeZone::CivilInfo`. [-Werror=deprecated-declarations]
  132 | constexpr absl::Time::Breakdown kDatetimeInfiniteFuture = {
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 from pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:805:62: note: declared here
  805 |   struct ABSL_DEPRECATED("Use `absl::TimeZone::CivilInfo`.") Breakdown {
      |                                                              ^~~~~~~~~
In file included from pybind_example.cc:21:
external/pybind11_abseil/pybind11_abseil/absl_casters.h:133:57: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::weekday' [-Werror=missing-field-initializers]
  133 |     9999, 12, 31, 23, 59, 59, absl::Microseconds(999999)};
      |                                                         ^
external/pybind11_abseil/pybind11_abseil/absl_casters.h:133:57: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::yearday' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:133:57: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::offset' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:133:57: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::is_dst' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:133:57: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::zone_abbr' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:134:33: error: 'Breakdown' is deprecated: Use `absl::TimeZone::CivilInfo`. [-Werror=deprecated-declarations]
  134 | constexpr absl::Time::Breakdown kDatetimeInfinitePast = {
      |                                 ^~~~~~~~~~~~~~~~~~~~~
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 from pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:805:62: note: declared here
  805 |   struct ABSL_DEPRECATED("Use `absl::TimeZone::CivilInfo`.") Breakdown {
      |                                                              ^~~~~~~~~
In file included from pybind_example.cc:21:
external/pybind11_abseil/pybind11_abseil/absl_casters.h:135:43: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::weekday' [-Werror=missing-field-initializers]
  135 |     1, 1, 1, 0, 0, 0, absl::ZeroDuration()};
      |                                           ^
external/pybind11_abseil/pybind11_abseil/absl_casters.h:135:43: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::yearday' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:135:43: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::offset' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:135:43: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::is_dst' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:135:43: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::zone_abbr' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:147:72: error: 'Breakdown' is deprecated [-Werror=deprecated-declarations]
  147 |                                 const absl::Time::Breakdown& bd_special) {
      |                                                                        ^
external/pybind11_abseil/pybind11_abseil/absl_casters.h:147:72: error: 'Breakdown' is deprecated [-Werror=deprecated-declarations]
external/pybind11_abseil/pybind11_abseil/absl_casters.h: In member function 'bool pybind11::detail::type_caster<absl::lts_20230802::Time>::load(pybind11::handle, bool)':
external/pybind11_abseil/pybind11_abseil/absl_casters.h:233:29: error: 'Breakdown' is deprecated: Use `absl::TimeZone::CivilInfo`. [-Werror=deprecated-declarations]
  233 |       absl::Time::Breakdown bd_py = {
      |                             ^~~~~
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 from pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:805:62: note: declared here
  805 |   struct ABSL_DEPRECATED("Use `absl::TimeZone::CivilInfo`.") Breakdown {
      |                                                              ^~~~~~~~~
In file included from pybind_example.cc:21:
external/pybind11_abseil/pybind11_abseil/absl_casters.h:240:73: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::weekday' [-Werror=missing-field-initializers]
  240 |           absl::Microseconds(PyDateTime_DATE_GET_MICROSECOND(src.ptr()))};
      |                                                                         ^
external/pybind11_abseil/pybind11_abseil/absl_casters.h:240:73: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::yearday' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:240:73: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::offset' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:240:73: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::is_dst' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:240:73: error: missing initializer for member 'absl::lts_20230802::Time::Breakdown::zone_abbr' [-Werror=missing-field-initializers]
external/pybind11_abseil/pybind11_abseil/absl_casters.h:271:21: error: 'absl::lts_20230802::Time absl::lts_20230802::FromDateTime(int64_t, int, int, int, int, int, absl::lts_20230802::TimeZone)' is deprecated: Use `absl::FromCivil(CivilSecond, TimeZone)`. [-Werror=deprecated-declarations]
  271 |       value = absl::FromDateTime(
      |                     ^~~~~~~~~~~~
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 from pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:1384:13: note: declared here
 1384 | inline Time FromDateTime(int64_t year, int mon, int day, int hour, int min,
      |             ^~~~~~~~~~~~
In file included from pybind_example.cc:21:
external/pybind11_abseil/pybind11_abseil/absl_casters.h:273:72: error: 'absl::lts_20230802::Time absl::lts_20230802::FromDateTime(int64_t, int, int, int, int, int, absl::lts_20230802::TimeZone)' is deprecated: Use `absl::FromCivil(CivilSecond, TimeZone)`. [-Werror=deprecated-declarations]
  273 |           PyDateTime_GET_DAY(src.ptr()), 0, 0, 0, absl::LocalTimeZone());
      |                                                                        ^
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 from pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:1384:13: note: declared here
 1384 | inline Time FromDateTime(int64_t year, int mon, int day, int hour, int min,
      |             ^~~~~~~~~~~~
In file included from pybind_example.cc:21:
external/pybind11_abseil/pybind11_abseil/absl_casters.h:273:72: error: 'absl::lts_20230802::Time absl::lts_20230802::FromDateTime(int64_t, int, int, int, int, int, absl::lts_20230802::TimeZone)' is deprecated: Use `absl::FromCivil(CivilSecond, TimeZone)`. [-Werror=deprecated-declarations]
  273 |           PyDateTime_GET_DAY(src.ptr()), 0, 0, 0, absl::LocalTimeZone());
      |                                                                        ^
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 from pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:1384:13: note: declared here
 1384 | inline Time FromDateTime(int64_t year, int mon, int day, int hour, int min,
      |             ^~~~~~~~~~~~
In file included from pybind_example.cc:21:
external/pybind11_abseil/pybind11_abseil/absl_casters.h: In static member function 'static pybind11::handle pybind11::detail::type_caster<absl::lts_20230802::Time>::cast(const absl::lts_20230802::Time&, pybind11::return_value_policy, pybind11::handle)':
external/pybind11_abseil/pybind11_abseil/absl_casters.h:295:27: error: 'Breakdown' is deprecated: Use `absl::TimeZone::CivilInfo`. [-Werror=deprecated-declarations]
  295 |     absl::Time::Breakdown t = src.In(absl::UTCTimeZone());
      |                           ^
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 from pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:805:62: note: declared here
  805 |   struct ABSL_DEPRECATED("Use `absl::TimeZone::CivilInfo`.") Breakdown {
      |                                                              ^~~~~~~~~
In file included from pybind_example.cc:21:
external/pybind11_abseil/pybind11_abseil/absl_casters.h:295:57: error: 'absl::lts_20230802::Time::Breakdown absl::lts_20230802::Time::In(absl::lts_20230802::TimeZone) const' is deprecated: Use `absl::TimeZone::At(Time)`. [-Werror=deprecated-declarations]
  295 |     absl::Time::Breakdown t = src.In(absl::UTCTimeZone());
      |                                                         ^
In file included from external/com_google_absl/absl/time/clock.h:26,
                 from external/com_google_absl/absl/synchronization/internal/kernel_timeout.h:30,
                 from external/com_google_absl/absl/synchronization/mutex.h:74,
                 from external/com_google_absl/absl/strings/internal/cordz_info.h:31,
                 from external/com_google_absl/absl/strings/cord.h:91,
                 from external/com_google_absl/absl/status/internal/status_internal.h:23,
                 from external/com_google_absl/absl/status/status.h:59,
                 from external/pybind11_abseil/pybind11_abseil/status_caster.h:11,
                 from external/pybind11_abseil/pybind11_abseil/status_casters.h:20,
                 pybind_example.cc:16:
external/com_google_absl/absl/time/time.h:833:13: note: declared here
  833 |   Breakdown In(TimeZone tz) const;
      |             ^~
    

Nanobind port

Nanobind looks fairly stable at this point. I recently got nanobind to work with my various Bazel projects and considering doing a port.

Are there any plans to release a nanobind_abseil? If not, I'm happy to take a stab at it in my spare time.

Python bindings for absl::Status cause ODR violation

The issue can manifest itself in multiple ways. One of the most straightforward examples is that returning an absl::Status with a payload from C++ to Python can cause the process to crash (approximately 1 in 50k times; code that reproduces the issue: https://github.com/apronchenkov/pybind11_absl_cord_odr_issue).

It appears that the root cause of the issue seems is that pybind11_abseil includes statically linked components of Abseil, which may conflict with Abseil usages within the Python extensions.

Error when converting absl::Span<const bool>

When trying to specify a py::arg with C++ type absl::Span (or more specifically in my case absl::optional<absl::Span>), I get an compile error:

./third_party/pybind11_abseil/absl_casters.h:378:12: error: no matching function for call to 'MakeSpan'
return absl::MakeSpan(static_cast<std::vector<value_type>&>(caster));
...

I guess this might be related to std::vector being potentially specialized as a bitset instead of an array of byte sized bools (abseil/abseil-cpp#644). It would be nice to be able to define an py::arg as absl::Span though if it's possible to side-step this issue.

Support for absl::InlinedVector<T, N>?

I have a function that returns absl::InlinedVector<float, 4>, as well as a struct that contains one as a member.

I'm happy to implement this but would like to entertain suggestions for API design, especially for generic types T.

CMake linking and install improvements

Hi,
I am a packager for openSUSE and am trying to build RPM packages for pybind11_abseil. We found that we need a few changes to the cmake scripts to improve the package finding logic, linking to the right version of Python, and installation of headers. I list the patches we use one by one in this description, so that you may have a look and see if they are right for your project. If you agree, I can submit PRs for the changes.

Pass FIND_PACKAGE_ARGS to FetchContent_Declare

This enables the detection of system absl and pybind11 and goes on to download them if they are not. Important for packaging on openSUSE because RPMs are built inside a no-network access VM.

Note: This will bump the CMake minimum version to 3.24.

---
 CMakeLists.txt |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Index: pybind11_abseil-202402.0/CMakeLists.txt
===================================================================
--- pybind11_abseil-202402.0.orig/CMakeLists.txt
+++ pybind11_abseil-202402.0/CMakeLists.txt
@@ -17,16 +17,18 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3
 endif()
 
 FetchContent_Declare(
-  abseil-cpp
+  absl
   URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
   URL_HASH
-    SHA256=59d2976af9d6ecf001a81a35749a6e551a335b949d34918cfade07737b9d93c5)
+    SHA256=59d2976af9d6ecf001a81a35749a6e551a335b949d34918cfade07737b9d93c5
+  FIND_PACKAGE_ARGS)
 
 FetchContent_Declare(
   pybind11
-  URL https://github.com/pybind/pybind11/archive/refs/heads/master.tar.gz)
+  URL https://github.com/pybind/pybind11/archive/refs/heads/master.tar.gz
+  FIND_PACKAGE_ARGS)
 
-FetchContent_MakeAvailable(abseil-cpp pybind11)
+FetchContent_MakeAvailable(absl pybind11)
 
 set(TOP_LEVEL_DIR ${CMAKE_CURRENT_LIST_DIR})
 include_directories(${TOP_LEVEL_DIR} ${pybind11_INCLUDE_DIRS})

Link against the correct Python library

This is needed in any case for our packages to avoid undefined reference to Py* errors when linking, but additionally it helps to build against the correct version of Python and Pybind11 if there are multiple ones installed in the system. On openSUSE, it is natural to have simultaneously python3.10, python3.11, and python3.12 and the corresponding pybind11, numpy, python-absl installed in the system. This helps pick the right pybind11 to go with the choice of python executable.

---
 CMakeLists.txt                 |    3 +++
 pybind11_abseil/CMakeLists.txt |    1 +
 2 files changed, 4 insertions(+)

Index: pybind11_abseil-202402.0/CMakeLists.txt
===================================================================
--- pybind11_abseil-202402.0.orig/CMakeLists.txt
+++ pybind11_abseil-202402.0/CMakeLists.txt
@@ -16,6 +16,9 @@ if(CMAKE_VERSION VERSION_GREATER_EQUAL 3
   cmake_policy(SET CMP0135 NEW)
 endif()
 
+# Needs to be called *before* looking for pybind11 to ensure pybind11 uses the same python
+find_package(Python COMPONENTS Interpreter Development)
+
 FetchContent_Declare(
   absl
   URL https://github.com/abseil/abseil-cpp/archive/refs/tags/20230802.0.tar.gz
Index: pybind11_abseil-202402.0/pybind11_abseil/CMakeLists.txt
===================================================================
--- pybind11_abseil-202402.0.orig/pybind11_abseil/CMakeLists.txt
+++ pybind11_abseil-202402.0/pybind11_abseil/CMakeLists.txt
@@ -1,5 +1,6 @@
 add_subdirectory(compat)
 add_subdirectory(cpp_capsule_tools)
+link_libraries(${Python_LIBRARIES})
 
 # absl_casters ============================================================
 add_library(absl_casters INTERFACE)

Install headers

Apparently the current CMake scripts do not install the headers to the system, only the libraries. Headers are nonetheless needed for devs using C++ interface of pybind11_abseil. This patch adds the necessary include dirs to the install destination.

---
 CMakeLists.txt |    7 +++++++
 1 file changed, 7 insertions(+)

Index: pybind11_abseil-202402.0/CMakeLists.txt
===================================================================
--- pybind11_abseil-202402.0.orig/CMakeLists.txt
+++ pybind11_abseil-202402.0/CMakeLists.txt
@@ -37,3 +37,11 @@ set(TOP_LEVEL_DIR ${CMAKE_CURRENT_LIST_D
 include_directories(${TOP_LEVEL_DIR} ${pybind11_INCLUDE_DIRS})
 
 add_subdirectory(pybind11_abseil)
+
+if(CMAKE_INSTALL_PYDIR)
+  install(DIRECTORY pybind11_abseil
+          TYPE INCLUDE
+          FILES_MATCHING PATTERN "*.h"
+          PATTERN tests EXCLUDE
+          PATTERN requirements EXCLUDE)
+endif()

Suggestions, comments welcome. Thanks in advance. Thank you also for the very useful library.

Edit: Slightly improved patch for headers' installation: exclude test and requirements dirs.

Provide a fine grained mechanism for specifying `PYBIND11_ABSEIL_STATUS_MODULE_PATH`

I am using pybind11_abseil with pybind11_bazel.

I recently updated pybind11_abseil to HEAD and was surprised when my tests failed trying to import pybind11_absil.status. It took some time to track down the offending line to pybind11::google::ImportStatusModule(); on the C++ side and then to track down how the path is discovered.

With Bazel and assuming the default external repository name of pybind11_abseil, the corresponding Python import is from pybind11_abseil.pybind11_abseil import status. It took a while to find the relevant #define in README.md.

As the README accurately states, one must pass -D PYBIND11_ABSEIL_STATUS_MODULE_PATH=<path> directly on the command line (via bazel build --cxxopt="-D ...").

I was hoping for a more fine grained customization point via a macro that wraps @pybind11_abseil//pybind11_abseil:status_casters. At the moment, it is a pure pybind_library with no way to pass a defines or local_defines without setting --cxxopt globally.

ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined

Hi,

I am trying to figure out some issues with using the pybind11_abseil.status usage. TensorFlow as well as some other Google projects are using the pybind11_abseil modules. I found that as of TensorFlow 2.14.0 (2.13.1 is fine), it looks like that using TensorFlow in conjunction with packages that use pybind11_abseil will fail with the error

ImportError: generic_type: cannot initialize type "StatusCode": an object with that name is already defined

This happens for example in google-deepmind/launchpad#44 and tensorflow/tflite-support#954. The error happens when a pybind11 extension that uses
py::google::ImportStatusModule() is called.

For example

import tensorflow
import launchpad # Fails when importing an extension that uses ImportStatusModule.

Reversing the order we will see the same issues this time coming from TensorFlow trying to import a module that uses
ImportStatusModule.

I noticed that there are some changes to the pybind11_abseil version used in TensorFlow 2.14.0, which incoporates some changes around the import_status_module, but I don't have a really good clue about what that change entails, it would be quite useful if you can provide some help.

Thanks!

Test `AbslTimeTest.test_pass_datetime_pre_unix_epoch` fails on 32-bit i586 architecture

Using pybind11_abseil 202402.0, python 3.10, on 32-bit architecture, we see the following error when running ctest after building the library. I understand if 32 bit archs are not supported, but I just wanted to report here before disabling these builds.

Thanks in advance.

[   84s] 5/6 Test #2: absl_test ........................***Failed    0.23 sec
[   84s] Running tests under Python 3.10.13: /usr/bin/python3.10
[   84s] [ RUN      ] AbslBTreeMapTest.test_pass_map
[   84s] [       OK ] AbslBTreeMapTest.test_pass_map
[   84s] [ RUN      ] AbslBTreeMapTest.test_return_map
[   84s] [       OK ] AbslBTreeMapTest.test_return_map
[   84s] [ RUN      ] AbslCordTest.test_pass_absl_cord
[   84s] [       OK ] AbslCordTest.test_pass_absl_cord
[   84s] [ RUN      ] AbslCordTest.test_return_absl_cord
[   84s] [       OK ] AbslCordTest.test_return_absl_cord
[   84s] [ RUN      ] AbslFlatHashMapTest.test_pass_map
[   84s] [       OK ] AbslFlatHashMapTest.test_pass_map
[   84s] [ RUN      ] AbslFlatHashMapTest.test_return_map
[   84s] [       OK ] AbslFlatHashMapTest.test_return_map
[   84s] [ RUN      ] AbslFlatHashSetTest.test_pass_set
[   84s] [       OK ] AbslFlatHashSetTest.test_pass_set
[   84s] [ RUN      ] AbslFlatHashSetTest.test_return_set
[   84s] [       OK ] AbslFlatHashSetTest.test_return_set
[   84s] [ RUN      ] AbslNodeHashMapTest.test_pass_map
[   84s] [       OK ] AbslNodeHashMapTest.test_pass_map
[   84s] [ RUN      ] AbslNodeHashMapTest.test_return_map
[   84s] [       OK ] AbslNodeHashMapTest.test_return_map
[   84s] [ RUN      ] AbslNodeHashSetTest.test_pass_set
[   84s] [       OK ] AbslNodeHashSetTest.test_pass_set
[   84s] [ RUN      ] AbslNodeHashSetTest.test_return_set
[   84s] [       OK ] AbslNodeHashSetTest.test_return_set
[   84s] [ RUN      ] AbslNumericSpanTest.test_caster_copy_from_array_matching_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_caster_copy_from_array_matching_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_caster_copy_from_array_wrong_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_caster_copy_from_array_wrong_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_caster_copy_from_list
[   84s] [       OK ] AbslNumericSpanTest.test_caster_copy_from_list
[   84s] [ RUN      ] AbslNumericSpanTest.test_caster_copy_from_numpy_matching_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_caster_copy_from_numpy_matching_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_caster_copy_from_numpy_wrong_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_caster_copy_from_numpy_wrong_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_caster_copy_from_tuple
[   84s] [       OK ] AbslNumericSpanTest.test_caster_copy_from_tuple
[   84s] [ RUN      ] AbslNumericSpanTest.test_complex0 ('complex64', <built-in method sum_span_complex64 of PyCapsule object at 0xf5351b60>)
[   84s] [       OK ] AbslNumericSpanTest.test_complex0 ('complex64', <built-in method sum_span_complex64 of PyCapsule object at 0xf5351b60>)
[   84s] [ RUN      ] AbslNumericSpanTest.test_complex1 ('complex64', <built-in method sum_span_const_complex64 of PyCapsule object at 0xf5351b78>)
[   84s] [       OK ] AbslNumericSpanTest.test_complex1 ('complex64', <built-in method sum_span_const_complex64 of PyCapsule object at 0xf5351b78>)
[   84s] [ RUN      ] AbslNumericSpanTest.test_complex2 ('complex128', <built-in method sum_span_complex128 of PyCapsule object at 0xf5351b90>)
[   84s] [       OK ] AbslNumericSpanTest.test_complex2 ('complex128', <built-in method sum_span_complex128 of PyCapsule object at 0xf5351b90>)
[   84s] [ RUN      ] AbslNumericSpanTest.test_complex3 ('complex128', <built-in method sum_span_const_complex128 of PyCapsule object at 0xf5351ba8>)
[   84s] [       OK ] AbslNumericSpanTest.test_complex3 ('complex128', <built-in method sum_span_const_complex128 of PyCapsule object at 0xf5351ba8>)
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_fails_from_float_numpy
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_fails_from_float_numpy
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_fails_from_native_list
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_fails_from_native_list
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_fails_from_non_supported_type
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_fails_from_non_supported_type
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_fails_from_read_only
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_fails_from_read_only
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_fails_from_strided_reverse
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_fails_from_strided_reverse
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_fails_from_strided_skip
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_fails_from_strided_skip
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_fails_from_two_d_numpy
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_fails_from_two_d_numpy
[   84s] [ RUN      ] AbslNumericSpanTest.test_fill_span_from_numpy
[   84s] [       OK ] AbslNumericSpanTest.test_fill_span_from_numpy
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_bool0 ([], '')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_bool0 ([], '')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_bool1 ([False], 'f')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_bool1 ([False], 'f')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_bool2 ([True], 't')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_bool2 ([True], 't')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_bool3 ([False, True, True, False], 'fttf')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_bool3 ([False, True, True, False], 'fttf')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_const_bool0 ([], '')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_const_bool0 ([], '')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_const_bool1 ([False], 'F')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_const_bool1 ([False], 'F')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_const_bool2 ([True], 'T')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_const_bool2 ([True], 'T')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_const_bool3 ([False, True, True, False], 'FTTF')
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_const_bool3 ([False, True, True, False], 'FTTF')
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_fails_from_int
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_fails_from_int
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_fails_from_list_of_objects
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_fails_from_list_of_objects
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_fails_from_object
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_fails_from_object
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_fails_from_string
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_fails_from_string
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_from_array_matching_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_from_array_matching_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_from_array_wrong_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_from_array_wrong_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_from_list
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_from_list
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_from_numpy_matching_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_from_numpy_matching_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_from_numpy_wrong_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_from_numpy_wrong_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_from_tuple
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_from_tuple
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_array_wrong_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_array_wrong_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_list
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_list
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_numpy_wrong_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_numpy_wrong_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_tuple
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_no_convert_fails_from_tuple
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_no_convert_from_array_matching_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_no_convert_from_array_matching_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_no_convert_from_numpy_matching_dtype
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_no_convert_from_numpy_matching_dtype
[   84s] [ RUN      ] AbslNumericSpanTest.test_pass_span_pyobject_ptr
[   84s] [       OK ] AbslNumericSpanTest.test_pass_span_pyobject_ptr
[   84s] [ RUN      ] AbslNumericSpanTest.test_return_span
[   84s] [       OK ] AbslNumericSpanTest.test_return_span
[   84s] [ RUN      ] AbslObjectSpanTest.test_fill_object_pointers_span_from_native_list
[   84s] [       OK ] AbslObjectSpanTest.test_fill_object_pointers_span_from_native_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_fill_object_pointers_span_from_opaque_list
[   84s] [       OK ] AbslObjectSpanTest.test_fill_object_pointers_span_from_opaque_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_fill_object_span_no_convert_fails_from_native_list
[   84s] [       OK ] AbslObjectSpanTest.test_fill_object_span_no_convert_fails_from_native_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_fill_object_span_no_convert_from_opaque_list
[   84s] [       OK ] AbslObjectSpanTest.test_fill_object_span_no_convert_from_opaque_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_pass_object_pointers_span_from_native_list
[   84s] [       OK ] AbslObjectSpanTest.test_pass_object_pointers_span_from_native_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_pass_object_pointers_span_from_opaque_list
[   84s] [       OK ] AbslObjectSpanTest.test_pass_object_pointers_span_from_opaque_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_pass_object_span_from_native_list
[   84s] [       OK ] AbslObjectSpanTest.test_pass_object_span_from_native_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_pass_object_span_from_opaque_list
[   84s] [       OK ] AbslObjectSpanTest.test_pass_object_span_from_opaque_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_pass_object_span_no_convert_fails_from_native_list
[   84s] [       OK ] AbslObjectSpanTest.test_pass_object_span_no_convert_fails_from_native_list
[   84s] [ RUN      ] AbslObjectSpanTest.test_pass_object_span_no_convert_from_opaque_list
[   84s] [       OK ] AbslObjectSpanTest.test_pass_object_span_no_convert_from_opaque_list
[   84s] [ RUN      ] AbslOptionalTest.test_pass_default_nullopt
[   84s] [       OK ] AbslOptionalTest.test_pass_default_nullopt
[   84s] [ RUN      ] AbslOptionalTest.test_pass_none
[   84s] [       OK ] AbslOptionalTest.test_pass_none
[   84s] [ RUN      ] AbslOptionalTest.test_pass_value
[   84s] [       OK ] AbslOptionalTest.test_pass_value
[   84s] [ RUN      ] AbslOptionalTest.test_return_none
[   84s] [       OK ] AbslOptionalTest.test_return_none
[   84s] [ RUN      ] AbslOptionalTest.test_return_value
[   84s] [       OK ] AbslOptionalTest.test_return_value
[   84s] [ RUN      ] AbslStringViewTest.test_pass_string_view
[   84s] [       OK ] AbslStringViewTest.test_pass_string_view
[   84s] [ RUN      ] AbslStringViewTest.test_return_view
[   84s] [       OK ] AbslStringViewTest.test_return_view
[   84s] [ RUN      ] AbslTimeTest.test_absl_time_overloads
[   84s] [       OK ] AbslTimeTest.test_absl_time_overloads
[   84s] [ RUN      ] AbslTimeTest.test_dst_datetime_from_timestamp_after
[   84s] [       OK ] AbslTimeTest.test_dst_datetime_from_timestamp_after
[   84s] [ RUN      ] AbslTimeTest.test_dst_datetime_from_timestamp_before
[   84s] [       OK ] AbslTimeTest.test_dst_datetime_from_timestamp_before
[   84s] [ RUN      ] AbslTimeTest.test_dst_datetime_from_timestamp_flip
[   84s] [       OK ] AbslTimeTest.test_dst_datetime_from_timestamp_flip
[   84s] [ RUN      ] AbslTimeTest.test_duration_integer_overflow
[   84s] [       OK ] AbslTimeTest.test_duration_integer_overflow
[   84s] [ RUN      ] AbslTimeTest.test_from_datetime_time
[   84s] [       OK ] AbslTimeTest.test_from_datetime_time
[   84s] [ RUN      ] AbslTimeTest.test_infinite_duration
[   84s] [       OK ] AbslTimeTest.test_infinite_duration
[   84s] [ RUN      ] AbslTimeTest.test_infinite_future
[   84s] [       OK ] AbslTimeTest.test_infinite_future
[   84s] [ RUN      ] AbslTimeTest.test_infinite_past
[   84s] [       OK ] AbslTimeTest.test_infinite_past
[   84s] [ RUN      ] AbslTimeTest.test_pass_date
[   84s] [       OK ] AbslTimeTest.test_pass_date
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime
[   84s] [       OK ] AbslTimeTest.test_pass_datetime
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_as_civilday
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_as_civilday
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_as_civilhour
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_as_civilhour
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_as_civilminute
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_as_civilminute
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_as_civilmonth
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_as_civilmonth
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_as_civilsecond
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_as_civilsecond
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_as_civilyear
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_as_civilyear
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_dst
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_dst
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_dst_with_timezone
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_dst_with_timezone
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_pre_unix_epoch
[   84s] [  FAILED  ] AbslTimeTest.test_pass_datetime_pre_unix_epoch
[   84s] [ RUN      ] AbslTimeTest.test_pass_datetime_with_timezone
[   84s] [       OK ] AbslTimeTest.test_pass_datetime_with_timezone
[   84s] [ RUN      ] AbslTimeTest.test_pass_float_as_absl_time
[   84s] [       OK ] AbslTimeTest.test_pass_float_as_absl_time
[   84s] [ RUN      ] AbslTimeTest.test_pass_float_duration
[   84s] [       OK ] AbslTimeTest.test_pass_float_duration
[   84s] [ RUN      ] AbslTimeTest.test_pass_int_as_absl_time
[   84s] [       OK ] AbslTimeTest.test_pass_int_as_absl_time
[   84s] [ RUN      ] AbslTimeTest.test_pass_integer_duration
[   84s] [       OK ] AbslTimeTest.test_pass_integer_duration
[   84s] [ RUN      ] AbslTimeTest.test_pass_negative_duration
[   84s] [       OK ] AbslTimeTest.test_pass_negative_duration
[   84s] [ RUN      ] AbslTimeTest.test_pass_positive_duration
[   84s] [       OK ] AbslTimeTest.test_pass_positive_duration
[   84s] [ RUN      ] AbslTimeTest.test_return_civilday
[   84s] [       OK ] AbslTimeTest.test_return_civilday
[   84s] [ RUN      ] AbslTimeTest.test_return_civilhour
[   84s] [       OK ] AbslTimeTest.test_return_civilhour
[   84s] [ RUN      ] AbslTimeTest.test_return_civilminute
[   84s] [       OK ] AbslTimeTest.test_return_civilminute
[   84s] [ RUN      ] AbslTimeTest.test_return_civilmonth
[   84s] [       OK ] AbslTimeTest.test_return_civilmonth
[   84s] [ RUN      ] AbslTimeTest.test_return_civilsecond
[   84s] [       OK ] AbslTimeTest.test_return_civilsecond
[   84s] [ RUN      ] AbslTimeTest.test_return_civilyear
[   84s] [       OK ] AbslTimeTest.test_return_civilyear
[   84s] [ RUN      ] AbslTimeTest.test_return_datetime
[   84s] [       OK ] AbslTimeTest.test_return_datetime
[   84s] [ RUN      ] AbslTimeTest.test_return_negative_duration
[   84s] [       OK ] AbslTimeTest.test_return_negative_duration
[   84s] [ RUN      ] AbslTimeTest.test_return_positive_duration
[   84s] [       OK ] AbslTimeTest.test_return_positive_duration
[   84s] [ RUN      ] AbslTimeTest.test_timezone
[   84s] [       OK ] AbslTimeTest.test_timezone
[   84s] [ RUN      ] AbslVariantTest.test_variant
[   84s] [       OK ] AbslVariantTest.test_variant
[   84s] ======================================================================
[   84s] FAIL: test_pass_datetime_pre_unix_epoch (__main__.AbslTimeTest)
[   84s] AbslTimeTest.test_pass_datetime_pre_unix_epoch
[   84s] ----------------------------------------------------------------------
[   84s] Traceback (most recent call last):
[   84s]   File "/home/abuild/rpmbuild/BUILD/pybind11_abseil-202402.0/pybind11_abseil/tests/absl_test.py", line 155, in test_pass_datetime_pre_unix_epoch
[   84s]     self.assertTrue(absl_example.check_datetime(dt, secs))
[   84s] AssertionError: False is not true
[   84s] 
[   84s] ----------------------------------------------------------------------
[   84s] Ran 111 tests in 0.008s
[   84s] 
[   84s] FAILED (failures=1)
[   84s] 
[   84s] 6/6 Test #6: status_example_test ..............   Passed    0.14 sec
[   84s] 
[   84s] 83% tests passed, 1 tests failed out of 6
[   84s] 
[   84s] Total Test time (real) =   0.27 sec
[   84s] 
[   84s] The following tests FAILED:
[   84s] 	  2 - absl_test (Failed)
[   84s] Errors while running CTest

`status.so` does not build on MacOS with proper cc toolchain registration

Modern apple_support sets up a proper Apple CC toolchain.

One consequence of this is that the linker flag -undefined dynamic_lookup is no longer on by default (this was a bug. ld's default is -undefined error).

When switching to the modern toolchain, it causes status.so to fail because it does not depend on @pybind11//:pybind11. For these .sos, we should pass linkopts = ["-undefined", "dynamic_lookup"], as pybind_extension does here.

I'm happy to author a PR.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.