<?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>14999</bug_id>
          
          <creation_ts>2023-01-05 09:49:44 +0000</creation_ts>
          <short_desc>devtool fails finish upgrade when gitmodules file is empty</short_desc>
          <delta_ts>2023-02-08 15:58:59 +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>5.99</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>4.2 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Thomas Roos">thomas</reporter>
          <assigned_to name="Thomas Roos">thomas</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>94616</commentid>
    <comment_count>0</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2023-01-05 09:49:44 +0000</bug_when>
    <thetext>when doing an devtool upgrade to an recipe getting it&apos;s source from git and contains an empty .gitmodules file the upgrade itself to the workspace works fine, but then devtool finish xxx xxx fails with this - probaly just a check if file is empty is enough...:

ERROR: ExpansionError during parsing /home/ubuntu/yocto/build/workspace/recipes/aws-c-common/aws-c-common_0.8.6.bb#####################################                                                                                                                                | ETA:  0:00:00
Traceback (most recent call last):
  File &quot;Var &lt;do_compile[file-checksums]&gt;&quot;, line 1, in &lt;module&gt;
  File &quot;/home/ubuntu/yocto/poky/meta/classes/externalsrc.bbclass&quot;, line 234, in srctree_hash_files(d=&lt;bb.data_smart.DataSmart object at 0x7f034de03460&gt;, srcdir=None):
                 if os.path.exists(os.path.join(s_dir, &quot;.gitmodules&quot;)):
    &gt;                submodule_helper = subprocess.check_output([&quot;git&quot;, &quot;config&quot;, &quot;--file&quot;, &quot;.gitmodules&quot;, &quot;--get-regexp&quot;, &quot;path&quot;], cwd=s_dir, env=env).decode(&quot;utf-8&quot;)
                     for line in submodule_helper.splitlines():
  File &quot;/usr/lib/python3.8/subprocess.py&quot;, line 415, in check_output(timeout=None, *popenargs=([&apos;git&apos;, &apos;config&apos;, &apos;--file&apos;, &apos;.gitmodules&apos;, &apos;--get-regexp&apos;, &apos;path&apos;],), **kwargs={&apos;cwd&apos;: &apos;/home/ubuntu/yocto/build/workspace/sources/aws-c-common&apos;, &apos;env&apos;: {&apos;SHELL&apos;: &apos;/bin/bash&apos;, &apos;BB_ENV_PASSTHROUGH_ADDITIONS&apos;: &apos;ALL_PROXY BBPATH_EXTRA BB_LOGCONFIG BB_NO_NETWORK BB_NUMBER_THREADS BB_SETSCENE_ENFORCE BB_SRCREV_POLICY DISTRO FTPS_PROXY FTP_PROXY GIT_PROXY_COMMAND HTTPS_PROXY HTTP_PROXY MACHINE NO_PROXY PARALLEL_MAKE SCREENDIR SDKMACHINE SOCKS5_PASSWD SOCKS5_USER SSH_AGENT_PID SSH_AUTH_SOCK STAMPS_DIR TCLIBC TCMODE all_proxy ftp_proxy ftps_proxy http_proxy https_proxy no_proxy &apos;, &apos;PWD&apos;: &apos;/home/ubuntu/yocto/build&apos;, &apos;LOGNAME&apos;: &apos;ubuntu&apos;, &apos;HOME&apos;: &apos;/home/ubuntu&apos;, &apos;BBPATH&apos;: &apos;/home/ubuntu/yocto/build&apos;, &apos;USER&apos;: &apos;ubuntu&apos;, &apos;PATH&apos;: &apos;/home/ubuntu/yocto/poky/scripts:/home/ubuntu/yocto/poky/bitbake/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin&apos;, &apos;LC_ALL&apos;: &apos;en_US.UTF-8&apos;, &apos;GIT_INDEX_FILE&apos;: &apos;/tmp/oe-devtool-indexn1tmjq6b&apos;}}):
     
    &gt;    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
                    **kwargs).stdout
  File &quot;/usr/lib/python3.8/subprocess.py&quot;, line 516, in run(input=None, capture_output=False, timeout=None, check=True, *popenargs=([&apos;git&apos;, &apos;config&apos;, &apos;--file&apos;, &apos;.gitmodules&apos;, &apos;--get-regexp&apos;, &apos;path&apos;],), **kwargs={&apos;stdout&apos;: -1, &apos;cwd&apos;: &apos;/home/ubuntu/yocto/build/workspace/sources/aws-c-common&apos;, &apos;env&apos;: {&apos;SHELL&apos;: &apos;/bin/bash&apos;, &apos;BB_ENV_PASSTHROUGH_ADDITIONS&apos;: &apos;ALL_PROXY BBPATH_EXTRA BB_LOGCONFIG BB_NO_NETWORK BB_NUMBER_THREADS BB_SETSCENE_ENFORCE BB_SRCREV_POLICY DISTRO FTPS_PROXY FTP_PROXY GIT_PROXY_COMMAND HTTPS_PROXY HTTP_PROXY MACHINE NO_PROXY PARALLEL_MAKE SCREENDIR SDKMACHINE SOCKS5_PASSWD SOCKS5_USER SSH_AGENT_PID SSH_AUTH_SOCK STAMPS_DIR TCLIBC TCMODE all_proxy ftp_proxy ftps_proxy http_proxy https_proxy no_proxy &apos;, &apos;PWD&apos;: &apos;/home/ubuntu/yocto/build&apos;, &apos;LOGNAME&apos;: &apos;ubuntu&apos;, &apos;HOME&apos;: &apos;/home/ubuntu&apos;, &apos;BBPATH&apos;: &apos;/home/ubuntu/yocto/build&apos;, &apos;USER&apos;: &apos;ubuntu&apos;, &apos;PATH&apos;: &apos;/home/ubuntu/yocto/poky/scripts:/home/ubuntu/yocto/poky/bitbake/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin&apos;, &apos;LC_ALL&apos;: &apos;en_US.UTF-8&apos;, &apos;GIT_INDEX_FILE&apos;: &apos;/tmp/oe-devtool-indexn1tmjq6b&apos;}}):
             if check and retcode:
    &gt;            raise CalledProcessError(retcode, process.args,
                                          output=stdout, stderr=stderr)
bb.data_smart.ExpansionError: Failure expanding variable do_compile[file-checksums], expression was ${@srctree_hash_files(d)} which triggered exception CalledProcessError: Command &apos;[&apos;git&apos;, &apos;config&apos;, &apos;--file&apos;, &apos;.gitmodules&apos;, &apos;--get-regexp&apos;, &apos;path&apos;]&apos; returned non-zero exit status 1.
The variable dependency chain for the failure is: do_compile[file-checksums]</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94621</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-01-05 15:42:06 +0000</bug_when>
    <thetext>Thomas, 
Are you able to submit a fix and a test case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94627</commentid>
    <comment_count>2</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2023-01-05 16:10:30 +0000</bug_when>
    <thetext>Hi,
will try to fix this bug next week - busy till then.
Testcase is just have an repo with an empty &quot;.gitmodules&quot; file. Then devtool finish will throw this exception...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94837</commentid>
    <comment_count>3</comment_count>
    <who name="Thomas Roos">thomas</who>
    <bug_when>2023-01-31 08:12:29 +0000</bug_when>
    <thetext>this should have been fixed by this patch: https://lore.kernel.org/openembedded-core/20230116143022.203889-1-throos@amazon.de/

I don&apos;t know why it&apos;s not merged yet?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>94905</commentid>
    <comment_count>4</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2023-02-08 15:58:59 +0000</bug_when>
    <thetext>https://git.openembedded.org/openembedded-core/commit/?id=b4f0f7c4934bade9e4d4a1086f9d8b29d8e9ad45

It&apos;s merged now. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>