-
Notifications
You must be signed in to change notification settings - Fork 642
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
BUG: Error compiling wheels using crossenv #1957
Comments
If I don't define prefix, it fails with :
|
If I somehow modify string.h from sysroot, it fails with : bundled/zeromq/src/thread.cpp:371:11: error: use of undeclared identifier 'pthread_setaffinity_np'; did you mean 'sched_setaffinity'? |
Thanks for testing! Can you try building the latest pyzmq v26 prerelease? Builds are completely rewritten, and in particular, the step where libzmq detects if |
Where can I find the pre-release ? |
It fails with this error buddy |
This is the problem, it's finding /usr/bin/cython instead of the one in the build env. I'll have a look to see if I can make that more reliable. |
Can you share the command you are using to build? It should be e.g. Also, what is |
I guess the pre-release is kindaaaaaaa weird buddy. It's building manylinux wheels for aarch64. My cython version : I Appreciate your assistance so far :) |
My build command is : pip wheel --pre . |
I'm not sure what's responsible for the manylinux tag (it isn't pyzmq), but I'm also not 100% sure it's a problem. Does this mean you got a successful build now? If it's just the tag, you can relabel wheels with:
but maybe it's indicative of not having picked up the right configuration. I don't suppose you have setup scripts or a docker image you use to do builds? It's hard for me to debug remotely, and I don't know how to setup a cross-compiling environment, except for on conda-forge where the crossenv builds are working fine. |
@minrk I setup cross compilation using |
Yeah, I've used crossenv in conda-forge, but I don't know how to set up the environment in which to install crossenv (i.e. the toolchain, target python and host python, etc.). If you have a docker image or something to reproduce the environment, that would be super helpful. |
The sad part is that I use it on my pc directly (cause I need to perform modifications for each architecture sometimes😅), I can share tar of the host python and the instructions at the moment. |
Anything you can provide will help. Even links to the setup instructions you use. |
I still don't know how to setup (or test) a build for android, but I have managed to build the latest pyzmq prerelease with crossenv. In my case, I cross-compiled from aarch64 to x86_64, and it built a wheel that I could then install and use in an x86_64 container ( I used this Dockerfile. It seems with $CC and $CXX defined, it works. I either needed to build libsodium and libzmq with I initially thought pyzmq should be able to do this automatically, but it doesn't seem to know that it's cross compiling even though it is, so it's hard to set the host triplet. Setting it directly works, though. It's unclear how much can be expected to work for cross compiles without any help, but at least I now know for sure that building with crossenv does work. We just need to understand what's going on with your android env. |
https://drive.google.com/file/d/1wBnjQXRej9-E9iY542RhdJfDDxglYKNa/view?usp=sharing Here's my build. To use it, you'll need android ndk r26c download. Any help is very very much appreciated |
This dockerfile appears to successfully cross-compile pyzmq linked against libzmq and libsodium for android. I have no way of testing the results, but let me know if that helps. |
@Soft-Buddy have you had any chance to test? So far, everything I see looks like it works, but I have no environment to test the results with. |
Closing this, since I have a working documented example. Feel free to open a new issue if you find one. |
This is a pyzmq bug
What pyzmq version?
25.1.2
What libzmq version?
4.3.5
Python version (and how it was installed)
python 3.11.8, cross compiled using ndk
OS
Host - Ubuntu
What happened?
I'm trying to cross compile pyzmq for Android, using
crossenv
, I'm running :Output :
(cross) rudra@rudra-1-2:~/Documents/compilation/aarch64/pyzmq$ ZMQ_PREFIX=/home/rudra/Documents/libzmq-builds/arm64 LDFLAGS+="-L../lib/ -lpython3.11" CFLAGS="-I../include/python3.11" python setup.py bdist_wheel
/home/rudra/Documents/compilation/aarch64/venv/build/lib/python3.11/site-packages/setuptools/_distutils/dist.py:265: UserWarning: Unknown distribution option: 'cffi_modules'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-311
creating build/lib.linux-aarch64-cpython-311/zmq
copying zmq/constants.py -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/error.py -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/decorators.py -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/_typing.py -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/init.py -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/_future.py -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/asyncio.py -> build/lib.linux-aarch64-cpython-311/zmq
creating build/lib.linux-aarch64-cpython-311/zmq/green
copying zmq/green/poll.py -> build/lib.linux-aarch64-cpython-311/zmq/green
copying zmq/green/device.py -> build/lib.linux-aarch64-cpython-311/zmq/green
copying zmq/green/core.py -> build/lib.linux-aarch64-cpython-311/zmq/green
copying zmq/green/init.py -> build/lib.linux-aarch64-cpython-311/zmq/green
creating build/lib.linux-aarch64-cpython-311/zmq/green/eventloop
copying zmq/green/eventloop/zmqstream.py -> build/lib.linux-aarch64-cpython-311/zmq/green/eventloop
copying zmq/green/eventloop/ioloop.py -> build/lib.linux-aarch64-cpython-311/zmq/green/eventloop
copying zmq/green/eventloop/init.py -> build/lib.linux-aarch64-cpython-311/zmq/green/eventloop
creating build/lib.linux-aarch64-cpython-311/zmq/devices
copying zmq/devices/proxydevice.py -> build/lib.linux-aarch64-cpython-311/zmq/devices
copying zmq/devices/basedevice.py -> build/lib.linux-aarch64-cpython-311/zmq/devices
copying zmq/devices/monitoredqueue.py -> build/lib.linux-aarch64-cpython-311/zmq/devices
copying zmq/devices/proxysteerabledevice.py -> build/lib.linux-aarch64-cpython-311/zmq/devices
copying zmq/devices/monitoredqueuedevice.py -> build/lib.linux-aarch64-cpython-311/zmq/devices
copying zmq/devices/init.py -> build/lib.linux-aarch64-cpython-311/zmq/devices
creating build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/interop.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/monitor.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/z85.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/garbage.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/strtypes.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/jsonapi.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/win32.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/init.py -> build/lib.linux-aarch64-cpython-311/zmq/utils
creating build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/context.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/poll.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/tracker.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/version.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/frame.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/socket.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/init.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/attrsettr.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/sugar/stopwatch.py -> build/lib.linux-aarch64-cpython-311/zmq/sugar
creating build/lib.linux-aarch64-cpython-311/zmq/ssh
copying zmq/ssh/tunnel.py -> build/lib.linux-aarch64-cpython-311/zmq/ssh
copying zmq/ssh/forward.py -> build/lib.linux-aarch64-cpython-311/zmq/ssh
copying zmq/ssh/init.py -> build/lib.linux-aarch64-cpython-311/zmq/ssh
creating build/lib.linux-aarch64-cpython-311/zmq/log
copying zmq/log/handlers.py -> build/lib.linux-aarch64-cpython-311/zmq/log
copying zmq/log/main.py -> build/lib.linux-aarch64-cpython-311/zmq/log
copying zmq/log/init.py -> build/lib.linux-aarch64-cpython-311/zmq/log
creating build/lib.linux-aarch64-cpython-311/zmq/auth
copying zmq/auth/base.py -> build/lib.linux-aarch64-cpython-311/zmq/auth
copying zmq/auth/certs.py -> build/lib.linux-aarch64-cpython-311/zmq/auth
copying zmq/auth/thread.py -> build/lib.linux-aarch64-cpython-311/zmq/auth
copying zmq/auth/ioloop.py -> build/lib.linux-aarch64-cpython-311/zmq/auth
copying zmq/auth/init.py -> build/lib.linux-aarch64-cpython-311/zmq/auth
copying zmq/auth/asyncio.py -> build/lib.linux-aarch64-cpython-311/zmq/auth
creating build/lib.linux-aarch64-cpython-311/zmq/backend
copying zmq/backend/select.py -> build/lib.linux-aarch64-cpython-311/zmq/backend
copying zmq/backend/init.py -> build/lib.linux-aarch64-cpython-311/zmq/backend
creating build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/context.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/utils.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/error.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/socket.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/message.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/_poll.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/devices.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cffi/init.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
creating build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/backend/cython/init.py -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
creating build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_decorators.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_monitor.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_monqueue.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_z85.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_asyncio.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_cython.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_draft.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_pubsub.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_mypy.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_cffi_backend.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_ext.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_socket.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_pair.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_context.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_error.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_includes.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_ssh.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_poll.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_proxy_steerable.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_multipart.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_log.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/conftest.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_message.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_imports.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_future.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_ioloop.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_zmqstream.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_retry_eintr.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_device.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_security.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_etc.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_constants.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_win32_shim.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_reqrep.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_version.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/test_auth.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
copying zmq/tests/init.py -> build/lib.linux-aarch64-cpython-311/zmq/tests
creating build/lib.linux-aarch64-cpython-311/zmq/eventloop
copying zmq/eventloop/_deprecated.py -> build/lib.linux-aarch64-cpython-311/zmq/eventloop
copying zmq/eventloop/zmqstream.py -> build/lib.linux-aarch64-cpython-311/zmq/eventloop
copying zmq/eventloop/future.py -> build/lib.linux-aarch64-cpython-311/zmq/eventloop
copying zmq/eventloop/ioloop.py -> build/lib.linux-aarch64-cpython-311/zmq/eventloop
copying zmq/eventloop/init.py -> build/lib.linux-aarch64-cpython-311/zmq/eventloop
copying zmq/init.pxd -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/init.pyi -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/py.typed -> build/lib.linux-aarch64-cpython-311/zmq
copying zmq/devices/monitoredqueue.pxd -> build/lib.linux-aarch64-cpython-311/zmq/devices
copying zmq/utils/buffers.pxd -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/pyversion_compat.h -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/ipcmaxlen.h -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/mutex.h -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/getpid_compat.h -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/zmq_compat.h -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/config.json -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/utils/compiler.json -> build/lib.linux-aarch64-cpython-311/zmq/utils
copying zmq/sugar/init.pyi -> build/lib.linux-aarch64-cpython-311/zmq/sugar
copying zmq/backend/init.pyi -> build/lib.linux-aarch64-cpython-311/zmq/backend
copying zmq/backend/cffi/_cdefs.h -> build/lib.linux-aarch64-cpython-311/zmq/backend/cffi
copying zmq/backend/cython/message.pxd -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/backend/cython/socket.pxd -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/backend/cython/checkrc.pxd -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/backend/cython/libzmq.pxd -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/backend/cython/init.pxd -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/backend/cython/context.pxd -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/backend/cython/constant_enums.pxi -> build/lib.linux-aarch64-cpython-311/zmq/backend/cython
copying zmq/tests/cython_ext.pyx -> build/lib.linux-aarch64-cpython-311/zmq/tests
running build_ext
running configure
{'libraries': ['zmq'], 'include_dirs': ['/home/rudra/Documents/libzmq-builds/arm64/include'], 'library_dirs': ['/home/rudra/Documents/libzmq-builds/arm64/lib'], 'runtime_library_dirs': ['/home/rudra/Documents/libzmq-builds/arm64/lib'], 'extra_link_args': []}
Configure: Autodetecting ZMQ settings...
Custom ZMQ dir: /home/rudra/Documents/libzmq-builds/arm64
Checking for timer_create
** Errors about missing timer_create are a normal part of this process **
/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../include/python3.11 -I/home/rudra/Documents/compilation/aarch64/venv/cross/include -I/usr/include/python3.11 -c /tmp/timer_createfylxmpzs.c -o tmp/timer_createfylxmpzs.o
/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang tmp/timer_createfylxmpzs.o -L/usr/lib -o a.out
/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -I../include/python3.11 -I/home/rudra/Documents/libzmq-builds/arm64/include -Izmq/utils -c build/temp.linux-aarch64-cpython-311/scratch/vers.c -o build/temp.linux-aarch64-cpython-311/scratch/vers.o
/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android24-clang build/temp.linux-aarch64-cpython-311/scratch/vers.o -L/home/rudra/Documents/libzmq-builds/arm64/lib -Wl,--enable-new-dtags,-R/home/rudra/Documents/libzmq-builds/arm64/lib -lzmq -o build/temp.linux-aarch64-cpython-311/scratch/vers
Error running version detection script:
Failed to run ['build/temp.linux-aarch64-cpython-311/scratch/vers']: OSError(8, 'Exec format error')
error: Error running version detection script:
Failed to run ['build/temp.linux-aarch64-cpython-311/scratch/vers']: OSError(8, 'Exec format error')
Fatal: Falling back on bundled libzmq, but config has explicitly prohibited building the libzmq extension.
Code to reproduce bug
No response
Traceback, if applicable
No response
More info
No response
The text was updated successfully, but these errors were encountered: