[Improvement] Disabling xz compression step to save build time
Closed this issue · 3 comments
CaseOf commented
It would be nice if we could find a way to disable the xz compression at the install step since we are extracting it just after.
Replacing it with a simple copy of files would fit our need.
@wolfbeast What is your opinion on this?
CaseOf commented
It is not necessarily something to be merged on upstream repository, we can just configure our build to avoid compression.
jeandestouches commented
Here is a patch, to replace xz with plain tar (with modification needed to extraction in ebuild)
xz compression took 29min on my 10 years old cpu, now with tar, well.. 3 seconds. (tmpfs)
Of course, best would be to entirely skip package creation.
---
platform/system/packager/base.mk | 4 ++--
platform/system/packager/packager.mk | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/platform/system/packager/base.mk b/platform/system/packager/base.mk
index b475f6ed1..b12d77a82 100644
--- a/platform/system/packager/base.mk
+++ b/platform/system/packager/base.mk
@@ -243,8 +243,8 @@ PKG_INSTALLER_FILENAME = $(PKG_BASENAME).installer.exe
PKG_GENERIC_OS = windows
else
# Archiver command and filename for not-windows target operating systems
-PKG_ARCHIVER_CMD = $(TAR) cfJv
-PKG_ARCHIVE_FILENAME = $(PKG_BASENAME).tar.xz
+PKG_ARCHIVER_CMD = $(TAR) cfv
+PKG_ARCHIVE_FILENAME = $(PKG_BASENAME).tar
# Generic OS name when specifics aren't as important
PKG_GENERIC_OS = unix
diff --git a/platform/system/packager/packager.mk b/platform/system/packager/packager.mk
index 22097fff3..f6275b378 100644
--- a/platform/system/packager/packager.mk
+++ b/platform/system/packager/packager.mk
@@ -88,7 +88,7 @@ archive: stage-package
ifeq ($(OS_ARCH),WINNT)
cd $(DIST); $(CYGWIN_WRAPPER) $(PKG_ARCHIVER_CMD) $(PKG_ARCHIVE_FILENAME) $(PKG_STAGE_DIR)
else
- cd $(DIST); XZ_OPT=-9e $(PKG_ARCHIVER_CMD) $(PKG_ARCHIVE_FILENAME) $(PKG_STAGE_DIR)
+ cd $(DIST); $(PKG_ARCHIVER_CMD) $(PKG_ARCHIVE_FILENAME) $(PKG_STAGE_DIR)
endif
# ---------------------------------------------------------------------------------------------------------------------
--
2.34.1
-rw-r--r-- 1 root root 2,1G 19 mars 19:28 palemoon-30.0.0.linux-x86_64.tar
>>> Completed installing www-client/palemoon-30.0.0 into /var/tmp/portage/www-client/palemoon-30.0.0/image/
* Final size of build directory: 12905756 KiB (12.3 GiB)
* Final size of installed tree: 2171440 KiB ( 2.0 GiB)
Sat Mar 19 08:03:33 2022 >>> www-client/palemoon-30.0.0
merge time: 1 hour, 51 minutes and 57 seconds.
Sat Mar 19 19:29:11 2022 >>> www-client/palemoon-30.0.0
merge time: 1 hour, 22 minutes and 38 seconds.
CaseOf commented
I did push a commit for this.