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

p4a create error: kivy/_clock.pxd:6:4: Executable statement not allowed here #822

Closed
Fak3 opened this issue Jul 6, 2016 · 5 comments
Closed

Comments

@Fak3
Copy link
Contributor

Fak3 commented Jul 6, 2016

Hi. I am using p4a version 0.4. I am trying to build clean distro with command:

python-for-android create --dist_name=testsdl2 --bootstrap=sdl2 --requirements=sdl2,python2,kivy,pil

I got an error:

[INFO]:    Unpacking kivy for armeabi
[INFO]:    -> running basename https://github.com/kivy/kivy/archive/master.zip
[INFO]:    -> directory context /home/u1/.local/share/python-for-android/build/other_builds/kivy-python2-sdl2/armeabi                                                                                              
[INFO]:    -> running mv kivy-master /home/u1/.local/share/python-for-android/build/other_builds/kivy-python2-sdl2/armeabi/kivy
[INFO]:    <- directory context /home/u1

....

[INFO]:    <- directory context /home/u1                                                                                                                                                                           
[INFO]:    Building kivy for armeabi
('name is', None, <class 'pythonforandroid.recipes.kivy.KivyRecipe'>)
[INFO]:    kivy apparently isn't already in site-packages
[INFO]:    Cythonizing anything necessary in kivy
('path is', '/home/u1/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86/bin/:/home/u1/.buildozer/android/platform/android-ndk-r9c/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/:/home/u1/.buildozer/android/platform/android-ndk-r9c:/home/u1/Android/Sdk/tools:/usr/local/heroku/bin:/home/u1/.local/bin:/usr/local/heroku/bin:/home/u1/.local/bin:/home/u1/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/opt/kde3/bin:/usr/lib/mit/bin:/usr/lib/mit/sbin:.:/usr/sbin:/usr/sbin')
[INFO]:    -> directory context /home/u1/.local/share/python-for-android/build/other_builds/kivy-python2-sdl2/armeabi/kivy
[INFO]:    -> running python.host -c import sys; print(sys.path)
('cwd is', '/home/u1/.local/share/python-for-android/build/other_builds/kivy-python2-sdl2/armeabi/kivy')                                                                                                           
[INFO]:    Trying first build of kivy to get cython files: this is expected to fail
[INFO]:    -> running python.host setup.py build_ext -v
()                                                                                                                                                                                                                 
[INFO]:    kivy first build failed (as expected)
[INFO]:    Running cython where appropriate
[INFO]:    Cythonize kivy/weakproxy.pyx
[INFO]:    -> running cython ./kivy/weakproxy.pyx
[INFO]:    Cythonize kivy/properties.pyx
[INFO]:    -> running cython ./kivy/properties.pyx
[INFO]:    Cythonize kivy/_clock.pyx
[INFO]:    -> running cython ./kivy/_clock.pyx
Traceback (most recent call last):                                                                                                                                                                                 
  File "/usr/bin/python-for-android", line 9, in <module>
    load_entry_point('python-for-android==0.4', 'console_scripts', 'python-for-android')()
  File "/usr/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 754, in main
    ToolchainCL()
  File "/usr/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 343, in __init__
    getattr(self, command_method_name)(unknown)
  File "/usr/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 93, in wrapper_func
    build_dist_from_args(ctx, dist, dist_args)
  File "/usr/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 138, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/usr/lib/python2.7/site-packages/pythonforandroid/build.py", line 561, in build_recipes
    recipe.build_arch(arch)
  File "/usr/lib/python2.7/site-packages/pythonforandroid/recipe.py", line 921, in build_arch
    self.build_cython_components(arch)
  File "/usr/lib/python2.7/site-packages/pythonforandroid/recipe.py", line 958, in build_cython_components
    self.cythonize_build(env=env)
  File "/usr/lib/python2.7/site-packages/pythonforandroid/recipe.py", line 992, in cythonize_build
    self.cythonize_file(env, build_dir, join(root, filename))
  File "/usr/lib/python2.7/site-packages/pythonforandroid/recipe.py", line 983, in cythonize_file
    shprint(cython_command, filename, *self.cython_args, _env=cyenv)
  File "/usr/lib/python2.7/site-packages/pythonforandroid/logger.py", line 173, in shprint
    for line in output:
  File "/usr/lib/python2.7/site-packages/sh.py", line 565, in next
    self.wait()
  File "/usr/lib/python2.7/site-packages/sh.py", line 500, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/lib/python2.7/site-packages/sh.py", line 516, in handle_command_exit_code
    raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_1: 

  RAN: '/usr/bin/cython ./kivy/_clock.pyx'

  STDOUT:

Error compiling Cython file:
------------------------------------------------------------
...

cdef class ClockEvent(object):

    cdef int _is_triggered
    cdef public ClockEvent next
    '''The next :class:`ClockEvent` in order they were scheduled.
   ^
------------------------------------------------------------

kivy/_clock.pxd:6:4: Executable statement not allowed here



  STDERR:

@inclement
Copy link
Member

What version of cython are you using?

@Fak3
Copy link
Contributor Author

Fak3 commented Jul 6, 2016

Cython==0.19.1

@inclement
Copy link
Member

Could you test with a newer version (I think 0.24 is current) just in case?

@Fak3
Copy link
Contributor Author

Fak3 commented Jul 6, 2016

Thanks! I succeded with Cython 0.24

@Fak3 Fak3 closed this as completed Jul 6, 2016
@inclement
Copy link
Member

Okay, great. If this hadn't worked I was going to ask about your Kivy version, as the problematic code doesn't seem to match the master branch, so you might want to make sure the p4a-downloaded Kivy is up to date anyway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants