Install/upgrade buildozer master before running, fixes #630
Installs missing buildozer dependency from master before running buildozer android release
.
Note that we're currently relying on the master branch since it adds a couple of fixes required for building a release.
In another iteration we could think of sandboxing the buildozer (and other deps) in a virtualenv. That would make it possible for app.id to fine grain their requirements without messing up with other dependencies.
Merge request reports
Activity
642 643 # buidozer not installed ? clone repo and run 644 if (p is None or p.returncode != 0): 645 cmd = ['git', 'clone', 'https://github.com/kivy/buildozer.git'] 646 p = subprocess.Popen(cmd, cwd=root_dir, shell=False) 647 p.wait() 648 if p.returncode != 0: 649 raise BuildException("Distribute build failed") 650 651 cmd = ['python', 'buildozer/buildozer/scripts/client.py', 'android', 'release'] 652 p = FDroidPopen(cmd, cwd=root_dir) 653 654 # expected to fail. 655 # Signing will fail if not set by environnment vars (cf. p4a docs). 656 # But the unsigned apk will be ok. 657 p.returncode = 0 Note this is not failing anymore since buildozer can now release unsigned APK with recent master changes, see https://github.com/kivy/buildozer/pull/835
637 641 cmd = ['buildozer', 'android', 'release'] 638 try: 639 p = FDroidPopen(cmd, cwd=root_dir) 640 except Exception: 641 pass 642 643 # buidozer not installed ? clone repo and run 644 if (p is None or p.returncode != 0): 645 cmd = ['git', 'clone', 'https://github.com/kivy/buildozer.git'] 646 p = subprocess.Popen(cmd, cwd=root_dir, shell=False) 647 p.wait() 648 if p.returncode != 0: 649 raise BuildException("Distribute build failed") 650 651 cmd = ['python', 'buildozer/buildozer/scripts/client.py', 'android', 'release'] 652 p = FDroidPopen(cmd, cwd=root_dir) This method could only work if:
- we provided the PYTHON path:
p = FDroidPopen(cmd, cwd=root_dir, envs={'PYTHONPATH': 'buildozer'})
- we installed the sub dependencies
pip install --user --editable
Hence I decided to go with a more straight forward method of directly pip installing from the git zip archive.
- we provided the PYTHON path:
mentioned in issue #630 (closed)
mentioned in merge request fdroiddata!3229 (merged)
Its great that you are working on getting Kivy/buildozer working smoothly! What is currently in place was implemented before we had the
sudo:
build field. And given our experience on getting the buildserver VM updated, I think we need to only build in tools that are stable and available in Debian/stretch.@relan prototyped a nice system of "provisioners". It would provide a library of pre-configured build environments that build metadata files could draw on. These would install via the
sudo:
method, so they can be maintained separately from the buildserver VM. That makes updating them drastically easier. I think that approach also makes sense for buildozer.@relan what do you think?
OK so if I understood correctly from the docs https://f-droid.org/docs/Build_Metadata_Reference/ I should use
sudo:
in my app metadata to install whatever I need. And this is the new recommended way of installing non-mainstream since after building the app the VM is wiped out? Is the VM wiped out only onsudo
usage or builds are isolated no matter what? I'm asking because doing apip install
without sudo in theinit:
orprebuild:
feels enough to me.OK I wasn't sure because f17865b9 this app got disabled because it was modifying the file system I guessed it was because of https://notabug.org/SapienTech/goblinoid/src/0.1.3/prebuildozer.sh and back then it wasn't a good idea to install you dependencies from a metadata file. So if now it's allowed I can just go ahead and do it directly from fdroiddata!3229 (merged) correct? If so it would make things way easier! Sorry for spamming this merge request, I didn't see you on IRC/Discord @Rudloff
mentioned in issue #642 (closed)
@andre.miras wrote:
... I can just go ahead and do it directly from fdroiddata!3229 (merged) correct?
Yes, please do.
@andre.miras wrote:
... Sorry for spamming this merge request
Actually I think you made a very valuable contribution. Nobody was looking into buildozer support for ages. Thanks for taking a closer look and helping us figuring out what to do.
OK I've implemented in fdroiddata!3229 (merged) using srclibs. If it eventually get merged and prove to be working, I make a pull request cleaning legacy buildozer support and document the method I've used. I'm closing this merge request then