<?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>15480</bug_id>
          
          <creation_ts>2024-05-10 10:13:42 +0000</creation_ts>
          <short_desc>vardepsexclude doesn&apos;t work when the value is used in d.setVar</short_desc>
          <delta_ts>2026-05-21 15:13:12 +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>BitBake</product>
          <component>bitbake</component>
          <version>5.1</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard> </status_whiteboard>
          <keywords></keywords>
          <priority>Low</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Martin Jansa">Martin.Jansa</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>98992</commentid>
    <comment_count>0</comment_count>
    <who name="Martin Jansa">Martin.Jansa</who>
    <bug_when>2024-05-10 10:13:42 +0000</bug_when>
    <thetext>I&apos;ve noticed this behavior with externalsrc.bbclass which does:
d.setVar(&apos;S&apos;, externalsrc)
in https://git.openembedded.org/openembedded-core/tree/meta/classes/externalsrc.bbclass#n60

If the externalsrc is set from EXTERNALSRC defined as:

inherit externalsrc
EXTERNALSRC = &quot;${TOPDIR}/shit/bsp&quot;
EXTERNALSRC[vardepsexclude] += &quot;TOPDIR&quot;

Then comparing signatures from 2 builds with TOPDIR kirkstone-official2 and kirkstone-official3:

$ bitbake-diffsigs BUILD/sstate-diff[23]/externalsrc-topdir-shit-bsp-exclude/*/*/key*/*do_deploy_source*
basehash changed from f76d3261854f98ba1ebbea7eba7c2304f35fffaac39b1374c6907a1ac79d79d5 to 01f3f898bb59327fbf3620deebc6d6c6e5e1a1eb874813f3bf66c3eeab7c2308
Variable S value changed from &apos;/kirkstone-official2/shit/bsp&apos; to &apos;/kirkstone-official3/shit/bsp&apos;

Which is the same as without the vardepsexclude as in:

inherit externalsrc
EXTERNALSRC = &quot;${TOPDIR}/shit/bsp&quot;

$ bitbake-diffsigs BUILD/sstate-diff[23]/externalsrc-topdir-shit-bsp/*/*/key*/*do_deploy_source*
basehash changed from f76d3261854f98ba1ebbea7eba7c2304f35fffaac39b1374c6907a1ac79d79d5 to 01f3f898bb59327fbf3620deebc6d6c6e5e1a1eb874813f3bf66c3eeab7c2308
Variable S value changed from &apos;kirkstone-official2/shit/bsp&apos; to &apos;kirkstone-official3/shit/bsp&apos;

while this is obviously fine:
inherit externalsrc
EXTERNALSRC = &quot;/shit/bsp&quot;

$ bitbake-diffsigs BUILD/sstate-diff[23]/externalsrc-shit-bsp/*/*/key*/*do_deploy_source*
$

I know that externalsrc is intended for fast local incremental builds and has many disadvantages compared to bitbake correctly fetching, tracking and maintaining the sources in S.

That it isn&apos;t mean to be used like this, in builds executed on different servers which might use different TOPDIR, but want to share sstate between the builds.

This is used by BSP from 3rd party where they maintain sources outside the metadata with &quot;repo&quot; and the recipes are then just pointing EXTERNALSRC to various directories inside this &quot;repo&quot; checkout.

I&apos;ve already suggested not to use this BSP or ask the vendor not to use this, but it probably won&apos;t happen and this issue might be interesting in other cases than externalsrc as well.

In the meantime I&apos;ve also suggested to at least to write a &quot;migration&quot; script which will convert the repo manifest into a list of SRC_URI/SRCREV overrides for recipes which were using EXTERNALSRC, so that when 3rd party updates the layers and repo, we can more easily refresh the revisions for new version.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99012</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2024-05-16 14:32:57 +0000</bug_when>
    <thetext>The issue is that setVar clears flags. it does this for a number of reasons but is effectively the defined behaviour and we&apos;d have trouble changing it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>99013</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2024-05-16 14:36:03 +0000</bug_when>
    <thetext>Not really a bug according to Richard but maybe have a different opinion and and idea of how we could fix this.
-- YP Bug Review</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>