1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-07-07 01:40:10 +02:00
Commit Graph

108 Commits

Author SHA1 Message Date
Daniel Martí
059d216aff Re-add NDK r12b, now fixed. 2016-08-02 11:10:31 +02:00
Ciaran Gultnieks
bf153ec247 Revert "all: add NDK r12b and set it as default"
This reverts commit 82d09560c6.

It doesn't work - the setup scripts are expecting a ".bin" file (which
is apparently a 7z archive), but what's actually got is a ".zip".

Conflicts:
	buildserver/provision-android-ndk
2016-08-01 12:38:52 +01:00
Daniel Martí
957f01f1d6 makebs: fix config crash
Without this, running makebuildserver from a clean master results in the
following:

	 $ ./makebuildserver
	Traceback (most recent call last):
	  File "./makebuildserver", line 74, in <module>
	    del(config['__builtins__'])  # added by compile/exec
	KeyError: '__builtins__'

This is because a clean checkout has no config, thus exec is never
actually ran.
2016-07-27 11:20:17 +02:00
Daniel Martí
11f30223d6 makebs: update android support repo 2016-07-25 12:45:56 +02:00
Daniel Martí
9a4af61a53 makebs: add build-tools-24.0.1
Fixes #196.
2016-07-25 12:40:44 +02:00
Daniel Martí
79a1f2919a makebs: "fix" platform v24 zip for r02
Google replaced the r01 zip instead of adding the r02 one. Oh well.
2016-07-25 12:40:17 +02:00
Daniel Martí
8a8c139aa9 makebs: revert platform-tools change in 2227cc6d
Amusingly, the commit changed more than just this so a simple git revert
is not possible.

The problem is that the zip is replaced with each point release (24.0.1
at the time of writing) and there is no way to get a URL to a single,
non-changing version. Hence any caching or checksums are completely
worthless and will break every few weeks.
2016-07-19 20:38:09 +02:00
Daniel Martí
82d09560c6 all: add NDK r12b and set it as default 2016-07-13 16:45:05 +01:00
Hans-Christoph Steiner
8b53ae0ad0 buildserver: delete corrupt files from the cache
In order to make CI and other automation easier, delete any corrupt files
from the cache if they fail the SHA-256 check.

