diff --git a/CHANGELOG.md b/CHANGELOG.md index 802774f7..fedb7ae2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - improved how missing dependencies are checked when installing a new package ( the old way was not identifying some missing dependencies of **anbox-git** ). It is possible to use the old algorithm by setting **simple_checking** to **true** in **~/.config/bauh/arch.yml**. More information at [README](https://github.com/vinifmor/bauh/#aur--arch-). - checking architecture dependencies (x86_64, i686) - architecture dependencies are displayed on the info window as well + - optimizations to speed up zst packages building - Web: - separate temp build folder for standard and root users - UI: diff --git a/README.md b/README.md index dc06ea77..b55fcd39 100644 --- a/README.md +++ b/README.md @@ -154,7 +154,7 @@ db_updater: then a copy of **/etc/makepkg.conf** will be generated at **~/.config/bauh/arch/makepkg.conf** defining MAKEFLAGS to work with the number of your machine processors (**-j${nproc}**). - b) same as previous, but related to **COMPRESSXZ** definition ( if '--threads=0' is not defined ) + b) same as previous, but related to **COMPRESSXZ** and **COMPRESSZST** definitions ( if '--threads=0' is not defined ) c) **ccache** will be added to **BUILDENV** if it is installed on the system and already not defined diff --git a/bauh/gems/arch/worker.py b/bauh/gems/arch/worker.py index 24ade860..029ac9a1 100644 --- a/bauh/gems/arch/worker.py +++ b/bauh/gems/arch/worker.py @@ -76,6 +76,7 @@ class ArchCompilationOptimizer(Thread): super(ArchCompilationOptimizer, self).__init__(daemon=True) self.logger = logger self.re_compress_xz = re.compile(r'#?\s*COMPRESSXZ\s*=\s*.+') + self.re_compress_zst = re.compile(r'#?\s*COMPRESSZST\s*=\s*.+') self.re_build_env = re.compile(r'\s+BUILDENV\s*=.+') self.re_ccache = re.compile(r'!?ccache') @@ -127,6 +128,19 @@ class ArchCompilationOptimizer(Thread): else: optimizations.append('COMPRESSXZ=(xz -c -z - --threads=0)') + compress_zst = self.re_compress_zst.findall(custom_makepkg or global_makepkg) + + if compress_zst: + not_eligible = [f for f in compress_zst if not f.startswith('#') and '--threads' in f] + + if not not_eligible: + custom_makepkg = self.re_compress_zst.sub('', custom_makepkg or global_makepkg) + optimizations.append('COMPRESSZST=(zstd -c -z -q - --threads=0)') + else: + self.logger.warning("It seems '{}' COMPRESSZST is already customized".format(GLOBAL_MAKEPKG)) + else: + optimizations.append('COMPRESSZST=(zstd -c -z -q - --threads=0)') + build_envs = self.re_build_env.findall(custom_makepkg or global_makepkg) if build_envs: