<?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>5706</bug_id>
          
          <creation_ts>2014-01-07 12:01:41 +0000</creation_ts>
          <short_desc>automake upgrade leads to build failures for alsa-tools</short_desc>
          <delta_ts>2014-09-22 14:35:02 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>devtools / tool chain</component>
          <version>1.6</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>1.6 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Stephan Bauroth">der_steffi</reporter>
          <assigned_to name="Robert Yang">liezhi.yang</assigned_to>
          <cc>alexandru.c.georgescu</cc>
    
    <cc>andrax.g.necula</cc>
    
    <cc>der_steffi</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
          
          <qa_contact name="Alexandru Georgescu">alexandru.c.georgescu</qa_contact>
          <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>39675</commentid>
    <comment_count>0</comment_count>
      <attachid>1706</attachid>
    <who name="Stephan Bauroth">der_steffi</who>
    <bug_when>2014-01-07 12:01:41 +0000</bug_when>
    <thetext>Created attachment 1706
compile log

in alsa-tools-$PN.bb we configure automake for cross compiling with
&apos;export AUTOMAKE_DIR=${STAGING_DATADIR_NATIVE}/$(ls ${STAGING_DATADIR_NATIVE} | grep automake)&apos;

in which the grep can return a multi-line value, if multiple version of automake are present in STAGING_DATADIR_NATIVE, for example after an upgrade of automake. this breaks compilation.

suggested solution: pipe the value of grep into tail -n1 to only take the newest version of automake:

export AUTOMAKE_DIR=${STAGING_DATADIR_NATIVE}/$(ls ${STAGING_DATADIR_NATIVE} | grep automake | tail -n1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39676</commentid>
    <comment_count>1</comment_count>
    <who name="Stephan Bauroth">der_steffi</who>
    <bug_when>2014-01-07 12:06:45 +0000</bug_when>
    <thetext>to be complete:

git-rev:
master:18d486c58a55d91c56678d5355958d7a2c7fd1e9</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39765</commentid>
    <comment_count>2</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-01-13 10:20:25 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; Created attachment 1706 [details]
&gt; compile log
&gt; 
&gt; in alsa-tools-$PN.bb we configure automake for cross compiling with
&gt; &apos;export AUTOMAKE_DIR=${STAGING_DATADIR_NATIVE}/$(ls
&gt; ${STAGING_DATADIR_NATIVE} | grep automake)&apos;
&gt; 
&gt; in which the grep can return a multi-line value, if multiple version of
&gt; automake are present in STAGING_DATADIR_NATIVE, for example after an upgrade
&gt; of automake. this breaks compilation.
&gt; 
&gt; suggested solution: pipe the value of grep into tail -n1 to only take the
&gt; newest version of automake:
&gt; 
&gt; export AUTOMAKE_DIR=${STAGING_DATADIR_NATIVE}/$(ls ${STAGING_DATADIR_NATIVE}
&gt; | grep automake | tail -n1)

Hi, thanks for reporting this, I had upgraded automake from 1.13 to automake, according to your descriptions, there are both automake-1.13 and automake-1.14 under ${STAGING_DATADIR_NATIVE}, but that should not happen in theory,, since the automake-1.13&apos;s files in the STAGING_DATADIR_NATIVE will be removed automatically when we build the automake-1.14. I have also reverted the upgrade and run &quot;bitbake alsao-tools&quot;, then upgrade to automake-1.14 and build alsa-tools again, but can&apos;t reproduce the problem, so mark it as NI, though, I think that you have showed enough info.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39766</commentid>
    <comment_count>3</comment_count>
    <who name="Stephan Bauroth">der_steffi</who>
    <bug_when>2014-01-13 11:14:16 +0000</bug_when>
    <thetext>That seems fairly conclusive. I was wondered to see that automake-1.13 files weren&apos;t deleted during upgrade and can&apos;t say why. Infact, for me, they stayed. I will revert later on and see if I can examine that closer. Question is, can we 100%-ly garantuee there will be only one folder automake-* in $STAGING_DATADIR_NATIVE at any time? I&apos;m not that into the toolchain, but if the sysroot is always cleared of old versions, the alsa-tools recipe is fine the way it is, and I have to determine, why the folder haven&apos;t got removed in my case...

But if things like that can happen, or simply to be more robust, the grep is quite unsafe. Maybe we can catch this case and raise a warning like:

$AUTOMAKE_DIR = $(ls ${STAGING_DATADIR_NATIVE} | grep automake);
if[ `wc -l &lt; $AUTOMAKE_DIR` &gt; 1 ]
bbwarn(&quot;multiple versions of automake present, choosing latest&quot;);
$AUTOMAKE_DIR = echo $AUTOMAKE_DIR | tail -n1
fi
export $AUTOMAKE_DIR=${STAGING_DATADIR_NATIVE}/$AUTOMAKE_DIR


Sorry for Syntax errors, I&apos;m not thaaaat into bash :)

