<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>12611</bug_id>
          
          <creation_ts>2018-03-19 06:29:14 +0000</creation_ts>
          <short_desc>opkg-build doesn&apos;t use multithreaded xz</short_desc>
          <delta_ts>2018-11-13 15:18:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>6</classification_id>
          <classification>Yocto Project Subprojects</classification>
          <product>opkg</product>
          <component>opkg</component>
          <version>0.3.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Undecided</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Alejandro del Castillo">alejandro.delcastillo</assigned_to>
          
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>79851</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2018-03-19 06:29:14 +0000</bug_when>
    <thetext>opkg-build calls &apos;xz&apos; 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&apos;m submitting to oe-core but I admit that it&apos;s ugly and shouldn&apos;t be upstreamed:

+++ b/opkg-build
@@ -230,6 +230,8 @@ if gzip --help 2&gt;&amp;1 | grep -- &quot;-T&quot; &gt; /dev/null; then
 fi
 if [ $compressor = &quot;gzip&quot; ] ; then
 	compressorargs=$zipargs
+elif [ $compressor = &quot;xz&quot; ] ; then
+	compressorargs=&quot;--threads 0&quot;
 fi</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80014</commentid>
    <comment_count>1</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2018-03-28 15:11:11 +0000</bug_when>
    <thetext>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&quot;

(we could assume that --compressor-args has to be the last parameter, or use
; as the delimiter)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82195</commentid>
    <comment_count>2</comment_count>
    <who name="Alejandro del Castillo">alejandro.delcastillo</who>
    <bug_when>2018-11-13 15:18:34 +0000</bug_when>
    <thetext>fixed on 49d32419abec4142995f3ed6f840137c8a72f3b3</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>