This process creates three copies of the buildserver image, all of which
are large. So deleting the unused one is quite helpful:
```
-rw-r--r-- 1 fdroid fdroid 20G 8. Nov 15:22 /home/fdroid/.vagrant.d/boxes/buildserver/0/libvirt/box.img
-rw------- 1 root root 19G 8. Nov 14:07 /var/lib/libvirt/images/buildserver_default.img
-rwxr--r-- 1 libvirt-qemu libvirt-qemu 20G 8. Nov 16:08 /var/lib/libvirt/images/buildserver_vagrant_box_image_0_box.img
```
If Vagrantfile.yaml exists, makebuildserver should no longer try to write
to it. It is now manully managed now that makebuildserver.config.py no
longer exists. Also, now that the buildserver is smaller, the workflow is
to always destroy and recreate it rather than ever try to reprovision it.
This is not user-configurable, so it should not be setup to be. This
process is only tested on the one basebox, and devs can just edit
Vagrantfile directly to test other base boxes.
# Conflicts:
# makebuildserver
Boxes are stored in two places when using vagrant-libvirt:
1. `vagrant box add` -> ~/.vagrant.d/boxes/buildserver/0/libvirt/
2. `vagrant up` -> /var/lib/libvirt/images/buildserver_vagrant_box_image_0_box.img
If the second box is not cleaned up, then `fdroid build` will continue
to use the one from the second location, thereby ignoring the updated
one at the first location. This keeps the second one around until the
new box is ready in case `fdroid build` is using it while this script
is running.
Years ago, vagrant-libvirt did not implement the `vagrant package` command
that we needed, and there were no Ruby people around to implement it for us.
So we hacked a custom version in our Python wrapper. Now, vagrant-libvirt
v0.7.0 does implement it, so this switches things to just using
`vagrant package`
It is a huge package, it is rarely used, its not supported by
fdroid/sdkmanager yet, and it is a pain to manage the install. If this
breaks any app builds, the package can be installed as part of the build
metadata.
In order to support Docker, this should be able to operate without ssh,
e.g. using vagrant-communicator-docker. This removes the buildserverid
hack and makes it a provisioner shell script.
This keeps the Long Term Support release and the latest release installed.
r10e was kept in because it needs a special extraction method, since it is
a .bin file, not a .zip. r12b is kept in because it is the old default.
Here is a survey of the NDK versions used in the most recent Builds entry
in each app that uses the NDK:
{'r10e': 6,
'r12b': 93,
'r13b': 4,
'r14b': 5,
'r15c': 7,
'r16b': 14,
'r17b': 4,
'r17c': 7,
'r18b': 9,
'r19c': 17,
'r20': 1,
'r20b': 22,
'r21': 3,
'r21d': 56,
'r21e': 65,
'r22': 9,
'r22b': 15,
'r9b': 1}
#517
import glob
import os
import yaml
try:
from yaml import CSafeLoader as SafeLoader
except ImportError:
from yaml import SafeLoader
ndks = dict()
for f in glob.glob('metadata/*.yml'):
with open(f) as fp:
app = yaml.load(fp, Loader=SafeLoader)
if app.get('Disable'):
continue
build = app.get('Builds', [])[-1]
if build.get('disabled'):
continue
ndk = build.get('ndk')
if ndk and ndk[1] == '9':
print(f, build)
elif ndk and int(ndk[2:3]) < 18:
print(f, build)
if ndk:
print(f, ndk)
if ndk not in ndks:
ndks[ndk] = 0
ndks[ndk] += 1
import pprint
pprint.pprint(ndks)