HelloZeroNet / ZeroNet-kivy

Android client for ZeroNet
https://zeronet.io
GNU General Public License v2.0
281 stars 80 forks source link

WIP: Python3 Support #60

Closed mkg20001 closed 4 years ago

mkg20001 commented 5 years ago

ToDos:

mkg20001 commented 5 years ago
Compiling '/home/data/.buildozer/android/app/zero/plugins/Zeroname/updater/zeroname_updater.py'...
***   File "/home/data/.buildozer/android/app/zero/plugins/Zeroname/updater/zeroname_updater.py", line 13
    print "* Signing and Publishing..."
                                      ^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("* Signing and Publishing...")?
mkg20001 commented 5 years ago

@shortcutme The zeroname plugin needs to be converted to py3, after that I can release a beta of zn-kivy for py3

mkg20001 commented 5 years ago
03-24 08:28:17.757 20460 20479 I zn      : [ERROR  ] [Unhandled exception] The 'greenlet>=0.4.14' distribution was not found and is required by the application

Added greenlet, it still complains

mkg20001 commented 5 years ago
06-09 21:11:09.479 29301 29315 I zn      : - Starting ZeroNet...
06-09 21:11:09.484 29301 29315 I zn      : [ERROR  ] [Unhandled exception] No module named 'main'
06-09 21:11:09.484 29301 29315 I zn      : Traceback (most recent call last):
06-09 21:11:09.484 29301 29315 I zn      :   File "/home/data/.buildozer/android/app/zero/zeronet.py", line 18, in main
06-09 21:11:09.484 29301 29315 I zn      : ModuleNotFoundError: No module named 'main'
06-09 21:11:09.990 29301 29315 I zn      :  Traceback (most recent call last):
06-09 21:11:09.992 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/zero/zeronet.py", line 18, in main
06-09 21:11:09.993 29301 29315 I zn      :  ModuleNotFoundError: No module named 'main'
06-09 21:11:09.994 29301 29315 I zn      :  
06-09 21:11:09.994 29301 29315 I zn      :  During handling of the above exception, another exception occurred:
06-09 21:11:09.995 29301 29315 I zn      :  
06-09 21:11:09.995 29301 29315 I zn      :  Traceback (most recent call last):
06-09 21:11:09.996 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/platform_android.py", line 53, in wrapSentry
06-09 21:11:09.997 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/service.py", line 61, in main
06-09 21:11:09.997 29301 29315 I zn      :    File "/home/data/.buildozer/android/app/zero/zeronet.py", line 28, in main
06-09 21:11:09.998 29301 29315 I zn      :  ModuleNotFoundError: No module named 'Config'
06-09 21:11:10.086 29301 29315 I python  : Python for android ended.
06-09 21:11:10.164 29089 29090 I adbd    : initializing functionfs

Now I'm stuck here

HelloZeroNet commented 5 years ago

There was a change recently and the main() entry point modified to start() (to be able to have update entry point beside the main), so I think you need to change zeronet.main() to zeronet.start() here: https://github.com/HelloZeroNet/ZeroNet-kivy/blob/2dc2421a15e26b43a46eff89b85d97c59a9d4dd6/src/service.py#L61

mkg20001 commented 5 years ago

@HelloZeroNet Applied it, but I think it will still fail because of the issue of not being able to find greenlet It does install it via a custom recipe script and not via the standard way using pip, so some metadata seems to be missing and it can't load it On the other hand when forcing a version it does install correctly via pip, but uses a precompiled greenlet which isn't compiled for arm

Any idea how to fix that? That would be (presumably) on of the last bugs to fix before I could do a release, or at least move py3 to master.

Edit: If you've got the time, you could jump through the different nightlies for ZeroNetN3 on F-Droid and see if you can make any sense of those errors. If you need help ripping apart the APK - it's partly non-standard what python-kivy does - to get the files, just ping me

mkg20001 commented 5 years ago

This is where I'm stuck currently:

assets/_python_bundle/site-packages/greenlet-0.4.15.dist-info/ is missing in python-for-android recipe build Without using recipe (using specific parameter), it fails to compile for the correct architecture. (This could either be missing cross-compile support in setup.py, or because it uses a wheel)

CompiledComponentsRecipe, which it currently is using, fails to generate that dist-info Recipe recipe seems to do the same Would have to try with CpythonRecipe, although I should test if it uses right py4a first

Really this is ANNOYING! Since this bit of files is what's missing until it FINALLY works!

mkg20001 commented 5 years ago

/me throws out a 10$ bounty for who-ever manges to get this dependency/recipe issue resolved

https://github.com/HelloZeroNet/ZeroNet-kivy/issues/63

saber28 commented 4 years ago

Hi, time flies! Two years passed and now we are working on py3 version on android. Thank you again for dev the new APK! I noticed you are facing problem of greenlet on kivy, I suggest putting greenlet before gevent in buildozer.spec#L44, because the order counts and greenlet is required by gevent. I am not sure it will solve the problem but anyway you could try it. After putting them in right order you can try downgrade greenlet or gevent again if it still doesn't work.

mkg20001 commented 4 years ago

@saber28 Thanks, will try later this week

mkg20001 commented 4 years ago

@saber28 Sadly this didn't fix it

mkg20001 commented 4 years ago

Ok, this is taking forever Merging this into master, since py3 is now default

mkg20001 commented 4 years ago

For everyone watching this pr: feel free to chime in on https://t.me/zeronet_android while testing