Bug 12611

Summary: opkg-build doesn't use multithreaded xz
Product: [Yocto Project Subprojects] opkg Reporter: Ross Burton <ross.burton>
Component: opkgAssignee: Alejandro del Castillo <alejandro.delcastillo>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided    
Version: 0.3.6   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Ross Burton 2018-03-19 06:29:14 UTC
opkg-build calls 'xz' which  is single-threaded.

By passing --threads=0 it will use N threads where N is the number of cores.

This changes qemu:do_package_ipk from 270s to 30s on my build machine.

I have this patch that I'm submitting to oe-core but I admit that it's ugly and shouldn't be upstreamed:

+++ b/opkg-build
@@ -230,6 +230,8 @@ if gzip --help 2>&1 | grep -- "-T" > /dev/null; then
 fi
 if [ $compressor = "gzip" ] ; then
 	compressorargs=$zipargs
+elif [ $compressor = "xz" ] ; then
+	compressorargs="--threads 0"
 fi
Comment 1 Alejandro del Castillo 2018-03-28 15:11:11 UTC
from e-mail thread:


what about a generic --compressor-args option? opkg-build could have some
sane defaults that always apply (like it does now), then if
--compressor-args is set, it would override those. For xz, it would look
like this:

 opkg-build -Z xz --compressor-args -T0"

(we could assume that --compressor-args has to be the last parameter, or use
; as the delimiter)
Comment 2 Alejandro del Castillo 2018-11-13 15:18:34 UTC
fixed on 49d32419abec4142995f3ed6f840137c8a72f3b3