https://jenkins.debian.net/view/reproducible/job/reproducible_setup_fdroid_build_environment_profitbricks3/112/console
2016-07-06 22:16:55 +02:00
Hans-Christoph Steiner
d4c6fffb30 buildserver: buildserver/Vagrantfile is configed by .yaml file
Vagrantfile is now committed and not changed between configurations. It is
configed by translating the python config file's dict to a YAML file, which
Vagrantfile now loads and uses.  This makes it a lot easier for vagrant
users and python programmers to understand, and hopefully makes it easier
to maintain and test with.
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
2e1ec71404 buildserver: send config to vagrant via YAML file
Python can easily output dicts as YAML, and a Vagrantfile is a ruby script,
which can easily read YAML.  Going this route means that Vagrantfile can
ultimately be committed to git, and the configuration will happen all via
Python dicts output as YAML.  That makes it drastically easier to follow
the code, and to make modifications.
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
0171dd60fd buildserver: use pip instead of easy_install for caching
easy_install does not provide any download caching, while pip does. This
also moves the python module installing a shell script that takes python
packages as args.  That will allow for future uses like allowing app
metadata to include pip modules that they need.
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
aafad6b909 buildserver: move apt setup to a shell script
This makes it so there is only a single `apt-get install` command run,
instead of one command per-package like with the chef script.  It also adds
`apt-get upgrade` to make sure that the base box is fully up-to-date.
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
2374b12a77 buildserver: move trusty/paramiko hack to its own shell script
This is part of the effort to remove moving parts from the whole build
server setup.  Why wrap shell scripts in ruby and chef if we can just
directly run a shell script?
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
2227cc6d1a buildserver: download and cache latest platform-tools and m2repository
Also, by having our own checksums for all the bits means that we can safely
add support for local mirrors, like a bunch in China, for example:
http://mirrors.neusoft.edu.cn/android/repository/
2016-07-04 23:54:52 +02:00
Hans-Christoph Steiner
2daf00abb7 buildserver: remove last vestige of 32-bit buildserver 2016-07-04 23:52:52 +02:00
Daniel Martí
a573688a44 makebs: flip arch64 bool
The last commit was missing this.
2016-07-04 12:01:58 +01:00
Hans-Christoph Steiner
bfd80d12d9 switch to new 64-bit base box image: https://f-droid.org/jessie64.box
build-tools and other SDK bits from android-24 require 64-bit GNU/Linux
2016-07-04 12:34:00 +02:00
Daniel Martí
be4953be02 Add Gradle 2.2 and 2.14 to the buildserver
2.2 can be specifically requested by an app, and in some extreme cases
those apps don't build with 2.2.1.
2016-06-24 17:06:17 +01:00
Daniel Martí
06003d3c04 Add platform-24 to the buildserver 2016-06-24 17:06:17 +01:00
Daniel Martí
b026874353 all: add and switch to build-tools v24 2016-06-24 17:06:16 +01:00
Hans-Christoph Steiner
226237c5f7 buildserver: do not set NDK env vars, they are handled by fdroid build
`fdroid build` handles setting the NDK env vars since the NDK version can
change depending on the app being build.  Unlike ANDROID_HOME, there is no
single global NDK location.  The NDK installs are all versioned.
2016-06-21 10:29:56 +02:00
Ciaran Gultnieks
9a2e06fd5c Tone down makebuildserver terminal spamming
The progress bar updating at each 1k chunk spams the terminal to such an
extent it stops responding to keypresses (at least with a fast
connection). It also seems extremely inefficient to be writing the file
in 1k chunks. This makes it 64k, which is more reasonable but quite
probably still too small.
2016-06-17 13:39:01 +01:00
Hans-Christoph Steiner
d0bb6f73bf buildserver: /vagrant/cache writeable only by root
Prevent build processes from modifying the cache, it is only needed
during provisioning anyway. A malicious build could still use sudo to
change the cache, but this is more to prevent mistaken modifications.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
6ea2508127 buildserver: unpack gradle versions with provisioning shell script
This was not using anything special from chef, so do it in a shell script
instead.  This makes the script easier for the python/shell people, and
probably uses less memory, since chef is a memory hog.  This might even
make the provision go faster since it uploads the whole script as a file to
the VM, then runs it there.  I think chef sends each command via SSH.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
02a835ff95 buildserver: unpack NDK with a provisioning shell script
This makes the process closer to ./jenkins-build scripts and .gitlab-ci.yml
files.  Hopefully it uses less RAM than chef too.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
e47396b403 buildserver: use android update sdk to install Android SDK
`android update sdk --no-ui` is the standard command line tool for
installing the Android SDK.  By symlinking into the $ANDROID_HOME/temp dir,
the cached files can still be used.  This converts the chef recipe to a
vagrant shell provisioning script since it was all bash anyway.

Some file names no longer officially have a -linux in them, so those were
changed to keep the cache working with the default filename.
2016-06-15 15:26:35 +02:00
Hans-Christoph Steiner
e449d2f583 buildserver: setup env vars using standard script
bash provides a standard file location for a script to be run when the
shell starts: /etc/profile.d/  This converts the scattered bits of code for
making ~/.bsenv into a single provisioning script to generate
/etc/profile.d/bsenv.sh, which gets automatically executed when bash starts
2016-06-15 15:26:35 +02:00
Hans-Christoph Steiner
714b3b9ff6 makebuildserver: use original names for downloaded SDK components
It will make it a lot easier to manage the cache if we use the original
file names, which often include the file version.  This also changes the
download process to be resumable if there is a partial file in the cache,
and switches from calling wget on the command line to using the python libs
'requests' and 'clint' to provide a similar experience.  While its not so
important for this particular bit of code to use those libraries, I think
those two will allow us to provide a better user experience throughout the
whole of fdroidserver.

In this case, it is already doing special tricks fetching the file size
from the server before trying to download it.  I suppose this code could
instead check if the file exists, and if so, check the hash sum.  I think
that would be slower for most people since checking the hash on large files
takes a noticeable about of time, while a HTTP HEAD request is pretty tiny.
2016-06-14 14:21:59 +02:00
Daniel Martí
ec7beb8388 Bump platform-23 to r03 2016-05-27 14:08:57 +01:00
Daniel Martí
d5d22dbc99 Update android sdk version
Install version 25 now. Also use the smaller tools zip. While at it,
also remove the tools re-install - it's not worth it, as long as we keep
the initial tools zip up to date.
2016-05-27 14:08:57 +01:00
Daniel Martí
1edd9cde3c Add gradle 2.13 2016-05-27 14:08:57 +01:00
Ciaran Gultnieks
4eb5fa88be Fix gradle download url for 2.12 2016-04-07 08:30:10 +01:00
Daniel Martí
ec9087d057 Add and switch to build-tools 23.0.3
Also bump to the CI image which contains it.
2016-04-05 10:49:30 +01:00
Daniel Martí
a345e351ba Add Gradle 2.12 to the buildserver 2016-04-05 10:49:15 +01:00
Ciaran Gultnieks
009a926ea4 Remove extra blank lines in makebuildserver output
These seem to have appeared during the py3 conversion.
2016-03-21 08:45:42 +00:00
Hans-Christoph Steiner
8f99400064 makebuildserver: buildserverid should always be a string 2016-03-14 17:35:44 +01:00
Hans-Christoph Steiner
7039d16046 always parse versions as strings, not bytes
Fixes a couple errors like:
  File "./makebuildserver", line 30, in vagrant
    out += line
  TypeError: Can't convert 'bytes' object to str implicitly

