Use gz compression for deps archive.

It is a bit of memory waste but a lot of time win (at least
on android build)
This commit is contained in:
Matthieu Gautier 2024-08-14 14:26:44 +02:00
parent 6463307ac7
commit 5248b4eb2a
3 changed files with 9 additions and 9 deletions

View File

@ -343,10 +343,10 @@ def filter_install_dir(path):
yield sub_dir
# Full: True if we are creating a full archive to be used as cache by kiwix-build (base_deps_{os}_{config}_{base_deps_version}.tar.xz)
# Full: False if we are creating a archive to be used as pre-cached dependencies for project's CI (deps_{config}_{target}.tar.xz)
# Full: True if we are creating a full archive to be used as cache by kiwix-build (base_deps_{os}_{config}_{base_deps_version}.tar.gz)
# Full: False if we are creating a archive to be used as pre-cached dependencies for project's CI (deps_{config}_{target}.tar.gz)
def make_deps_archive(target=None, name=None, full=False):
archive_name = name or "deps_{}_{}.tar.xz".format(
archive_name = name or "deps_{}_{}.tar.gz".format(
get_dependency_archive_name(), target
)
print_message("Create archive {}.", archive_name)
@ -395,7 +395,7 @@ def make_deps_archive(target=None, name=None, full=False):
files_to_archive += SOURCE_DIR.glob("zim-testing-suite-*/*")
archive_file = TMP_DIR / archive_name
with tarfile.open(str(archive_file), "w:xz") as tar:
with tarfile.open(str(archive_file), "w:gz") as tar:
for name in set(files_to_archive):
print(".{}".format(name), flush=True)
tar.add(str(name), arcname=str(name.relative_to(relative_path)))

View File

@ -32,10 +32,10 @@ def download_base_archive(base_name):
return file_path
ARCHIVE_NAME_TEMPLATE = "base_deps_{os}_{config}_{version}.tar.xz"
ARCHIVE_NAME_TEMPLATE = "base_deps_{os}_{config}_{version}.tar.gz"
if COMPILE_CONFIG == "flatpak":
base_dep_archive_name = "base_deps_flatpak.tar.xz"
base_dep_archive_name = "base_deps_flatpak.tar.gz"
else:
base_dep_archive_name = ARCHIVE_NAME_TEMPLATE.format(
os=OS_NAME,

View File

@ -34,17 +34,17 @@ async function run() {
let archivePath;
try {
const archive_url = `${base_url}/dev_preview/${branch}/deps_${target}_${project}.tar.xz`;
const archive_url = `${base_url}/dev_preview/${branch}/deps_${target}_${project}.tar.gz`;
process.stdout.write("Downloading " + archive_url + "\n");
archivePath = await tc.downloadTool(archive_url);
} catch (error) {
const archive_url = `${base_url}/deps_${target}_${project}.tar.xz`;
const archive_url = `${base_url}/deps_${target}_${project}.tar.gz`;
process.stdout.write("Downloading " + archive_url + "\n");
archivePath = await tc.downloadTool(archive_url);
}
process.stdout.write("Extracting " + archivePath + " to " + extract_dir);
const archive_dir = await tc.extractTar(archivePath, extract_dir, "x");
const archive_dir = await tc.extractTar(archivePath, extract_dir);
process.stdout.write("Extracted to " + archive_dir);
} catch (error) {
core.setFailed(error.message);