<?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>15943</bug_id>
          
          <creation_ts>2025-07-25 08:47:05 +0000</creation_ts>
          <short_desc>devtool upgrade fails for recipe that contains a git submodule</short_desc>
          <delta_ts>2025-12-03 08:22:07 +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>Scripts and Tools</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>CLOSED</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>5.3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tobias Pistora">pistora.tobias</reporter>
          <assigned_to name="Tobias Pistora">pistora.tobias</assigned_to>
          <cc>richard.purdie</cc>
    
    <cc>ross.burton</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>102514</commentid>
    <comment_count>0</comment_count>
      <attachid>5127</attachid>
    <who name="Tobias Pistora">pistora.tobias</who>
    <bug_when>2025-07-25 08:47:05 +0000</bug_when>
    <thetext>Created attachment 5127
My bugfix based on yocto-5.0.8

The devtool upgrade command fails while it goes through a git submodule directory. It happens when devtool executes &apos;git rev-list devtool-base..&lt;submodule commit hash&gt;&apos;. The debug log shows that &apos;git rev-list&apos; is called from parent directory but with the commit hash of the submodule which does not exist there (&quot;amqp-proxy&quot; is the parent git repo and &quot;contracts&quot; the submodule):

-- snipped --
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git fetch
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git checkout 35b87c6723cf5afbee0cf02c7447eb8c833185af
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git tag -f devtool-base-new
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git submodule update --recursive
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git submodule foreach &apos;git tag -f devtool-base-new&apos;
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git submodule --quiet foreach &apos;echo $sm_path&apos;
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git branch -r --contains 35b87c6723cf5afbee0cf02c7447eb8c833185af
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git rev-parse HEAD
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy/contracts&gt; git rev-parse HEAD
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git checkout devtool-patched -b devtool
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git branch --list devtool-override-*
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git rev-list devtool-base..35b87c6723cf5afbee0cf02c7447eb8c833185af
INFO: Rebasing devtool onto 35b87c6723cf5afbee0cf02c7447eb8c833185af
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git checkout devtool
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git rebase 35b87c6723cf5afbee0cf02c7447eb8c833185af
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git rev-list devtool-base..35b87c6723cf5afbee0cf02c7447eb8c833185af
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git checkout devtool
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy/contracts&gt; git checkout devtool-patched -b devtool
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy/contracts&gt; git branch --list devtool-override-*
DEBUG: Running command &lt;build_path&gt;/workspace/sources/amqp-proxy&gt; git rev-list devtool-base..90727cda36bab25fb106fc100e5a6177467f5456
ERROR: Execution of &apos;git rev-list devtool-base..90727cda36bab25fb106fc100e5a6177467f5456&apos; failed with exit code 128:
fatal: Invalid revision range devtool-base..90727cda36bab25fb106fc100e5a6177467f5456
-- snipped end --

The full command that was executed for this output is &apos;command: devtool -d upgrade amqp-proxy&apos;. The related recipe uses &quot;gitsm://&quot; for fetching the code.

After inspecting the related code in &apos;poky/scripts/lib/devtool/upgrade.py&apos; I have found a working fix for me. See attached patch, based on yocto 5.0.8. Hope this helps.

Conclusion: Is seems that the path argument is missing when running the &apos;git rev-list&apos; calls from submodule directories.
However, because I have found the same (unfixed) code in master branch and have not found a bug report for this issue yet (the affected code was add around a year ago), I am not sure if the implementation is intended and I am somehow terribly wrong with what I am doing...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102533</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2025-07-31 14:40:23 +0000</bug_when>
    <thetext>&quot;oe-selftest -r devtool&quot; has a lot of selftests for devtool. Would you be able to write a test case which covers this scenario? If so, at a quick glance, I think your patch seems reasonable and you could send that for review too?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>102538</commentid>
    <comment_count>2</comment_count>
    <who name="Tobias Pistora">pistora.tobias</who>
    <bug_when>2025-08-01 08:30:36 +0000</bug_when>
    <thetext>(In reply to Richard Purdie from comment #1)
&gt; &quot;oe-selftest -r devtool&quot; has a lot of selftests for devtool. Would you be
&gt; able to write a test case which covers this scenario?
I think so... After a quick glance inside the test code I got an idea where to look next^^. However, it may take a while but I will get used to it.

&gt; If so, at a quick
&gt; glance, I think your patch seems reasonable and you could send that for
&gt; review too?
Sure, I will do that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103466</commentid>
    <comment_count>3</comment_count>
    <who name="Tobias Pistora">pistora.tobias</who>
    <bug_when>2025-12-03 08:17:03 +0000</bug_when>
    <thetext>Fixed in 4c7b0007327d592b8f5d1f50ebb0325dc483bd87 (https://git.yoctoproject.org/poky/commit/?id=4c7b0007327d592b8f5d1f50ebb0325dc483bd87)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103467</commentid>
    <comment_count>4</comment_count>
    <who name="Tobias Pistora">pistora.tobias</who>
    <bug_when>2025-12-03 08:20:51 +0000</bug_when>
    <thetext>The requested test case can be found in 	921faf324658371193b1f0847ebc1912d7fef25d (https://git.yoctoproject.org/poky/commit/?id=921faf324658371193b1f0847ebc1912d7fef25d)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103468</commentid>
    <comment_count>5</comment_count>
    <who name="Tobias Pistora">pistora.tobias</who>
    <bug_when>2025-12-03 08:22:07 +0000</bug_when>
    <thetext>fixed</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>5127</attachid>
            <date>2025-07-25 08:47:05 +0000</date>
            <delta_ts>2025-07-25 08:47:05 +0000</delta_ts>
            <desc>My bugfix based on yocto-5.0.8</desc>
            <filename>fix-devtool-bug-that-brakes-upgrade-for-recipes-with-submodule.patch</filename>
            <type>application/mbox</type>
            <size>1886</size>
            <attacher name="Tobias Pistora">pistora.tobias</attacher>
            
              <data encoding="base64">RnJvbSAzZDJlMTc2YjNhMGJmNzBmNmI4Mjk1MWM1Yzg5ZWVlZTljOWE2YjUyIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBUb2JpYXMgUGlzdG9yYSA8dC5waXN0b3JhQHNjaHJhY2stc2Vj
b25ldC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ldF9icmFuY2gsIGN3ZD1wYXRoKQogICAgICAgICAg
ICAgZm9yIHJldiBpbiBzdGRvdXQuc3BsaXRsaW5lcygpOgogICAgICAgICAgICAgICAgIG9lLnBh
dGNoLkdpdEFwcGx5VHJlZS5yZW1vdmVOb3RlKHBhdGgsIHJldiwgImR1bW15IikKIAotLSAKMi4z
OS41Cgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>