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

use_fast_cpp_protos=true on MacOS Arm64 #173

Closed
rstz opened this issue Aug 6, 2024 · 2 comments
Closed

use_fast_cpp_protos=true on MacOS Arm64 #173

rstz opened this issue Aug 6, 2024 · 2 comments

Comments

@rstz
Copy link

rstz commented Aug 6, 2024

Hi,

I'm trying to restore MacOS support for Yggdrasil Decision Forests, which proves more challenging than expected. As a first step, I tried running the tests in this repository under MacOS 14.5 (Arm64 architecture).

However, simply adding build --define=use_fast_cpp_protos=true to the project's .bazelrc makes tests fail with

# Configuration: 0d5ebff10b22bfda3f3ae92bd192687fc16f9a19af7749ad3686c9e0dd13d0b1
# Execution platform: @@platforms//host:host

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Undefined symbols for architecture arm64:
  "_PyModule_AddIntConstant", referenced from:
      _PyInit__api_implementation in api_implementation.o
  "_PyModule_Create2", referenced from:
      _PyInit__api_implementation in api_implementation.o
  "__Py_Dealloc", referenced from:
      _Py_DECREF(_object*) in api_implementation.o
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The issue happens with all Python versions. Is this a known issue on MacOS?

@rwgk
Copy link
Contributor

rwgk commented Aug 6, 2024

--define=use_fast_cpp_protos=true

AFAIK the protobuf team is working towards completely removing OSS support for that feature. The feature was never really supported in pybind11_protobuf OSS.

See also: #161 (comment)

The linker error looks more general, macOS has general issues around undefined symbols from the Python runtime library. I don't have full context there, just saying it's not surprising at first sight.

What happens if you simply don't try to use use_fast_cpp_protos? (Does that sidestep the linker error?)

@rstz
Copy link
Author

rstz commented Aug 7, 2024

Thank you for explaining. Removing use_fast_cpp_protos sidesteps the error, so I'll see if I can also remove the flag from our library.

@rstz rstz closed this as completed Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants