chiark / gitweb /
fdroidserver.git
7 years agoMerge branch 'fix-ndk' into 'master'
Ciaran Gultnieks [Thu, 4 Aug 2016 09:16:43 +0000 (09:16 +0000)]
Merge branch 'fix-ndk' into 'master'

Re-add NDK r12b and fix build-tools 24.0.1

See merge request !152

7 years agomakebs: work around build-tools 24.0.1 version bug
Daniel Martí [Tue, 2 Aug 2016 16:08:48 +0000 (18:08 +0200)]
makebs: work around build-tools 24.0.1 version bug

The zip contains 24.0.0 as the version, which means our magic was
installing 24.0.0 twice and skipping 24.0.1.

7 years agoall: switch to build-tools 24.0.1 as default
Daniel Martí [Tue, 2 Aug 2016 09:12:01 +0000 (11:12 +0200)]
all: switch to build-tools 24.0.1 as default

7 years agoRe-add NDK r12b, now fixed.
Daniel Martí [Tue, 2 Aug 2016 09:09:32 +0000 (11:09 +0200)]
Re-add NDK r12b, now fixed.

7 years agoRevert "all: add NDK r12b and set it as default"
Ciaran Gultnieks [Mon, 1 Aug 2016 11:38:52 +0000 (12:38 +0100)]
Revert "all: add NDK r12b and set it as default"

This reverts commit 82d09560c63ea282222b319437494ad6837be026.

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

7 years agoCatch another case of invalid wiki page names
Ciaran Gultnieks [Mon, 1 Aug 2016 11:25:22 +0000 (12:25 +0100)]
Catch another case of invalid wiki page names

7 years agoMerge branch 'bump-ci' into 'master'
Daniel Martí [Mon, 1 Aug 2016 06:07:26 +0000 (06:07 +0000)]
Merge branch 'bump-ci' into 'master'

CI: bump docker image

See merge request !151

7 years agoCI: bump docker image
Daniel Martí [Sun, 31 Jul 2016 22:57:32 +0000 (00:57 +0200)]
CI: bump docker image

7 years agoMerge branch 'pep' into 'master'
Daniel Martí [Sun, 31 Jul 2016 17:15:58 +0000 (17:15 +0000)]
Merge branch 'pep' into 'master'

bs: add sqlite3 and asn1c

Ref: https://gitlab.com/fdroid/fdroiddata/merge_requests/1557

See merge request !149

7 years agocommon: extra checks for NDK in local.props
Daniel Martí [Thu, 28 Jul 2016 06:26:51 +0000 (08:26 +0200)]
common: extra checks for NDK in local.props

The previous commit fixed it in local setups, this fixes it in broken
buildservers too and makes it more reliable.

7 years agomakebs: fix config crash
Daniel Martí [Wed, 27 Jul 2016 09:20:17 +0000 (11:20 +0200)]
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.

7 years agowp-fdroid: add 7.0 (24) to the versions list
Daniel Martí [Mon, 25 Jul 2016 12:56:54 +0000 (14:56 +0200)]
wp-fdroid: add 7.0 (24) to the versions list

7 years agocommon: don't insert $ANDROID_NDK to local.props
Daniel Martí [Mon, 25 Jul 2016 11:07:46 +0000 (13:07 +0200)]
common: don't insert $ANDROID_NDK to local.props

See the comment.

Updates #171.

7 years agomakebs: update android support repo
Daniel Martí [Mon, 25 Jul 2016 10:45:56 +0000 (12:45 +0200)]
makebs: update android support repo

7 years agomakebs: add build-tools-24.0.1
Daniel Martí [Mon, 25 Jul 2016 10:40:44 +0000 (12:40 +0200)]
makebs: add build-tools-24.0.1

Fixes #196.

7 years agomakebs: "fix" platform v24 zip for r02
Daniel Martí [Mon, 25 Jul 2016 10:40:17 +0000 (12:40 +0200)]
makebs: "fix" platform v24 zip for r02

Google replaced the r01 zip instead of adding the r02 one. Oh well.

7 years agobs: add sqlite3 and asn1c
Boris Kraut [Sat, 23 Jul 2016 17:14:28 +0000 (19:14 +0200)]
bs: add sqlite3 and asn1c

7 years agomakebs: revert platform-tools change in 2227cc6d
Daniel Martí [Tue, 19 Jul 2016 18:30:05 +0000 (20:30 +0200)]
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.

7 years agoMerge branch 'ndk-r12' into 'master'
Hans-Christoph Steiner [Mon, 18 Jul 2016 14:50:51 +0000 (14:50 +0000)]
Merge branch 'ndk-r12' into 'master'

NDK r12

See merge request !147

7 years agoMerge branch 'ndk-error' into 'master'
Hans-Christoph Steiner [Mon, 18 Jul 2016 14:47:45 +0000 (14:47 +0000)]
Merge branch 'ndk-error' into 'master'

build: error properly if an invalid ndk is used

See merge request !146

7 years agoMerge branch 'patch-2' into 'master'
Daniel Martí [Wed, 13 Jul 2016 20:48:33 +0000 (20:48 +0000)]
Merge branch 'patch-2' into 'master'

Server manual phrasing matches client. "beta" -> "unstable"

Fixes #193

See merge request !148

7 years agoServer manual phrasing matches client. "beta" -> "unstable"
Stephen Michel [Wed, 13 Jul 2016 17:25:33 +0000 (17:25 +0000)]
Server manual phrasing matches client. "beta" -> "unstable"

7 years agoall: remove 32-bit buildserver code
Daniel Martí [Wed, 13 Jul 2016 15:47:58 +0000 (16:47 +0100)]
all: remove 32-bit buildserver code

We dropped support for 32-bit, so remove all the now unused code and
references.

7 years agoall: add NDK r12b and set it as default
Daniel Martí [Wed, 13 Jul 2016 15:45:05 +0000 (16:45 +0100)]
all: add NDK r12b and set it as default

7 years agobuild: error properly if an invalid ndk is used
Daniel Martí [Wed, 13 Jul 2016 15:32:52 +0000 (16:32 +0100)]
build: error properly if an invalid ndk is used

Currently, if buildjni is not used but ndk is set to an invalid value,
the build would start but $ANDROID_NDK would be empty. This is happening
in VLC, which results in very confusing errors.

If a build uses a ndk= value that is not set up, such as r11/r12 which
we do not have yet, it should error with "NDK version could not be
found". It does with this change.

7 years agoMerge branch 'precommit-fixes' into 'master'
Daniel Martí [Wed, 13 Jul 2016 15:32:34 +0000 (15:32 +0000)]
Merge branch 'precommit-fixes' into 'master'

pre-commit script fixes

See merge request !145

7 years agopre-commit: pep8 is now pycodestyle
Daniel Martí [Wed, 13 Jul 2016 11:14:19 +0000 (12:14 +0100)]
pre-commit: pep8 is now pycodestyle

See https://github.com/PyCQA/pycodestyle/issues/466.

7 years agoMerge branch 'use_date_from_apk_in_known_apks' into 'master'
Ciaran Gultnieks [Wed, 13 Jul 2016 11:43:33 +0000 (11:43 +0000)]
Merge branch 'use_date_from_apk_in_known_apks' into 'master'

Pass a date from APK to KnownApks.recordapk()

... if --use-date-from-apks option is used.

Essentially, it just expands influence of `--use-date-from-apks` option to `stats/known_apks.txt`.

See merge request !141

7 years agopre-commit: fix warnings and errors
Daniel Martí [Wed, 13 Jul 2016 11:07:03 +0000 (12:07 +0100)]
pre-commit: fix warnings and errors

Properly print warnings to stderr. Also, use : instead of 'echo' as a
fallback as the latter spits out garbage to stdout.

Examples without pep8 installed.

Before:

 $ ./hooks/pre-commit
./hooks/pre-commit: line 97: WARNING:: command not found
ERROR: pep8 tests failed!

After:

 $ ./hooks/pre-commit
WARNING: pep8 is not installed, using dummy placeholder!

7 years agoMerge branch 'apk-extension-obb-support' into 'master'
Daniel Martí [Wed, 13 Jul 2016 11:01:42 +0000 (11:01 +0000)]
Merge branch 'apk-extension-obb-support' into 'master'

