Commit Graph

504 Commits

Author SHA1 Message Date
Hans-Christoph Steiner 08f724651e remove "force_build_tools" config option, closes #738
The `force_build_tools` config option was added a long time ago to
brute force the _build-tools_ version by trying to replace the value
in `build.gradle` files. This is never something that should be used
in production, since the app's build metadata should specify this kind
of thing. And now that we're moving towards _androguard_ for
everything except fdroid build and fdroid publish, _build-tools_ will
no longer even be used in the other commands.
2020-09-16 16:30:49 +02:00
Hans-Christoph Steiner da31120b5a build: refactor missing srclibs error reporting for only .yml 2020-08-24 17:05:49 +02:00
Michael Pöhn fd2cfb0c7d remove code for copying txt srclibs to buildserver 2020-08-20 20:40:15 +02:00
Hans-Christoph Steiner d0f426e076
replace $$srclib$$ with an absolute path
closes #725
2020-06-24 22:40:26 +02:00
Marcus f84818c15e scanner: add a simple scan for blacklisted classes after build step
add com.android.billing to blacklist, see
https://gitlab.com/fdroid/fdroiddata/-/issues/2070#note_360611289
2020-06-15 18:03:19 +00:00
Hans-Christoph Steiner d7b3bca1e7 build: pass --verbose flag through to scanner 2020-06-10 19:42:23 +02:00
Hans-Christoph Steiner 6030445be0 logging.warn() was deprecated in Python 3.3, use logging.warning()
sed -i 's,logging\.warn(,logging.warning(,g' fdroid */*.*

https://docs.python.org/3.3/library/logging.html#logging.Logger.warning
2020-05-27 08:35:14 +02:00
relan 9ff77cfd1a build: clean buildSrc/build
The buildSrc directory contains custom build logic written in Kotlin.
Before this change we had to 'scandelete' buildSrc/build in the build
recipes becase 'gradle clean' leaves binary artifacts there.
2020-05-26 07:37:20 +00:00
relan ddfbd1cc47 build: fix directories removal
The 'dirs' array contains a single-level listing of a directory, e. g.
['app', 'build', 'build.gradle', 'gradle', '.gradle']. Multi-component
paths like 'build/tmp' could never be found in this array and thus were
never removed.

Call shutil.rmtree() without checking that the argument is in 'dirs'. If
it exists and is a directory, it'll be removed. Otherwise shutil.rmtree()
will do nothing.
2020-05-26 07:37:20 +00:00
Michael Pöhn 911e86fc87 support copying yml srclibs to buildserver vm during builds 2020-04-16 11:32:37 +02:00
Hans-Christoph Steiner b5bce9f178
build: do not write/rsync status JSON when running --on-server
!717 !716
2020-02-20 16:40:19 +01:00
Hans-Christoph Steiner b6e6ce87cb
build: has no pretty option (closes #742) 2020-02-19 20:29:54 +01:00
Hans-Christoph Steiner 21f5bd73a7
build: fix logging failed builds to the status JSON (closes #741) 2020-02-19 20:29:51 +01:00
Hans-Christoph Steiner c19ef45fd5
build: write status JSON 2020-02-19 14:50:32 +01:00
Marcus Hoffmann 9ae41cc1ff add support for gradle kotlin scripts
https://guides.gradle.org/migrating-build-logic-from-groovy-to-kotlin/
Closes fdroid/fdroidserver#613

cherry-picked from Bubu/fdroidserver@7d2e9f9c
2020-02-13 22:32:51 +01:00
Hans-Christoph Steiner 697a0641f1
fix sudo syntax from 7a1fa6e857
fdroid/fdroidserver!713
2020-02-11 19:44:18 +01:00
Hans-Christoph Steiner 7a1fa6e857 build: keep DEBIAN_FRONTEND env var when running sudo: script
closes #636
2020-02-05 20:36:25 +01:00
Marcus Hoffmann 8961485125 remove dscanner subcommand
It's unused and unmaintained. It could  potentially be revived as a
plugin at a later point.
2020-01-31 14:17:12 +01:00
Michael Pöhn 35e67295e9 Merge branch 'mvglasow-master-patch-68763' into 'master'
Clarify warning message about skipped sudo commands

See merge request fdroid/fdroidserver!608
2019-02-09 18:08:23 +00:00
Marcus Hoffmann 94c6b776fe build: log buildserver guest ram + cpu 2019-02-07 19:48:03 +01:00
Michael Pöhn a787d123a2 fdroid build: hide --on-server cli flag 2019-01-29 11:23:45 +01:00
Michael von Glasow f8f17a430d Reword warning message about sudo commands being skipped 2019-01-15 14:14:09 +00:00
Michael von Glasow 868516f3fd Clarify warning message about skipped sudo commands 2019-01-15 12:36:17 +00:00
Hans-Christoph Steiner 1f346b3149 force_exit() to make exit work with all `fdroid build` conditions
The build command has to use some threading stuff to handle the timeout and
locks.  This seems to prevent the command from exiting, unless this hack is
used.
2018-11-14 14:27:32 +01:00
Hans-Christoph Steiner 807bf3d26b build: reuse common methods for getting metadata from APKs
This splits out the code that gets the list of native ABIs supported, then
uses the standard methods for the rest.
2018-09-18 10:55:51 +02:00
Michael Pöhn c005d8c5f4 more detailed error message and handling when fetching buildserverid in build.py 2018-09-13 11:11:18 +02:00
Hans-Christoph Steiner b254472a99 Merge branch 'exclude-filter' into 'master'
build: replace exclude with filter during source tar creation

Closes #531

See merge request fdroid/fdroidserver!538
2018-09-05 12:39:23 +00:00
Hans-Christoph Steiner 3e1d313b7c mark manually sanitized input so bandit doesn't complain 2018-08-29 17:44:54 +02:00
Hans-Christoph Steiner 2edc68d6cd mark all required permissions so bandit doesn't complain 2018-08-29 17:44:54 +02:00
Hans-Christoph Steiner 5d77fd97ee use posixpath.join() for paths on the buildserver
This fixes bandit misdetection of hardcoded /tmp dir.  posixpath.join() is
good to use anyway, it highlights what is on the remote server, vs what is
local.  Local paths should use os.path.join() to support Windows, etc.
posixpath is built in since Python 3.4, maybe earlier
2018-08-29 17:24:04 +02:00
Areeb Jamal 7bdffde804 build: replace exclude with filter during source tar creation
Replace the deprecated exclude argument with filter in build.py
allowing users of Python 3.7 to use the fdroid CLI

Closes #531
2018-07-25 19:05:30 +05:30
Hans-Christoph Steiner 68fb3d2bd9 fix typos 2018-07-12 23:53:05 +02:00
Michael Pöhn cdc2147de9 put .binary.apk files into sub-directory 2018-07-12 23:52:46 +02:00
Marcus Hoffmann 9889a98dea
build: improve gradle experience
This expands the gradle wrapper shell script used by the buildserver for
usage outside the buildserver environment. It also allows downloading
whitelisted versions of gradle if they are not yet deployed to the
buildserver by simply upsating the copy of fdroidserver (in contrast to
having to reprovision the whole buildserver).

We first move the buildserver/gradle shell script to the repo root
as gradlew-fdroid, as it's an fdroid specific gradle wrapper.
We also now sync it inside the build VM before each build.

We then add a list of whitelisted gradle distributions taken from the
makebuildserver script.

The script additionally now reads two env vars which tell it where to
expect installed versions of gradle and where it might store downloaded
gradle .zip files. Both of those are configurable from config.py. As the
first should normally just be a subdir of the second it's not exposed in
the example config.py but only used by the buildserver config.py.

Default config now uses this internal gradle wrapper but a path to a
custom wrapper or specific gradle distribution can still be set from
config.py.

Closes fdroid/fdroidserver#98
Ref: fdroid/fdroidserver#370
2018-07-11 11:49:46 +02:00
Marcus Hoffmann a728582077
build: propagate --no-tarball option to buildserver
Closes #510
2018-07-09 14:48:59 +02:00
Hans-Christoph Steiner d20e8613fe build: only test for all Android SDK paths where it is needed
Now that androguard can be used, the android-sdk is no longer required for
most operations.
2018-06-25 10:52:12 +02:00
Michael Pöhn 12af173821 fix left out refactoring in build.py 2018-06-23 23:26:42 +02:00
Michael Pöhn 88e64df3ef deploying build logs to server after each individual build run 2018-06-19 12:24:52 +02:00
Hans-Christoph Steiner e6d5260c3c fix PEP8: W504 line break after binary operator 2018-05-29 12:31:56 +02:00
Torsten Grote c6f3aed003
Fix reproducible builds
This commit fixes two bugs with reproducible builds:
* Files added by the buildserver to META-INF (fdroidserverid and buildserverid)
  were causing signature verification to always fail when --on-server was used.
  Since they are not needed anymore, they are no longer added to APKs.
* When showing a diff between both APK files, `jar xf` did not extract
  the full APK properly which was causing useless diffs.
  Instead of using jar, python's zipfile library is used instead.
2018-05-24 16:09:10 -03:00
Hans-Christoph Steiner 4ca77a4faf update: strip all whitespace from buildserverid 2018-03-22 23:19:54 +01:00
Hans-Christoph Steiner 70d9633555 build/checkupdates/update: log current fdroiddata commit to wiki 2018-03-05 21:49:09 +01:00
Hans-Christoph Steiner 52b3436ff6 make is_apk_and_debuggable() default to using androguard before aapt 2018-02-22 15:08:53 +01:00
Hans-Christoph Steiner 62db94d96e Merge branch 'build-36h' into 'master'
build: set overall timeout to 36 hours

See merge request fdroid/fdroidserver!460
2018-02-12 11:06:34 +00:00
relan c0f323e343 build: set overall timeout to 36 hours
Currently f-droid.org has a lot of pending builds and big delays
between "fdroid build --all" runs. Bump overall build time limit from
12 hours to 36 hours to increase buildserver throughput.
2018-02-12 13:45:53 +03:00
Marcus Hoffmann 39a5637df2
build: clear timeout flag before every build
This fixes the weird logging behaviour where after a build that timed
out all subsequent failed builds would also show up as timed out.
2018-02-07 20:47:50 +01:00
csagan5 427427481e Change --resetserver to --reset-server for consistency 2018-01-30 20:45:03 +01:00
csagan5 cf54c9514c Option --resetserver does nothing; have it used instead 2018-01-30 14:50:35 +01:00
relan 86f34ee70a build: make per-build hard time limit customizable
Add "timeout=n" metadata field that overrides build timeout (in seconds).
The default is 7200, i.e. 2 hours.
2018-01-30 11:14:50 +03:00
Hans-Christoph Steiner b851d49d24 shell=True is too dangerous to allow; there are unfiltered user inputs
There are all sorts of unfiltered user inputs like tag and branch names in
source repos.  If those names are fed into popen calls that use shell=True,
that opens up a wide range of exploits.  All core operations should never
use shell=True.
2018-01-26 10:18:41 +01:00