If universal_newlines=False, the default, then Popen will return bytes if
the newlines in the data do not match the system's newlines.  Setting it to
true enables auto-conversion, and then guarantees that the data is always
str.

"If universal_newlines is True, the file objects stdin, stdout and stderr
are opened as text streams in universal newlines mode, as described above
in Frequently Used Arguments, otherwise they are opened as binary streams."
https://docs.python.org/3/library/subprocess.html#subprocess.Popen
2016-03-14 12:49:38 +01:00
Ciaran Gultnieks
bc131856d2 Fix python2/makebuildserver breakage 2016-03-13 20:49:38 +00:00
Daniel Martí
fc0746712d Merge branch 'master' into 'master'
makebuildserver: support running VirtualBox in a VM

For debian.jenkins.net, our test environment is a kvm instance that does not expose the hardware virtualization instructions.  So this auto-detects whether the current machine, virtual or not, supports the hardware virtualization.  If not, it uses VirtualBox's software emulator, which should run everywhere, even in a kvm instance.

See merge request !108
2016-03-11 23:53:25 +00:00
Daniel Martí
49ac25270e Run 2to3 on makebuildserver
Mostly just print conversion.
2016-03-10 16:43:37 +00:00
Daniel Martí
99edd64372 Switch all headers to python3 2016-03-10 16:43:36 +00:00
Hans-Christoph Steiner
6f254ff7b6 makebuildserver: use VB software virt if hardware is not available
This checks the local CPU settings to see if it has the right virtualizing
CPU instructions, and only uses VirtualBox hardware virtualization on
setups where it is available.  VMs instances usually do not provide these
instructions.  Where the CPU features are not available, it will use VB's
software virtualization.
2016-03-10 12:28:31 +01:00
Daniel Martí
da0a787879 Add gradle 2.11 2016-02-15 12:02:45 +00:00
Hans-Christoph Steiner
7f451a815b makebuildserver: add workaround to Ubuntu/trusty's old paramiko
Ubuntu trusty 14.04's paramiko does not work with jessie's openssh's
default settings, so they need to be tweaked in order to provide working
ssh to the instance.

https://stackoverflow.com/questions/7286929/paramiko-incompatible-ssh-peer-no-acceptable-kex-algorithm/32691055#32691055
2016-02-11 20:27:30 +01:00
Hans-Christoph Steiner
09daa5eee0 makebuildserver: default memory to 1024MB, so it runs on normal machines
4 gigs is still a common amount of RAM these days for laptops, if the VM
takes almost all of that, it makes the machine drag to almost a halt. Most
apps build fine in 1gig of RAM, indeed that's the default for most CI
instances, like travis-ci and gitlab-ci.
2016-02-03 14:54:14 +01:00
Hans-Christoph Steiner
dd93505fce allow setting up an apt package cache for the build server setup
This creates a cache folder which will store the apt cache from the VM.
2016-02-03 14:54:14 +01:00
Hans-Christoph Steiner
b6a5978b11 makebuildserver: make chef find the custom cache locations 2016-02-03 14:54:14 +01:00
Hans-Christoph Steiner
90d81eba2d makebuildserver: settable vm boot timeout, plus longer default
On slow machines or VMs like the Debian jenkins box, the VM boot timeout
needs to be a lot longer, otherwise vagrant times out before setting up
the VM.
2016-01-26 17:47:17 +01:00
Hans-Christoph Steiner
3511c44357 makebuildserver: explicitly set debian_mirror by default
There needs to be a default, otherwise it crashes.  I should have included
this in 8d66742dd7
2016-01-26 17:46:51 +01:00