I&apos;ll anyway report wether i was able to reproduce the error and investigate, why automake-1.13 wasn&apos;t removed from sysroot.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39768</commentid>
    <comment_count>4</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-01-13 12:39:21 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; That seems fairly conclusive. I was wondered to see that automake-1.13 files
&gt; weren&apos;t deleted during upgrade and can&apos;t say why. Infact, for me, they
&gt; stayed. I will revert later on and see if I can examine that closer.

Thanks.

&gt; Question is, can we 100%-ly garantuee there will be only one folder
&gt; automake-* in $STAGING_DATADIR_NATIVE at any time? I&apos;m not that into the
&gt; toolchain, but if the sysroot is always cleared of old versions, the
&gt; alsa-tools recipe is fine the way it is, and I have to determine, why the
&gt; folder haven&apos;t got removed in my case...
&gt; 
&gt; But if things like that can happen, or simply to be more robust, the grep is
&gt; quite unsafe. Maybe we can catch this case and raise a warning like:
&gt; 
&gt; $AUTOMAKE_DIR = $(ls ${STAGING_DATADIR_NATIVE} | grep automake);
&gt; if[ `wc -l &lt; $AUTOMAKE_DIR` &gt; 1 ]
&gt; bbwarn(&quot;multiple versions of automake present, choosing latest&quot;);
&gt; $AUTOMAKE_DIR = echo $AUTOMAKE_DIR | tail -n1
&gt; fi
&gt; export $AUTOMAKE_DIR=${STAGING_DATADIR_NATIVE}/$AUTOMAKE_DIR
&gt; 

Yes, it is a good idea, but it has other problems, alsa-tools&apos; do_configure doesn&apos;t work, I think that it&apos;s do_configure should be &quot;make configure&quot;, but currently it is:

do_configure () {
    autotools_do_configure
    autotools_copy_aclocal
}

I need do more investigation to see if we can fix both the do_configue and automake issue.

&gt; 
&gt; Sorry for Syntax errors, I&apos;m not thaaaat into bash :)
&gt; 
&gt; I&apos;ll anyway report wether i was able to reproduce the error and investigate,
&gt; why automake-1.13 wasn&apos;t removed from sysroot.

Thanks, that would be great.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39771</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-01-13 14:16:48 +0000</bug_when>
    <thetext>After more investigations, the:

do_configure () {
    autotools_do_configure
    autotools_copy_aclocal
}

is for the ACLOCAL_FLAGS, so it is ok, and the following patch will fix your concern, I will send it to the mailing list later:

Subject: [PATCH] alsa-tools: fix the AUTOMAKE_DIR

There should be only one automake under the STAGING_DATADIR_NATIVE in
theory, but der_steffi@gmx.de has reported an odd problem which seemed
like that there are more than one. However, the &quot;automake
--print-libdir&quot; is the regular way to locate automake libdir.

[YOCTO #5706]

Reported-by: der_steffi@gmx.de
Signed-off-by: Robert Yang &lt;liezhi.yang@windriver.com&gt;
---
 meta/recipes-multimedia/alsa/alsa-tools_1.0.26.1.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-multimedia/alsa/alsa-tools_1.0.26.1.bb b/meta/recipes-multimedia/alsa/alsa-tools_1.0.26.1.bb
index c3b97a3..5b0f6ae 100644
--- a/meta/recipes-multimedia/alsa/alsa-tools_1.0.26.1.bb
+++ b/meta/recipes-multimedia/alsa/alsa-tools_1.0.26.1.bb
@@ -32,7 +32,7 @@ do_configure () {
 
 do_compile_prepend () {
     #Automake dir is not correctly detected in cross compilation case
-    export AUTOMAKE_DIR=${STAGING_DATADIR_NATIVE}/$(ls ${STAGING_DATADIR_NATIVE} | grep automake)
+    export AUTOMAKE_DIR=&quot;$(automake --print-libdir)&quot;
     export ACLOCAL_FLAGS=&quot;--system-acdir=${ACLOCALDIR}/&quot;
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>39847</commentid>
    <comment_count>6</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2014-01-16 01:55:27 +0000</bug_when>
    <thetext>Merged into master:

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=5ccdc914126e2408519bd9cae9dec20066a3033e</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45744</commentid>
    <comment_count>7</comment_count>
    <who name="Andra Necula">andrax.g.necula</who>
    <bug_when>2014-09-22 14:35:02 +0000</bug_when>
    <thetext>Verified. I can&apos;t reproduce the issue in poky a44006262cf3b810ec78b4cccd8076102a7a0f3e.
host Ubuntu 14.04 x86_64.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>1706</attachid>
            <date>2014-01-07 12:01:41 +0000</date>
            <delta_ts>2014-01-07 12:01:41 +0000</delta_ts>
            <desc>compile log</desc>
            <filename>log.do_compile.18343</filename>
            <type>application/octet-stream</type>
            <size>579</size>
            <attacher name="Stephan Bauroth">der_steffi</attacher>
            
              <data encoding="base64">REVCVUc6IFNJVEUgZmlsZXMgWydlbmRpYW4tbGl0dGxlJywgJ2JpdC0zMicsICdhcm0tY29tbW9u
JywgJ2NvbW1vbi1saW51eCcsICdjb21tb24tZ2xpYmMnLCAnYXJtLWxpbnV4JywgJ2FybS1saW51
eC1nbnVlYWJpJywgJ2NvbW1vbiddCkRFQlVHOiBFeGVjdXRpbmcgc2hlbGwgZnVuY3Rpb24gZG9f
Y29tcGlsZQovbWVkaWEvc3RlcGhhbi9idWlsZHMvYnVpbGQvdG1wL3dvcmsvY29ydGV4YTloZi12
ZnAtbmVvbi1wb2t5LWxpbnV4LWdudWVhYmkvYWxzYS10b29scy8xLjAuMjYuMS1yMS90ZW1wL3J1
bi5kb19jb21waWxlLjE4MzQzOiAxMTA6IGV4cG9ydDogYXV0b21ha2UtMS4xNDogYmFkIHZhcmlh
YmxlIG5hbWUKV0FSTklORzogZXhpdCBjb2RlIDIgZnJvbSBhIHNoZWxsIGNvbW1hbmQuCkVSUk9S
OiBGdW5jdGlvbiBmYWlsZWQ6IGRvX2NvbXBpbGUgKGxvZyBmaWxlIGlzIGxvY2F0ZWQgYXQgL21l
ZGlhL3N0ZXBoYW4vYnVpbGRzL2J1aWxkL3RtcC93b3JrL2NvcnRleGE5aGYtdmZwLW5lb24tcG9r
eS1saW51eC1nbnVlYWJpL2Fsc2EtdG9vbHMvMS4wLjI2LjEtcjEvdGVtcC9sb2cuZG9fY29tcGls
ZS4xODM0MykK
</data>

          </attachment>
      

    </bug>

</bugzilla>