From 56959935212520f8b14ec1e218ea71b0c7a3de02 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Thu, 11 Mar 2021 18:52:31 +0100 Subject: [PATCH 1/3] build: include useful successful build IDs in status JSON, closes #825 --- fdroidserver/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fdroidserver/build.py b/fdroidserver/build.py index 79df3013..b63e0eca 100644 --- a/fdroidserver/build.py +++ b/fdroidserver/build.py @@ -1052,8 +1052,10 @@ def main(): # Build applications... failed_builds = [] build_succeeded = [] + build_succeeded_ids = [] status_output['failedBuilds'] = failed_builds status_output['successfulBuilds'] = build_succeeded + status_output['successfulBuildIds'] = build_succeeded_ids # Only build for 72 hours, then stop gracefully. endtime = time.time() + 72 * 60 * 60 max_build_time_reached = False @@ -1167,6 +1169,7 @@ def main(): 'successfully') build_succeeded.append(app) + build_succeeded_ids.append([app['id'], build.versionCode]) wikilog = "Build succeeded" except VCSException as vcse: From fc368dc29140cd47aba5f05e85044bd437c05072 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Fri, 12 Mar 2021 13:14:55 +0100 Subject: [PATCH 2/3] makebuildserver: print message before rsyncing caches This process can take a very long time if the caches are large, so at least print something about what it is doing. --- makebuildserver | 2 ++ 1 file changed, 2 insertions(+) diff --git a/makebuildserver b/makebuildserver index 3e34494b..7147fb1e 100755 --- a/makebuildserver +++ b/makebuildserver @@ -569,6 +569,8 @@ def main(): for d in ('.m2', '.gradle/caches', '.gradle/wrapper', '.pip_download_cache'): fullpath = os.path.join(os.getenv('HOME'), d) + os.system('date') + print('rsyncing', fullpath, 'into VM') if os.path.isdir(fullpath): ssh_command = ' '.join(('ssh -i {0} -p {1}'.format(key, port), '-o StrictHostKeyChecking=no', From 78842e9cc26d051ba2882055c93f99df5840d7c9 Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Mon, 15 Mar 2021 10:10:09 +0100 Subject: [PATCH 3/3] scanner: should not exit with error when apkanalyzer fails apkanalyzer produces useful output when it can run, but it does not support all recent JDK versions, and also some DEX versions, so this cannot count on it to always produce useful output or even to run without exiting with an error. 211dd65ff0263e3b680dcd21f9e0efa3dd7e50d7 was based on false assumptions that apkanalyzer can always produce output. fdroiddata!8585 fdroiddata!8584 --- fdroidserver/scanner.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/fdroidserver/scanner.py b/fdroidserver/scanner.py index 239e82b4..436abf1e 100644 --- a/fdroidserver/scanner.py +++ b/fdroidserver/scanner.py @@ -103,12 +103,20 @@ def get_gradle_compile_commands(build): def scan_binary(apkfile): - logging.info("Scanning APK for known non-free classes.") + """Scan output of apkanalyzer for known non-free classes + + apkanalyzer produces useful output when it can run, but it does + not support all recent JDK versions, and also some DEX versions, + so this cannot count on it to always produce useful output or even + to run without exiting with an error. + + """ + + logging.info(_('Scanning APK with apkanalyzer for known non-free classes.')) result = common.SdkToolsPopen(["apkanalyzer", "dex", "packages", "--defined-only", apkfile], output=False) - problems = 0 if result.returncode != 0: - problems += 1 - logging.error(result.output) + logging.warning(_('scanner not cleanly run apkanalyzer: %s') % result.output) + problems = 0 for suspect, regexp in CODE_SIGNATURES.items(): matches = regexp.findall(result.output) if matches: