kivy / buildozer

Generic Python packager for Android and iOS
https://buildozer.readthedocs.io
MIT License
1.72k stars 496 forks source link

gcc Segmentation Fault #720

Closed nobicycle closed 5 years ago

nobicycle commented 5 years ago

Versions

$ python -V Python 3.7.0

$ uname -a Linux tower 4.14.69-1-MANJARO #1 SMP PREEMPT Mon Sep 10 02:18:25 UTC 2018 x86_64 GNU/Linux

Cython: 0.28.5

Description

Following the "Local build" instructions. $make buildapklocally

The build processes a long time without error but finally stops here:

/home/archives/Education/Content/Kolibri/kolibri-installer-android-git/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of tempnam' is dangerous, better usemkstemp' /bin/sh: line 1: 20968 Segmentation fault (core dumped) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build make[1]: *** [Makefile:426: sharedmods] Error 139 make[1]: Leaving directory '/home/archives/Education/Content/Kolibri/kolibri-installer-android-git/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2'

STDERR:

Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=kolibri --bootstrap=webview --requirements=sqlite3,cryptography,pyopenssl,openssl,python2,pyjnius --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/archives/Education/Content/Kolibri/kolibri-installer-android-git/.buildozer/android/platform/build

(full log attached)

buildozer.spec

make buildapklocally

Spec file:

[app]

# (str) Title of your application
title = Kolibri

# (str) Package name
package.name = kolibri

# (str) Package domain (needed for android/ios packaging)
package.domain = org.le

# (str) Source code where the main.py live
source.dir = ./src

# (str) Application version
version.regex = (\d+\.\d+\.\d+\.\d+)
version.filename = ANDROID_VERSION

# (list) Application requirements
requirements = sqlite3,cryptography,pyopenssl,openssl,python2,pyjnius

# (str) Icon of the application
icon.filename = ./assets/logo.png

# (list) Source files to exclude (let empty to not exclude anything)
source.exclude_exts = whl

# (str) Supported orientation (one of landscape, portrait or all)
orientation = all

#
# Android specific
#

# (bool) Indicate if the application should be fullscreen or not
fullscreen = 1

# (list) Permissions
android.permissions = INTERNET,VIBRATE,WRITE_EXTERNAL_STORAGE

# (int) Android API to use
android.api = 18

# (int) Minimum API required
# NOTE: uncommenting this and setting it to 13 fixed the "dying on rotation" issue
# See: https://github.com/kivy/python-for-android/issues/730
android.minapi = 13

# (int) Android SDK version to use
#android.sdk = 20

# (str) Android NDK version to use
#android.ndk = 9c

# (bool) Use --private data storage (True) or --dir public storage (False)
android.private_storage = True

# (list) Pattern to whitelist for the whole project
android.whitelist = sqlite3/*,lib-dynload/_sqlite3.so,unittest/*,wsgiref/*,lib-dynload/_csv.so,lib-dynload/_json.so

# (list) List of Java .jar files to add to the libs so that pyjnius can access
# their classes. Don't add jars that you do not need, since extra jars can slow
# down the build process. Allows wildcards matching, for example:
# OUYA-ODK/libs/*.jar
#android.add_jars = foo.jar,bar.jar,path/to/more/*.jar

# (list) List of Java files to add to the android project (can be java or a
# directory containing the files)
#android.add_src =

# (str) python-for-android branch to use, defaults to master
#p4a.branch = stable

# (list) Android application meta-data to set (key=value format)
#android.meta_data =

# (str) Android logcat filters to use
#android.logcat_filters = *:S python:D

# (str) The Android arch to build for, choices: armeabi-v7a, arm64-v8a, x86
# android.arch = armeabi-v7a
android.arch = armeabi-v7a

#
# Python for android (p4a) specific
#

# (str) Bootstrap to use for android builds
p4a.bootstrap = webview

[buildozer]

# (int) Log level (0 = error only, 1 = info, 2 = debug (with command output))
log_level = 2

# (int) Display warning if buildozer is run as root (0 = False, 1 = True)
warn_on_root = 1

#    -----------------------------------------------------------------------------
#    Profiles
#
#    You can extend section / key with a profile
#    For example, you want to deploy a demo version of your application without
#    HD content. You could first change the title to add "(demo)" in the name
#    and extend the excluded directories to remove the HD content.
#
#[app@demo]
#title = My Application (demo)
#
#[app:source.exclude_patterns@demo]
#images/hd/*
#
#    Then, invoke the command line with the "demo" profile:
#
#buildozer --profile demo android debug

Logs

build.log

> /home/archives/Education/Content/Kolibri/kolibri-installer-android-git/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2/./Modules/posixmodule.c:7317: warning: the use of `tempnam' is dangerous, better use `mkstemp'
> /bin/sh: line 1: **20968 Segmentation fault**      (core dumped) CC='gcc -pthread' LDSHARED='gcc -pthread -shared ' OPT='-DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes' ./python -E ./setup.py -q build
> make[1]: *** [Makefile:426: sharedmods] Error 139
> make[1]: Leaving directory '/home/archives/Education/Content/Kolibri/kolibri-installer-android-git/.buildozer/android/platform/build/build/other_builds/hostpython2/desktop/hostpython2'
> 
> 
>   STDERR:
> 
> # Command failed: /usr/bin/python -m pythonforandroid.toolchain create --dist_name=kolibri --bootstrap=webview --requirements=sqlite3,cryptography,pyopenssl,openssl,python2,pyjnius --arch armeabi-v7a --copy-libs --color=always --storage-dir=/home/archives/Education/Content/Kolibri/kolibri-installer-android-git/.buildozer/android/platform/build
> 
tito commented 5 years ago

Not buildozer related, but fixed in kivy/python-for-android@master