Closed xavierfiechter closed 7 months ago
Which branch are you using?
Generally you shouldn't state a version for packages that are obtained through a recipe. With the noted cffi, what you are likely seeing is the patch for version 1.13.2 from the master branch, opposed to the develop branch which has the updated patch for 1.15.1
Thanks for the hint.
I was indeed using the master branch. cffi
works with the develop branch.
But now it crashes town the line.
[INFO]: ENV:
export HOME='/home/user'
export CFLAGS='-target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -I/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/Include'
export CXXFLAGS='-target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC'
export CPPFLAGS='-DANDROID -I/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/include -I/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/python-installs/brainbow/arm64-v8a/include/python3.1'
export LDFLAGS=' -L/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/libs_collections/brainbow/arm64-v8a -L/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/python3/arm64-v8a__ndk_target_21/python3/android-build -lpython3.10 -L/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/libs_collections/brainbow/arm64-v8a -L/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/libs_collections/brainbow -L/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/bootstrap_builds/sdl2/obj/local/arm64-v8a '
export LDLIBS='-lm'
export USE_CCACHE='1'
export NDK_CCACHE='/usr/bin/ccache'
export PATH='/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin:/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b:/github/workspace/master/.buildozer_global/android/platform/android-sdk/tools:/github/workspace/master/.buildozer_global/android/platform/apache-ant-1.9.4/bin:/home/user/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
export CC='/usr/bin/ccache /github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC'
export CXX='/usr/bin/ccache /github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++ -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC'
export AR='/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ar'
export RANLIB='/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-ranlib'
export STRIP='/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip --strip-unneeded'
export READELF='/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-readelf'
export OBJCOPY='/github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-objcopy'
export MAKE='make -j2'
export ARCH='arm64-v8a'
export NDK_API='android-21'
export LDSHARED='/usr/bin/ccache /github/workspace/master/.buildozer_global/android/platform/android-ndk-r25b/toolchains/llvm/prebuilt/linux-x86_64/bin/clang -target aarch64-linux-android21 -fomit-frame-pointer -march=armv8-a -fPIC -shared'
export BUILDLIB_PATH='/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/lib.linux-x86_64-3.10'
export PYTHONNOUSERSITE='1'
export LANG='en_GB.UTF-8'
export PYTHONPATH='/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib:/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/Lib/site-packages:/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/lib.linux-x86_64-3.10:/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/scripts-3.10:/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/build/temp.linux-x86_64-3.10'
export LIBLINK='NOTNONE'
export COPYLIBS='1'
export LIBLINK_PATH='/github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/objects_pyjnius'
export NDKPLATFORM='NOTNONE'
[INFO]: COMMAND:
cd /github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/pyjnius-sdl2/arm64-v8a__ndk_target_21/pyjnius && /github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 setup.py build_ext -v
[WARNING]: ERROR: /github/workspace/master/.buildozer/android/platform/build-arm64-v8a/build/other_builds/hostpython3/desktop/hostpython3/native-build/python3 failed!
# Command failed: ['/bin/python3', '-m', 'pythonforandroid.toolchain', 'create', '--dist_name=brainbow', '--bootstrap=sdl2', '--requirements=python==3.10,cffi==1.15.1,pbkdf2,Cython==0.29.32,typing-extensions==4.4.0,aioconsole==0.1.10,aiosignal==1.2.0,appdirs==1.4.4,async-timeout==4.0.2,asyncgui==0.5.5,asynckivy==0.5.4,aiohttp==3.8.3,attrs==17.4.0,beautifulsoup4==4.6.0,certifi==2018.1.18,chardet==3.0.4,charset-normalizer==2.1.1,colorama==0.4.5,distlib==0.3.6,docutils==0.14,filelock==3.8.0,frozenlist==1.3.1,idna==2.6,importlib-metadata==4.12.0,Jinja2==3.1.2,Kivy==2.1.0,kivymd==1.0.2,kivy-garden.qrcode==2021.314,MarkupSafe==2.1.1,multidict==6.0.2,pep517==0.6.0,pexpect==4.8.0,Pillow==8.4.0,platformdirs==2.5.2,ptyprocess==0.7.0,pycoin==0.80,pycryptodome==3.9.8,Pygments==2.2.0,pytoml==0.1.21,qrcode==5.3,requests==2.20.0,six==1.11.0,toml==0.10.2,urllib3==1.24.3,yarl==1.8.1,zipp==3.8.1,android,pyjnius==1.4.2,embit==0.7.0,numpy==1.22.3,camera4kivy==0.1.0,gestures4kivy==0.1.0,pillow==8.4.0,libiconv,libzbar,pyzbar==0.1.7,', '--arch=arm64-v8a', '--copy-libs', '--local-recipes', '/github/workspace/master/src/python-for-android/recipes', '--color=always', '--storage-dir=/github/workspace/master/.buildozer/android/platform/build-arm64-v8a', '--ndk-api=21', '--hook=/github/workspace/master/src/camerax_provider/gradle_options.py', '--ignore-setup-py', '--debug']
# ENVIRONMENT:
Why not pin it?! This makes a build reproducible.
This is especially important for Bitcoin related software and products.
@xavierfiechter Please post full log.
Sure, but the output is too long to paste it here.
Here's the build log https://github.com/Bitcoin-Brainbow/Brainbow/actions/runs/5444846600/jobs/9903255128
@xavierfiechter in logs I see build is failing because of jnius build. You can fix that by changing your workflow to:
name: Build APK
on: [push,pull_request]
jobs:
build-android:
name: Build for Android
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Build with Buildozer
run: |
pip3 install --user --upgrade buildozer Cython virtualenv
export PATH=$PATH:~/.local/bin/
export APP_ANDROID_ACCEPT_SDK_LICENSE=1
export BUILDOZER_WARN_ON_ROOT=0
sudo apt update
sudo apt install -y git zip unzip openjdk-17-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev
cd ${{ github.workspace }}
buildozer android debug
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: package
path: bin/*.apk
Unfortunately, the buildozer image available on docker hub is definitely old and not compatible with newer python-for-android
versions.
As suggested by @T-Dynamos , you can change your workflow in order to avoid the usage of the docker image.
Spoiler: We have planned to start re-deploying images for python-for-android
and buildozer
on docker hub (but no ETA)
Why not pin it?! This makes a build reproducible.
Some packages, like cffi
, need to be patched in order to be cross-built for Android (or iOS), and if code changes, the patch is not compatible. (but, if you want to, you can try updating the recipe, or adding patches to support multiple cffi
versions)
Thank you @misl6 and @T-Dynamos for your reply. I will check that out and report back.
I'm aware of the patched version in the recipe, and I have contributed a patch for "aiohttp" in the past.
I usually go along with the latest patched version within the recipes to keep up to date. There are so many moving parts and the build process breaks occasionally.
The build is failing.
Here's the build file:
https://github.com/Bitcoin-Brainbow/Brainbow/blob/master/.github/workflows/build.yml#L35 Not sure, if
Here's the log output:
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
NEEDRESTART-VER: 3.5
NEEDRESTART-KCUR: 5.15.0-1040-azure
NEEDRESTART-KEXP: 5.15.0-1040-azure
NEEDRESTART-KSTA: 1
Traceback (most recent call last):
File "/home/runner/.local/bin/buildozer", line 8, in <module>
sys.exit(main())
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1003, in run_command
self.check_root()
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1030, in check_root
warn_on_root = self.config.getdefault('buildozer', 'warn_on_root', '1')
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1184, in _get_config_default
set_config_token_from_env(section, token, self.config)
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1242, in set_config_token_from_env
config.set(section, token, env_var)
File "/usr/lib/python3.10/configparser.py", line 1205, in set
super().set(section, option, value)
File "/usr/lib/python3.10/configparser.py", line 903, in set
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'buildozer'
Error: Process completed with exit code 1.
@xavierfiechter This line is wrong
path: ${{ steps.buildozer.outputs.filename }}
(in upload artifact)
Thanks @T-Dynamos , but computer says no.
https://github.com/Bitcoin-Brainbow/Brainbow/actions/runs/5453111703/jobs/9921539537
Updating Mono key store
Mono Certificate Store Sync - version 6.12.0.182
Populate Mono certificate store from a concatenated list of certificates.
Copyright 2002, 2003 Motus Technologies. Copyright 2004-2008 Novell. BSD licensed.
Importing into legacy system store:
I already trust 137, your new list has 137
Import process completed.
Importing into BTLS system store:
I already trust 136, your new list has 137
Certificate added: C=ES, CN=Autoridad de Certificacion Firmaprofesional CIF A62634068
1 new root certificates were added to your trust store.
Import process completed.
Done
done.
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
NEEDRESTART-VER: 3.5
NEEDRESTART-KCUR: 5.15.0-1040-azure
NEEDRESTART-KEXP: 5.15.0-1040-azure
NEEDRESTART-KSTA: 1
Traceback (most recent call last):
File "/home/runner/.local/bin/buildozer", line 8, in <module>
sys.exit(main())
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1003, in run_command
self.check_root()
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1030, in check_root
warn_on_root = self.config.getdefault('buildozer', 'warn_on_root', '1')
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1184, in _get_config_default
set_config_token_from_env(section, token, self.config)
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1242, in set_config_token_from_env
config.set(section, token, env_var)
File "/usr/lib/python3.10/configparser.py", line 1205, in set
super().set(section, option, value)
File "/usr/lib/python3.10/configparser.py", line 903, in set
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'buildozer'
Error: Process completed with exit code 1.
@xavierfiechter these lines are missing from your spec.
[buildozer]
log_level = 2
warn_on_root = 1
add them
All these lines are already in my spec.
https://github.com/Bitcoin-Brainbow/Brainbow/blob/master/buildozer.spec#L471-L477
The original issue is a newer version of Cython is required
jnius/jnius.c:55290:5: error: expression is not assignable ++Py_REFCNT(o);
https://github.com/Android-for-Python/Android-for-Python-Users#error-expression-is-not-assignable
As specified in the install docs
@RobertFlatt this build is failing with Cython==0.29.33 as well.
Here's the log: https://github.com/Bitcoin-Brainbow/Brainbow/actions/runs/5685488668/job/15410462879
@xavierfiechter
configparser.NoSectionError: No section: 'buildozer'
I suggest this is unrelated to Cython, you might want to check if buildozer.spec is truncated.
Which I see is also a suggestion above https://github.com/kivy/python-for-android/issues/2847#issuecomment-1620430007
Thanks, Robert, for your response.
Those lines are in buildozer.spec, here:
https://github.com/Bitcoin-Brainbow/Brainbow/blob/master/buildozer.spec#L474-L480
Any other ideas? Hints?
Should be python3 in requirements and the Cython version as mentioned is in relation to the build system ie addressed in build.yml and I would use version 0.29.36
Not sure if I understand it correctly.
I took the Python version from https://github.com/Bitcoin-Brainbow/Brainbow/blob/master/.github/workflows/build.yml#L62 and added it into the buildozer.spec under requirements.
Also added the suggested version of Cpython.
NEEDRESTART-KSTA: 1
Traceback (most recent call last):
File "/home/runner/.local/bin/buildozer", line 8, in <module>
sys.exit(main())
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/scripts/client.py", line 13, in main
Buildozer().run_command(sys.argv[1:])
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1003, in run_command
self.check_root()
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1030, in check_root
warn_on_root = self.config.getdefault('buildozer', 'warn_on_root', '1')
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1184, in _get_config_default
set_config_token_from_env(section, token, self.config)
File "/home/runner/.local/lib/python3.10/site-packages/buildozer/__init__.py", line 1242, in set_config_token_from_env
config.set(section, token, env_var)
File "/usr/lib/python3.10/configparser.py", line 1205, in set
super().set(section, option, value)
File "/usr/lib/python3.10/configparser.py", line 903, in set
raise NoSectionError(section) from None
configparser.NoSectionError: No section: 'buildozer'
Error: Process completed with exit code 1.
Getting this error from this build https://github.com/Bitcoin-Brainbow/Brainbow/actions/runs/5685921100/job/15411794780.
I assume the error is triggered by something else, because both lines log_level = 2 warn_on_root = 1 are in the [buildozer] section.
@xavierfiechter
You have syntax errors in your buildozer.spec
The syntax is .ini syntax
See https://github.com/Android-for-Python/Android-for-Python-Users#changing-buildozerspec
I used the format of the file for 100s of builds.
Because I can't find any anomaly in the file, I just used this script to read from my buildozer.spec locally.
# works with Python 3.11.3
import configparser
def parse_buildozer_config(config_file):
parser = configparser.ConfigParser()
parser.read(config_file)
if 'buildozer' in parser:
buildozer_section = parser['buildozer']
log_level = buildozer_section.getint('log_level', fallback=0)
build_dir = buildozer_section.get('dir', fallback='.')
return log_level, build_dir
else:
# Handle the case when the 'buildozer' section is not found in the config file
return None, None
# Usage
config_file_path = 'buildozer.spec'
log_level, build_dir = parse_buildozer_config(config_file_path)
if log_level is not None and build_dir is not None:
print(f"Buildozer log level: {log_level}")
print(f"Buildozer project directory: {build_dir}")
else:
print("Could not find the 'buildozer' section in the config file.")
I had no issue, so it must be something else. But what?
https://github.com/Bitcoin-Brainbow/Brainbow/actions/runs/5689024819/job/15419807716
I can only explicity paste this from the link previously provided
Note: buildozer.spec syntax is .ini syntax, so there is no syntax checking.
Options must start on the first character of a line. Comments must start on the first character of a line. Comments must not be imbedded in multi-line options. Failure to follow this syntax may result in non-deterministic behavior.
Given the last item, a deterministic test is probably not meaningful. As a general strategy I suggest trying to find what is not correct.
I'm obviously not going to look for all the issues in your code, but for example https://github.com/Bitcoin-Brainbow/Brainbow/blob/master/buildozer.spec#L37-L40 See the two items about comments above.
Build works when using p4a release-2022.12.20.
👋 We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please use our support channels to get help with the project.
If you're having trouble installing or using python-for-android, maybe you could be interested in our quickstart guide.
Let us know if this comment was made in error, and we'll be happy to reopen the issue.
Somehow, build fails due to this patch: https://github.com/kivy/python-for-android/commit/5ff00abad71d57c9bdba429c834696f0a6159e53