From ffc9c1b6404df15f951a2dda8fb591ef0ac0c57e Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 6 Feb 2019 11:03:55 +0100 Subject: [PATCH 1/2] [TRAVIS] Use xz compression to create the deps archives. --- travis/compile_all.py | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/travis/compile_all.py b/travis/compile_all.py index d97c214..bf45e2b 100755 --- a/travis/compile_all.py +++ b/travis/compile_all.py @@ -183,7 +183,7 @@ def make_archive(project, platform): def make_deps_archive(target, full=False): - archive_name = "deps_{}_{}_{}.tar.gz".format( + archive_name = "deps_{}_{}_{}.tar.xz".format( TRAVIS_OS_NAME, PLATFORM, target) print_message("Create archive {}.", archive_name) files_to_archive = [BASE_DIR/'INSTALL'] @@ -220,13 +220,9 @@ def make_deps_archive(target, full=False): base_deps_versions['pugixml'])) files_to_archive += HOME.glob('**/TOOLCHAINS') - counter = 50 - with tarfile.open(str(relative_path/archive_name), 'w:gz') as tar: + with tarfile.open(str(relative_path/archive_name), 'w:xz') as tar: for name in set(files_to_archive): - counter -= 1 - if not counter: - print('.', end='', flush=True) - counter = 50 + print('.', end='', flush=True) tar.add(str(name), arcname=str(name.relative_to(relative_path))) return relative_path/archive_name @@ -261,13 +257,13 @@ def download_base_archive(base_name): batch = resource.read(batch_size) if not batch: break - print(".", end="") + print(".", end="", flush=True) file.write(batch) return file_path if PLATFORM != 'flatpak': # The first thing we need to do is to (potentially) download already compiled base dependencies. - base_dep_archive_name = "base_deps_{os}_{platform}_{version}.tar.gz".format( + base_dep_archive_name = "base_deps_{os}_{platform}_{version}.tar.xz".format( os=TRAVIS_OS_NAME, platform=PLATFORM, version=base_deps_meta_version) @@ -281,7 +277,7 @@ if PLATFORM != 'flatpak': print_message("Cannot get archive. Build dependencies") if PLATFORM == 'android': for arch in ('arm', 'arm64', 'x86', 'x86_64'): - archive_name = "base_deps_{os}_android_{arch}_{version}.tar.gz".format( + archive_name = "base_deps_{os}_android_{arch}_{version}.tar.xz".format( os=TRAVIS_OS_NAME, arch=arch, version=base_deps_meta_version) From 77fc6704ef9c9b59993fd923fde36ce319ae6ba7 Mon Sep 17 00:00:00 2001 From: Matthieu Gautier Date: Wed, 6 Feb 2019 16:04:35 +0100 Subject: [PATCH 2/2] Do not save the `tools` directory of the toolchains. This directory came from the source and is only used to install the sdk. As the sdk is already installed, we don't need it (and we can save 400Mo) --- travis/compile_all.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/travis/compile_all.py b/travis/compile_all.py index bf45e2b..51d71b4 100755 --- a/travis/compile_all.py +++ b/travis/compile_all.py @@ -218,7 +218,10 @@ def make_deps_archive(target, full=False): base_deps_versions['pugixml'])] files_to_archive += HOME.glob('BUILD_*/pugixml-{}'.format( base_deps_versions['pugixml'])) - files_to_archive += HOME.glob('**/TOOLCHAINS') + toolchains_subdirs = HOME.glob('**/TOOLCHAINS/*/*') + for subdir in toolchains_subdirs: + if not subdir.match('tools'): + files_to_archive.append(subdir) with tarfile.open(str(relative_path/archive_name), 'w:xz') as tar: for name in set(files_to_archive):