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

pythonPackages.grpcio-tools: fix undefined symbol error on armv6l #67808

wants to merge 1 commit into from


Copy link

lopsided98 commented Aug 31, 2019

Motivation for this change

On armv6l, grpc needs to link to libatomic to provide C++ atomic operations. Without this PR, importing this Python module results in the following error:

Traceback (most recent call last):
  File "nix_run_setup", line 8, in <module>
    exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\\r\\n', '\\n'), __file__, 'exec'))
  File "", line 6, in <module>
    from grpc_tools import protoc
  File "/nix/store/b21rflbwjpfj7lxm3fg88p64ri6p0pm6-python3.7-grpcio-tools-1.23.0/lib/python3.7/site-packages/grpc_tools/", line 20, in <module>
    from grpc_tools import _protoc_compiler
ImportError: /nix/store/b21rflbwjpfj7lxm3fg88p64ri6p0pm6-python3.7-grpcio-tools-1.23.0/lib/python3.7/site-packages/grpc_tools/ undefined symbol: __atomic_fetch_add_8

One might expect that the grpcio package would need this fix, rather than grpcio-tools, but this does not seem to be the case.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nix-review --run "nix-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits
Notify maintainers

cc @vanschelven

@lopsided98 lopsided98 requested a review from FRidh as a code owner Aug 31, 2019
@ofborg ofborg bot added the 6.topic: python label Aug 31, 2019
@ofborg ofborg bot requested a review from vanschelven Aug 31, 2019
@lopsided98 lopsided98 force-pushed the lopsided98:grpcio-tools-armv6l branch from 2327059 to 71d3874 Aug 31, 2019
Copy link

vanschelven left a comment

Looks good to me.

(Unchecked stuff ahead): looking at that stacktrace it almost looks like a bundled version of some protobuf implementation is what's doing the tripping-up here... which makes me wonder: how is the general state of affairs for the various protobuf-related libraries on armv6l ?

If the answer turns out to be "they don't work either", fixing them might be a separate PR.


This comment has been minimized.

Copy link
Contributor Author

lopsided98 commented Sep 28, 2019

I fixed protobuf on armv6l upstream a while ago (protocolbuffers/protobuf#5227), and I have only seen this issue with grpcio-tools. I looked into fixing this upstream, but I think it would be difficult because it is hard to do autotools/CMake style compile tests in Python libraries.


This comment has been minimized.

Copy link
Contributor Author

lopsided98 commented Nov 4, 2019

It looks like this has been fixed upstream: grpc/grpc#20414

@marsam marsam mentioned this pull request Nov 6, 2019
4 of 10 tasks complete

This comment has been minimized.

Copy link
Contributor Author

lopsided98 commented Nov 7, 2019

Fixed by #72892

@lopsided98 lopsided98 closed this Nov 7, 2019
@lopsided98 lopsided98 deleted the lopsided98:grpcio-tools-armv6l branch Nov 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.