-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
release the python bindings as pip package #1067
Comments
This is fairly easy to do with github actions. See https://github.com/bitcraze/crazyflie-link-cpp/blob/master/.github/workflows/publish.yaml |
ah good! Thanks! you don't think there will be any OS problems? That if the bindings is build for Ubuntu that they won't work for window for instance? |
You have to build for each platform you want to support a separate wheel, which is uploaded to pip. The CI does take care of that, though (in the build part of it: https://github.com/bitcraze/crazyflie-link-cpp/blob/master/.github/workflows/CI.yml). |
ah great. I'll have a look at the actions for that. And keep it in mind for the next release, which will probably be in September. |
We will not do this for release 2022.09 due to lack of time, but a potential candidate for a release after that |
So I've looked at this more closely and with some trouble I need to conclude unfortunately it seems to be not as simple as copying the same structure as https://github.com/bitcraze/crazyflie-link-cpp. For Linux, and probably mac as well, it should be relatively simple with the following steps:
But windows of course, this makes it more difficult. Building the firmware natively on windows is a pain so I'm using the bitcraze builder docker for that:
First of all, the
But... these all seem to be part of the crazyflie-firmware/bindings/setup.py Lines 35 to 45 in af96c07
Btw, There is an handy stackoverflow comment here: https://stackoverflow.com/questions/71183800/how-to-include-header-file-in-source-distribution. Let's see if that gets me closer. |
Another input. looking through all the errors, I see that earlier it does read out the header files:
This location corresponds with
It seems that windows compile c code with visual c++ and that doesn't use But... wasn't this line supposed to take care of that?
|
Would it be possible to use gcc/clang on Windows? That line probably has issues with the multiple brackets |
Ah no, the brackets are not the issue I'm afraid. I haven't tried another compiler yet so I'll try that now. |
So I couldn't figure out how to force bdist_wheel to use clang for But this compiles for the .so file. but then I get a linker problem
|
It should be possible to use GCC (ie. mingw) on Windows. I did a quick test in a VM to compile a 'hello world' python C extension and it worked, I could build a wheel. I followed instructions found on stack overflow and using w64devkit as mingw distribution. I do not have time to go further today but it does looks good mostly because w64devkit comes with a shell (busybox) and GNU Make, so it should be a good environment to compile the Crazyflie firmware. |
I think I have a plan to go forward with this: Building a source distribution (ie. the result of So, since the main issue on Windows is that we cannot run the Crazyflie build system, my plan is for the CI to generate and publish a proper source package and then build windows/mac/Linux wheels out of this package. It does feel cleaner (everything is built from the same source) as well as allowing build on Windows. The current problem is to persuade python/distutils to include all the necessary files in the source distribution. Currently |
We will have a meeting about these python bindings soon |
|
@kam56 This sounds more like a build problem and not really related to this issue. Please start a new thread in our discussions instead |
@krichardsson Thank you for the reply. I have created a new thread . |
If we release the python bindings of the firmware for every firmware release, we could use the functions in external projects more easily, like in the controller of Webots.
The text was updated successfully, but these errors were encountered: