<?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>13636</bug_id>
          
          <creation_ts>2019-11-18 12:27:14 +0000</creation_ts>
          <short_desc>recipetool unbound variable when reproducible_build class is inherited</short_desc>
          <delta_ts>2019-11-23 14:44:24 +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>3.0</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>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>3.1 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Richard Purdie">richard.purdie</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>randy.macleod</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>85558</commentid>
    <comment_count>0</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-11-18 12:27:14 +0000</bug_when>
    <thetext>https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/481

There were a ton of failures when:

INHERIT += &quot;reproducible_build&quot;

was added. This bug covers the recipetool unbound variable selftest failures

2019-11-16 23:04:29,884 - oe-selftest - INFO - ======================================================================
2019-11-16 23:04:29,884 - oe-selftest - INFO - ERROR: recipetool.RecipetoolTests.test_recipetool_create_git_http (subunit.RemotedTestCase)
2019-11-16 23:04:29,884 - oe-selftest - INFO - ----------------------------------------------------------------------
2019-11-16 23:04:29,884 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/recipetool.py&quot;, line 503, in test_recipetool_create_git_http
    self._test_recipe_contents(recipefile, checkvars, inherits)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/devtool.py&quot;, line 182, in _test_recipe_contents
    self.assertIn(inherit, inherits, &apos;Missing inherit of %s&apos; % inherit)
UnboundLocalError: local variable &apos;inherits&apos; referenced before assignment


2019-11-16 23:04:29,884 - oe-selftest - INFO - ======================================================================
2019-11-16 23:04:29,884 - oe-selftest - INFO - ERROR: recipetool.RecipetoolTests.test_recipetool_create_github_tarball (subunit.RemotedTestCase)
2019-11-16 23:04:29,884 - oe-selftest - INFO - ----------------------------------------------------------------------
2019-11-16 23:04:29,885 - oe-selftest - INFO - testtools.testresult.real._StringException: Traceback (most recent call last):
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/recipetool.py&quot;, line 489, in test_recipetool_create_github_tarball
    self._test_recipe_contents(recipefile, checkvars, inherits)
  File &quot;/home/pokybuild/yocto-worker/oe-selftest-ubuntu/build/meta/lib/oeqa/selftest/cases/devtool.py&quot;, line 182, in _test_recipe_contents
    self.assertIn(inherit, inherits, &apos;Missing inherit of %s&apos; % inherit)
UnboundLocalError: local variable &apos;inherits&apos; referenced before assignment</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85564</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-11-18 15:19:39 +0000</bug_when>
    <thetext>diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py
index 3a25da2033b..365a57c4f53 100644
--- a/meta/lib/oeqa/selftest/cases/devtool.py
+++ b/meta/lib/oeqa/selftest/cases/devtool.py
@@ -137,6 +137,7 @@ class DevtoolBase(OESelftestTestCase):
         with open(recipefile, &apos;r&apos;) as f:
             invar = None
             invalue = None
+            inherits = set()
             for line in f:
                 var = None
                 if invar:
@@ -158,7 +159,7 @@ class DevtoolBase(OESelftestTestCase):
                         invar = var
                         continue
                 elif line.startswith(&apos;inherit &apos;):
-                    inherits = line.split()[1:]
+                    inherits.add(line.split()[1:])
 
                 if var and var in checkvars:
                     needvalue = checkvars.pop(var)

then the error becomes:

AssertionError: &apos;pkgconfig&apos; not found in set() : Missing inherit of pkgconfig</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85565</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-11-18 16:29:34 +0000</bug_when>
    <thetext>Patches on the mailing list for this issue.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85585</commentid>
    <comment_count>3</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2019-11-21 15:44:53 +0000</bug_when>
    <thetext>There is a patch in review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85614</commentid>
    <comment_count>4</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2019-11-23 14:40:27 +0000</bug_when>
    <thetext>http://git.yoctoproject.org/cgit.cgi/poky/commit/?id=d05b78b245e9a1b2743d3f649378dc3e3565b12d</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>