<?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>7142</bug_id>
          
          <creation_ts>2015-01-14 14:50:35 +0000</creation_ts>
          <short_desc>cmake.bbclass fails when rebuilding after MACHINE changes</short_desc>
          <delta_ts>2022-01-07 20:38:53 +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.8</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>Medium</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.3 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ross Burton">ross.burton</reporter>
          <assigned_to name="Ross Burton">ross.burton</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
          
          
          <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>47907</commentid>
    <comment_count>0</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2015-01-14 14:50:35 +0000</bug_when>
    <thetext>If I do this:

MACHINE=foo bitbake midori
wipe-sysroot
MACHINE=bar bitbake midori

The compile for bar fails because it is using the foo sysroot (which doesn&apos;t exist).  This is because the generated toolchain.cmake has absolute paths to the sysroot in, and doesn&apos;t get re-generated when MACHINE changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>47941</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2015-01-15 15:47:01 +0000</bug_when>
    <thetext>I believe the issue here is part of a larger issue for example:

MACHINE=A bitbake perl -c configure
MACHINE=B bitbake perl -c compile

can also have interestig failures since the configure hardcodes  paths to the MACHINE A sysroot, then we move to MACHINE B, some paths change and some paths do not.

The best idea I can come up with to fix this is to make the WORKDIR consistent per machine. To do this we&apos;d change MULTIMACH_TARGET_SYS and MULTIMACH_HOST_SYS to include MACHINE_ARCH instead of PACKAGE_ARCH.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67293</commentid>
    <comment_count>2</comment_count>
    <who name="Alexander Kanavin">alex.kanavin</who>
    <bug_when>2016-10-17 13:57:37 +0000</bug_when>
    <thetext>So if this is not a cmake specific issue, and needs to be sorted at the bitbake level, should I reassign to RP?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69322</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-12-22 16:14:52 +0000</bug_when>
    <thetext>Recipe specific sysroots are probably going to be the best way to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69352</commentid>
    <comment_count>4</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-12-22 21:52:46 +0000</bug_when>
    <thetext>So the greater context that I didn&apos;t write down was that MACHINE foo and MACHINE bar were both identical tunes, so the work directory could be reused.  Why this didn&apos;t mean that the toolchain generation task didn&apos;t rerun is beyond me.

Recipe specific sysroots may well solve this anyway.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69353</commentid>
    <comment_count>5</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-12-22 22:27:59 +0000</bug_when>
    <thetext>So the only way I can replicate this is by copying qemuarm to qemuarm-copy and then

$ MACHINE=qemuarm bitbake libical
$ wipe-sysroot
$ MACHINE=qemuarm-copy bitbake libical -C compile

You need to taint it otherwise it won&apos;t try and rebuild as the tunes match.  If the tunes didn&apos;t match it wouldn&apos;t rebuilding...

To be honest I&apos;m really tempted to call this user error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>70186</commentid>
    <comment_count>6</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2017-01-26 16:21:40 +0000</bug_when>
    <thetext>I *think* recipe-specific sysroots makes this moot.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>