support APK Extension OBB files

Google Play specifies OBB aka "APK Extension" files for apps that need more than 100 MBs, which is the Play APK size limit.  They also provide a mechanism to deliver large data blobs that do not need to be part of the APK.  For example, a game's assets do not need to change often, so they can be shipped as an OBB, then APK updates do not need to include all those assets for each update.

https://developer.android.com/google/play/expansion-files.html

See merge request !143

7 years agotests for finding the proper OBB files for each APK
Hans-Christoph Steiner [Mon, 20 Jun 2016 11:41:30 +0000 (13:41 +0200)]
tests for finding the proper OBB files for each APK

7 years agoadd SHA-256 hashes of each OBB file
Hans-Christoph Steiner [Mon, 20 Jun 2016 20:14:12 +0000 (22:14 +0200)]
add SHA-256 hashes of each OBB file

7 years agosupport .obb files for Opaque Binary Blog APK Expansions
Hans-Christoph Steiner [Wed, 15 Jun 2016 22:29:17 +0000 (00:29 +0200)]
support .obb files for Opaque Binary Blog APK Expansions

OBB files provide a mechanism to deliver large data blobs that do not need
to be part of the APK.  For example, a game's assets do not need to change
often, so they can be shipped as an OBB, then APK updates do not need to
include all those assets for each update.

https://developer.android.com/google/play/expansion-files.html

7 years agoMerge branch 'standalone-vagrantfile' into 'master'
Ciaran Gultnieks [Thu, 7 Jul 2016 15:37:26 +0000 (15:37 +0000)]
Merge branch 'standalone-vagrantfile' into 'master'

Standalone Vagrantfile

@mvdan @CiaranG as a follow up on our work moving to a 64-bit build server VM, this moves the buildserver config to a standalone YAML file and commits a static _Vagrantfile_ to git.  This makes it a lot easier to work with, especially for people who normally use git.  The buildserver config is already a Python _dict_, and its trivial to export a _dict_ to a YAML file.  _Vagrantfile_ is a Ruby script, where its trivial to load a YAML file.  This moves some of the logic into _Vagrantfile_ itself.  This means that someone can mess with _Yagrantfile.yaml_ and/or _Vagrantfile_ to work on the buildserver setup, without having to run `./makebuildserver`.  Then once something is working, it can be ported to the current `./makebuildserver` setup that generates _Vagrantfile.yaml_.

This is important for working on getting this whole thing running in a KVM instance like jenkins.debian.net and elsewhere.  From what I read, VirtualBox in KVM is only possible if VirtualBox is running in 32-bit mode, so that's a dead end for us.  We need to be able to run the buildserver as KVM in KVM #190.  This merge request doesn't get us there yet, but it makes the process a lot easier.

This also moves everything but Kivy to provisioning shell scripts, since the existing chef scripts were really just shell scripts wrapped in Chef wrapped in Vagrant wrapped in `./makebuildserver`.

This passes the gpjenkins CI build that creates the buildserver from scratch, then builds F-Droid and AdAway:
http://qssio5fppcrojdh3.onion:8080/job/fdroidserver-makebuildserver-eighthave/602/

I tried adding Amaze and Retrolambda as test apps for the buildserver too, we'll see how that goes:
http://qssio5fppcrojdh3.onion:8080/job/fdroidserver-makebuildserver-eighthave

See merge request !144

7 years agobuildserver: delete corrupt files from the cache
Hans-Christoph Steiner [Wed, 6 Jul 2016 20:16:26 +0000 (22:16 +0200)]
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

7 years agobuildserver: buildserver/Vagrantfile is configed by .yaml file
Hans-Christoph Steiner [Mon, 4 Jul 2016 18:49:41 +0000 (20:49 +0200)]
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.

7 years agobuildserver: send config to vagrant via YAML file
Hans-Christoph Steiner [Mon, 4 Jul 2016 18:22:00 +0000 (20:22 +0200)]
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.

7 years agobuildserver: make provision scripts output name to log
Hans-Christoph Steiner [Mon, 4 Jul 2016 12:20:42 +0000 (14:20 +0200)]
buildserver: make provision scripts output name to log

7 years agobuildserver: use pip instead of easy_install for caching
Hans-Christoph Steiner [Mon, 4 Jul 2016 12:08:54 +0000 (14:08 +0200)]
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.

7 years agobuildserver: move apt setup to a shell script
Hans-Christoph Steiner [Mon, 4 Jul 2016 11:52:19 +0000 (13:52 +0200)]
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.

7 years agobuildserver: move trusty/paramiko hack to its own shell script
Hans-Christoph Steiner [Mon, 4 Jul 2016 11:23:25 +0000 (13:23 +0200)]
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?

7 years agobuildserver: enable debug log for provision-android-sdk
Hans-Christoph Steiner [Wed, 22 Jun 2016 06:06:07 +0000 (08:06 +0200)]
buildserver: enable debug log for provision-android-sdk

7 years agobuildserver: android --silent hides errors, so remove
Hans-Christoph Steiner [Tue, 21 Jun 2016 16:12:09 +0000 (18:12 +0200)]
buildserver: android --silent hides errors, so remove

--silent seem to prevent `android update sdk` from exiting with an error,
so its kind of useless.  I just wanted it to suppress the verbose logs.

7 years agobuildserver: download and cache latest platform-tools and m2repository
Hans-Christoph Steiner [Tue, 21 Jun 2016 16:15:40 +0000 (18:15 +0200)]
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/

7 years agobuildserver: test builds against fdroid and adaway
Hans-Christoph Steiner [Mon, 4 Jul 2016 14:34:11 +0000 (16:34 +0200)]
buildserver: test builds against fdroid and adaway

The other apps are too flaky on gpjenkins right now, and that's our
only box for running full buildserver tests.  Once we get the
buildserver tests running on jenkins.debian.net, then we can add a
bunch more apps to the test script.  gpjenkins is an extra locked down
box, so that's why the builds are flaky: gradle and maven downloads
regularly fail because they are blocked.

7 years agobuildserver: remove last vestige of 32-bit buildserver
Hans-Christoph Steiner [Mon, 4 Jul 2016 15:14:06 +0000 (17:14 +0200)]
buildserver: remove last vestige of 32-bit buildserver

7 years agojenkins-build: switch buildserver to new 64-bit base
Hans-Christoph Steiner [Mon, 4 Jul 2016 11:14:37 +0000 (13:14 +0200)]
jenkins-build: switch buildserver to new 64-bit base

7 years agomakebs: flip arch64 bool
Daniel Martí [Mon, 4 Jul 2016 11:01:58 +0000 (12:01 +0100)]
makebs: flip arch64 bool

The last commit was missing this.

7 years agoswitch to new 64-bit base box image: https://f-droid.org/jessie64.box
Hans-Christoph Steiner [Mon, 4 Jul 2016 10:34:00 +0000 (12:34 +0200)]
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

7 years agoVarious changes to get makebuildserver to work with a 64 bit base box
Ciaran Gultnieks [Fri, 1 Jul 2016 12:00:38 +0000 (12:00 +0000)]
Various changes to get makebuildserver to work with a 64 bit base box

Note that the apt packages are split into two halves, because it takes
too long (on 64 bit!) to install them all. The sensible fix would be
to simply up the timeout on the package installation section, but this
is completely broken in chef.

7 years agoMerge branch 'java8-and-other-fixes' into 'master'
Hans-Christoph Steiner [Mon, 27 Jun 2016 18:48:19 +0000 (18:48 +0000)]
Merge branch 'java8-and-other-fixes' into 'master'

Java8 and other fixes

This fixes the OSX travis-ci job for the Java8 update, and also two other fixes as described in the commit message.  @CiaranG I think the _/etc/profile_ approach in 7b466b6266a466a954c845968271283ad60e43ea gets us closer to the idea of having the `fdroid build` jobs run in the same environment as `vagrant ssh`.

See merge request !138

7 years agohandle APKs with filenames encoded with CP437
Hans-Christoph Steiner [Thu, 23 Jun 2016 15:58:25 +0000 (17:58 +0200)]
handle APKs with filenames encoded with CP437

The ZIP format has no official encoding :-| so we have to do hacks.  The
zipfile devs couldn't even sort this out:
https://bugs.python.org/issue10614

closes #167

7 years agoFDroidPopen must have a locale to support UTF-8 filenames
Hans-Christoph Steiner [Thu, 23 Jun 2016 15:11:49 +0000 (17:11 +0200)]
FDroidPopen must have a locale to support UTF-8 filenames

`fdroid update` should be able to handle any valid filename (hopefully
aapt doesn't barf on them).  To handle that, the environment where the
shell commands are run in needs to have a UTF-8 locale set. If LANG is
not set, things default to ASCII and UTF-8 filenames fail.

This also renames test APK with lots of Unicode chars as a test case.

closes #167

7 years agoignore commonly used files for testing in place
Hans-Christoph Steiner [Mon, 20 Jun 2016 12:24:12 +0000 (14:24 +0200)]
ignore commonly used files for testing in place

7 years agotravis-ci: use most recent OSX image to get Java8
Hans-Christoph Steiner [Tue, 21 Jun 2016 14:07:14 +0000 (16:07 +0200)]
travis-ci: use most recent OSX image to get Java8

https://gitlab.com/fdroid/fdroidserver/merge_requests/137

7 years agoload bash profile using --login when running builds on server
Hans-Christoph Steiner [Tue, 21 Jun 2016 08:39:41 +0000 (10:39 +0200)]
load bash profile using --login when running builds on server

This will make `vagrant ssh` and `fdroid build --server` be the same env,
so troubleshooting should be easier.  !135  Here's what `man bash` says:

 When bash is invoked as an interactive login shell, or as a
 non-interactive shell with the --login option, it first reads and
 executes commands from the file /etc/profile, if that file
 exists.  After reading that file, it looks for ~/.bash_profile,
 ~/.bash_login, and ~/.profile, in that order, and reads and
 executes commands from the first one that exists and is readable.
 The --noprofile option may be used when the shell is started to
 inhibit this behavior. When a login shell exits, bash reads and
 executes commands from the file ~/.bash_logout, if it exists.

7 years agoproperly close opened images
Hans-Christoph Steiner [Mon, 20 Jun 2016 12:01:56 +0000 (14:01 +0200)]
properly close opened images

This stops these errors:

fdroid/fdroidserver/fdroidserver/update.py:744: ResourceWarning: unclosed
 file <_io.BufferedReader
 name='repo/icons-320/info.guardianproject.urzip.100.png'>

fdroid/fdroidserver/fdroidserver/update.py:721: DeprecationWarning: The
 'warn' function is deprecated, use 'warning' instead

7 years agoMerge branch 'api-24' into 'master'
Daniel Martí [Mon, 27 Jun 2016 07:03:58 +0000 (07:03 +0000)]
Merge branch 'api-24' into 'master'

Api 24, gradle versions

CC @krt @eighthave

See merge request !140

7 years agoMerge branch 'permission-fix' into 'master'
Daniel Martí [Mon, 27 Jun 2016 06:41:49 +0000 (06:41 +0000)]
Merge branch 'permission-fix' into 'master'

Make permission parsing more specific

Get name only and ignore maxSdkVersion

Fixes #188

See merge request !142

7 years agoMake permission parsing more specific
Dominik Schürmann [Sun, 26 Jun 2016 16:03:37 +0000 (18:03 +0200)]
Make permission parsing more specific

Get name only and ignore maxSdkVersion

Fixes #188

7 years agoPass default date to KnownApks.recordapk()
Dmitriy Bogdanov [Sun, 26 Jun 2016 15:18:50 +0000 (19:18 +0400)]
Pass default date to KnownApks.recordapk()

... if --use-date-from-apks option is used

7 years agoAdd Gradle 2.2 and 2.14 to the buildserver
Daniel Martí [Fri, 24 Jun 2016 16:03:48 +0000 (17:03 +0100)]
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.

7 years agoAdd platform-24 to the buildserver
Daniel Martí [Fri, 24 Jun 2016 16:01:22 +0000 (17:01 +0100)]
Add platform-24 to the buildserver

7 years agoall: add and switch to build-tools v24
Daniel Martí [Fri, 24 Jun 2016 15:54:30 +0000 (16:54 +0100)]
all: add and switch to build-tools v24

7 years agoMerge branch 'jdk8' into 'master'
Hans-Christoph Steiner [Tue, 21 Jun 2016 14:02:19 +0000 (14:02 +0000)]
Merge branch 'jdk8' into 'master'

all: switch to jdk8 as default

@eighthave this will probably require some action on the jenkins machine to replace jdk7 with jdk8.

Any thoughts @CiaranG?

See merge request !137

7 years agoall: switch to jdk8 as default
Daniel Martí [Tue, 21 Jun 2016 10:41:25 +0000 (11:41 +0100)]
all: switch to jdk8 as default

Also, remove jdk7 as it will become unused. We added jdk8 for
retrolambda, and now that we will use jdk8 as the default, jdk7 is
unnecessary as retrolambda can work fine with just jdk8.

This removes it from the buildserver, and the new CI image also only has
jdk8 from jessie-backports.

Fixes #185.

7 years agoMerge branch 'some-build-fixes' into 'master'
Daniel Martí [Tue, 21 Jun 2016 10:12:54 +0000 (10:12 +0000)]
Merge branch 'some-build-fixes' into 'master'

Some build fixes

This includes a couple of fixes discussed with @mvdan including removing the `ANDROID_NDK_HOME` env var from the buildserver and removing the default behavior to force the build-tools version.

See merge request !136

7 years agoadd force_build_tools config option
Hans-Christoph Steiner [Mon, 20 Jun 2016 18:00:59 +0000 (20:00 +0200)]
add force_build_tools config option

This replaces the current default behavior of always forcing the
build_tools version and allows the user to set build-tools forcing in
config.py.

closes #147

7 years agocheck whether metadata file is a duplicate before parsing it
Hans-Christoph Steiner [Wed, 23 Mar 2016 20:04:20 +0000 (21:04 +0100)]
check whether metadata file is a duplicate before parsing it

By checking first, this prevents a stacktrace when the duplicate metadata
file is not valid.  For example, in the tests, the duplicate is just a zero
length file, which was causing a stacktrace.

7 years agobuildserver: do not set NDK env vars, they are handled by `fdroid build`
Hans-Christoph Steiner [Fri, 17 Jun 2016 09:29:00 +0000 (11:29 +0200)]
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.

7 years agobuildserver: run tests with verbose logs
Hans-Christoph Steiner [Mon, 20 Jun 2016 09:18:03 +0000 (11:18 +0200)]
buildserver: run tests with verbose logs

7 years agobuildserver: suppress unzip file list when unpacking SDK/NDK
Hans-Christoph Steiner [Fri, 17 Jun 2016 12:29:41 +0000 (14:29 +0200)]
buildserver: suppress unzip file list when unpacking SDK/NDK

Just too much pointless info in the log.

7 years agoMerge branch 'fix-buildserver' into 'master'
Hans-Christoph Steiner [Tue, 21 Jun 2016 08:22:34 +0000 (08:22 +0000)]
Merge branch 'fix-buildserver' into 'master'

Fix buildserver, broken by e449d2f

Switching to a script /etc/profile.d to set up the environment is all
well and good, except that doesn't get run when you directly execute a
command directly via ssh, which means that the buildserver didn't work
at all (at least for anything that used gradle, or relied on the
environment variables.

This fix doesn't look very nice, but it works - it just forces the
appropriate script to run before build.py is executed on the server.

(Side note, I thought we had tests for this, how did it get past them?)

See merge request !135

7 years agoMerge branch 'master' into 'master'
Hans-Christoph Steiner [Tue, 21 Jun 2016 06:34:20 +0000 (06:34 +0000)]
Merge branch 'master' into 'master'

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.

See merge request !134

7 years agoFix buildserver, broken by e449d2f
Ciaran Gultnieks [Sat, 18 Jun 2016 11:10:36 +0000 (12:10 +0100)]
Fix buildserver, broken by e449d2f

Switching to a script /etc/profile.d to set up the environment is all
well and good, except that doesn't get run when you directly execute a
command directly via ssh, which means that the buildserver didn't work
at all (at least for anything that used gradle, or relied on the
environment variables.

This fix doesn't look very nice, but it works - it just forces the
appropriate script to run before build.py is executed on the server.

(Side note, I thought we had tests for this, how did it get past them?)

7 years agoTone down makebuildserver terminal spamming
Ciaran Gultnieks [Fri, 17 Jun 2016 12:39:01 +0000 (13:39 +0100)]
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.

7 years agoMerge branch 'add-sig-algs-1' into 'master'
Hans-Christoph Steiner [Fri, 17 Jun 2016 12:05:22 +0000 (12:05 +0000)]
Merge branch 'add-sig-algs-1' into 'master'

Adding support for DSA and ECDSA signatures in binaries

Before this patch only RSA signature files was supported when using the Binaries metadata directive as described in https://f-droid.org/wiki/page/Deterministic,_Reproducible_Builds.

This patch simply makes .DSA and .EC files also be recognised as signature files.

See merge request !133

7 years agoAdding support for DSA and ECDSA signatures.
Markus Kilås [Fri, 17 Jun 2016 10:58:52 +0000 (12:58 +0200)]
Adding support for DSA and ECDSA signatures.

7 years agolint: only check unused exlibs if using all apps
Daniel Martí [Fri, 17 Jun 2016 10:35:44 +0000 (11:35 +0100)]
lint: only check unused exlibs if using all apps

7 years agoMerge branch 'use-android-update-sdk' into 'master'
Ciaran Gultnieks [Fri, 17 Jun 2016 09:15:33 +0000 (09:15 +0000)]
Merge branch 'use-android-update-sdk' into 'master'

switch SDK/NDK/gradle buildserver provisioning to shell scripts

This converts the SDK, NDK, and gradle chef recipes to vagrant provisioning shell scripts.   Those recipes were just shell scripts anyway, forced into that ugly ruby/chef syntax.  Hopefully this will make things easier to maintain since simple bash is easier for most devs than ruby/chef. Also, it might speed up the provisioning a little bit since the whole script is sent to the VM then executed, rather than sent line-by-line.  Additionally, the SDK components are now installed using `android update sdk` so we do not need to duplicate Google's crazy kludges with that stuff.

See merge request !132

7 years agocommon: always set android ndk env vars
Daniel Martí [Thu, 16 Jun 2016 20:36:31 +0000 (21:36 +0100)]
common: always set android ndk env vars

Also, add the ndk to PATH at the beginning, in case any other ndks are
already in it.

Fixes #176.

7 years agoinvalidate apkcache if the metadata version is different
Hans-Christoph Steiner [Wed, 15 Jun 2016 14:34:10 +0000 (16:34 +0200)]
invalidate apkcache if the metadata version is different

When the metadata changes, different things will be stored about each APK.
So invalidate the cached info parsed from APKs if the cache's metadata
version does not match the metadata version of the currently running tools.

7 years agoinclude new provisioning shell scripts in syntax checks
Hans-Christoph Steiner [Wed, 15 Jun 2016 13:39:49 +0000 (15:39 +0200)]
include new provisioning shell scripts in syntax checks

7 years agobuildserver: /vagrant/cache writeable only by root
Hans-Christoph Steiner [Wed, 15 Jun 2016 10:47:16 +0000 (12:47 +0200)]
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.

7 years agobuildserver: unpack gradle versions with provisioning shell script
Hans-Christoph Steiner [Wed, 15 Jun 2016 13:25:57 +0000 (15:25 +0200)]
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.

7 years agobuildserver: unpack NDK with a provisioning shell script
Hans-Christoph Steiner [Wed, 15 Jun 2016 13:02:37 +0000 (15:02 +0200)]
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.

7 years agobuildserver: use `android update sdk` to install Android SDK
Hans-Christoph Steiner [Tue, 14 Jun 2016 14:34:13 +0000 (16:34 +0200)]
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.

7 years agobuildserver: setup env vars using standard script
Hans-Christoph Steiner [Wed, 15 Jun 2016 11:09:57 +0000 (13:09 +0200)]
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

7 years agobuildserver: extract NDK rather than executing it
Hans-Christoph Steiner [Wed, 15 Jun 2016 12:25:22 +0000 (14:25 +0200)]
buildserver: extract NDK rather than executing it

Then the NDK archive doesn't need execute permissions.

7 years agogithooks: do not run syntax checks on files being deleted
Hans-Christoph Steiner [Wed, 15 Jun 2016 11:32:14 +0000 (13:32 +0200)]
githooks: do not run syntax checks on files being deleted

7 years agoMerge branch 'fix-makebuildserver' into 'master'
Ciaran Gultnieks [Wed, 15 Jun 2016 09:30:42 +0000 (09:30 +0000)]
Merge branch 'fix-makebuildserver' into 'master'

Fix ./makebuildserver CI build

In order to get reproducible builds work reliably, we need to have buildserver create be fully automatic, and be able to run in VMs.  It should also handle caching downloads well, so that people can easily rebuild their buildserver, and CI builds don't have to download gigs and gigs for each run.  These are some related fixes.

See merge request !131

7 years agoREBASE buildserver: handle loops in bash, not ruby, to save memory
Hans-Christoph Steiner [Tue, 14 Jun 2016 21:21:39 +0000 (23:21 +0200)]
REBASE buildserver: handle loops in bash, not ruby, to save memory

7 years agotests: `pyvenv --system-site-packages` is too buggy on python 3.4
Hans-Christoph Steiner [Tue, 14 Jun 2016 20:40:50 +0000 (22:40 +0200)]
tests: `pyvenv --system-site-packages` is too buggy on python 3.4

It always wants to install packages into /usr/lib/python3.4/site-packages

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 214, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 176, in clobber
    os.makedirs(dest)
  File "/usr/lib/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.4/site-packages'

7 years agobuildserver: handle loops in bash, not ruby, to save memory
Hans-Christoph Steiner [Tue, 14 Jun 2016 14:34:13 +0000 (16:34 +0200)]
buildserver: handle loops in bash, not ruby, to save memory

Apparently, ruby is quite a memory hog when it forks.  I've been getting
errors like this with ./makebuildserver:

Errno::ENOMEM - script[add_btools_17] (android-sdk::default line 72) had an
  error: Errno::ENOMEM: Cannot allocate memory - fork(2)

So instead of looping in ruby and forking for each loop, handle the looping
in the bash script, so ruby is just calling a single bash script.

7 years agoremove app.openconnect from ./makebuildserver tests
Hans-Christoph Steiner [Tue, 14 Jun 2016 08:27:15 +0000 (10:27 +0200)]
remove app.openconnect from ./makebuildserver tests

Turns out this one is a pain to get running on the locked down Guardian
Project Jenkins box since it uses git:// rather than https:// for the git
submodules.

7 years agomakebuildserver: use original names for downloaded SDK components
Hans-Christoph Steiner [Fri, 10 Jun 2016 09:42:42 +0000 (11:42 +0200)]
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.

7 years agoMerge branch 'targetSdkVersion' into 'master'
Hans-Christoph Steiner [Tue, 14 Jun 2016 10:39:50 +0000 (10:39 +0000)]
Merge branch 'targetSdkVersion' into 'master'

support targetSdkVersion

In order to provide the proper Android-6 permissions experience, the client needs to know which `targetSdkVersion` any APK has before it downloads it.  So this adds it to the metadata.

https://gitlab.com/fdroid/fdroidclient/issues/682

See merge request !128

7 years agoparse targetSdkVersion from APKs
Hans-Christoph Steiner [Tue, 14 Jun 2016 09:43:07 +0000 (11:43 +0200)]
parse targetSdkVersion from APKs

The default targetSdkVersion is minSdkVersion, according to the docs:
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target

https://gitlab.com/fdroid/fdroidclient/issues/682

7 years agoofficial Android default minSdkVersion is 1 not 0
Hans-Christoph Steiner [Mon, 6 Jun 2016 18:17:41 +0000 (20:17 +0200)]
official Android default minSdkVersion is 1 not 0

https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#min

7 years agorename 'sdkversion' var to 'minSdkVersion' to avoid confusion
Hans-Christoph Steiner [Mon, 6 Jun 2016 18:13:57 +0000 (20:13 +0200)]
rename 'sdkversion' var to 'minSdkVersion' to avoid confusion

'sdkversion' is confusing when there is also 'targetSdkVersion' and
'maxSdkVersion'.