-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[revamp] Twisted #454
Comments
Have you also made a zope recipe (as in p4a master) and made it a dependency of the twisted one? I guess that's how p4a master avoids this problem. |
Also, is the setuptools requirement part of the twisted problem? It doesn't seem that the old twisted recipe depends on it, but maybe I missed it. |
Yes, I have a zope.interface recipe (a trivial
and when I made a trivial I don't know how the old Twisted recipe was working without depending on setuptools. I am running |
Just another observation, Twisted should probably be a CythonRecipe, not a CompiledComponentsPythonRecipe. Also, the old zope recipe is for all of zope (and includes compilation), not just zope.interface. If you can't work out the problem, maybe moving further to precisely duplicate the old structure would help. |
It appears that Twisted 15.2.1 did not depend on setuptools, but Twisted 15.4.0 does (since this ticket was closed). I am trying again now with 15.2.1 (which I'm sure wasn't working either, but I've tried so many things and have so many red herrings that I'm losing track). AFAICT the old zope recipe does not include compilation, and is only for I had gone with a CompiledComponentsPythonRecipe for Twisted precisely because it appeared to be the closest to the old Twisted recipe, but I will try using a CythonRecipe. |
The twisted recipe.sh does the cython stuff at https://github.com/kivy/python-for-android/blob/master/recipes/twisted/recipe.sh#L34 - this is basically the difference between the Cython- and CompiledComponentsPython- recipes; the former does the manual cythoning. |
I thought the zope recipe was doing compilation because it bothers setting the ldflags etc (https://github.com/kivy/python-for-android/blob/master/recipes/zope/recipe.sh#L26). Are you doing this? If there's no compilation then I agree it shouldn't be important. |
Re: zope, I see it sets the ldflags, but all it does in between them is Re: Twisted - ah, my mistake, I missed the CYTHON line. Incidentally, using |
Changing to |
The problem is that the old twisted recipe actually calls hostpython from its build dir at the install stage, not from the normal hostpython location. I think that's why it specifies the root dir for installation, which wouldn't be necessary otherwise. I think this also means that several of the other commands fail and (I suppose) are ignored in the normal recipe, but in the revamp would raise sh exceptions. Here's my twisted recipe investigating this, which gets past the ELF problem but hits something else relating to compile settings. I couldn't immediately see the problem but maybe it can help you.
|
Thanks for the explanation! It prompted me to delve deeper into what env vars the old recipe was setting, and I finally figured it out. In your I now have a built distribution and APK, which I need to test. Once I've verified it is working, I will make a PR. Thanks for all your help! |
One problem I forsee is that |
The ELF class isn't wrong, it's because they target 32 bit ARM, hence the problem when hostpython tries to import them on the desktop. This happens because the hostpython is really an x86 python binary in an arm python-install, and the workaround here is to use the hostpython from its own (x86) install dir but target the arm one. This is normal and should (barring other issue) run fine on an actual android device. |
You're right, and I was able to run Twisted fine on Android as-is. I've made a PR with the recipes. |
I'm creating this issue because my meta-discussion doesn't belong in the other tickets I have opened. If it wasn't already obvious, my motivation is to get Twisted working with the revamp, so I can use it in a new project.
In #453 it was suggested that Twisted will require a recipe. I just tried the same process as #453 again, but using
--requirements setuptools,zope.interface,twisted
and with a TwistedCompiledComponentsPythonRecipe
(but no recipes forsetuptools
orzope.interface
). This fails (even after manually fixing the build env after #450 occurs) because the Python modules are installed after the recipes, and of course Twisted depends on the Python modules.So I am currently stuck between #453 (preventing use of Python modules only), #449 (preventing use of a recipe depending on Python modules) and #451 (preventing use of recipes only). I'm not sure which is the "right way" to be doing this, which doesn't help either. Given that the deprecated Twisted recipe required compilation, I agree that Twisted probably requires a recipe, which implies that #453 is not the right way forward, but that still leaves me stuck 😫
The text was updated successfully, but these errors were encountered: