Bug 12611 - opkg-build doesn't use multithreaded xz
Summary: opkg-build doesn't use multithreaded xz
Status: RESOLVED FIXED
Alias: None
Product: opkg
Classification: Yocto Project Subprojects
Component: opkg (show other bugs)
Version: 0.3.6
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Alejandro del Castillo
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2018-03-19 06:29 UTC by Ross Burton
Modified: 2018-11-13 15:18 UTC (History)
0 users

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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