<?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>13550</bug_id>
          
          <creation_ts>2019-09-25 07:44:29 +0000</creation_ts>
          <short_desc>username/password specified to gitsm:// does not get propagated to submodules</short_desc>
          <delta_ts>2023-08-03 12:41:21 +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>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>4.3 M3</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="marom">inno.test</reporter>
          <assigned_to name="Yoann Congal">yoann.congal</assigned_to>
          <cc>mark.hatle</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>yoann.congal</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>85062</commentid>
    <comment_count>0</comment_count>
      <attachid>4567</attachid>
    <who name="marom">inno.test</who>
    <bug_when>2019-09-25 07:44:29 +0000</bug_when>
    <thetext>Created attachment 4567
Path that fixes the problem for me

I have a recipe that takes the sources from git using a username/password with a line looking like this

SRC_URI = &quot;gitsm://${COMPANY_GIT_REPO}/path/to/project.git;protocol=https;user=${GIT_USER}&quot;

The project has a submodule requiring the same username/password but bitbake exits with a message like

fatal: could not read Username for &apos;https://${COMPANY_GIT_REPO}&apos;: No such device or address

The patch attached solved my problem (bitbake version 1.40.0). If a user is present it adds the parameter to submodule fetching.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>85129</commentid>
    <comment_count>1</comment_count>
    <who name="marom">inno.test</who>
    <bug_when>2019-09-30 12:04:07 +0000</bug_when>
    <thetext>I found another way to solve the problem by making the url of the submodule relative. 

So I rewrote

[submodule &quot;mysubmodule&quot;]
	path = mysubmodule
	url = https://myhost/mysubmodule.git

as

[submodule &quot;mysubmodule&quot;]
	path = mysubmodule
	url = ../mysubmodule.git

I guess that is the way things are meant to be... inherit the user/password is acceptable as long as the submodule is on the same host, which means exactly the same use case covered by the patch I submitted.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>90440</commentid>
    <comment_count>2</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2021-05-20 15:46:46 +0000</bug_when>
    <thetext>Mark, Unless you reply today, I&apos;m going to assume that you like the patch as is:

diff --git a/bitbake/lib/bb/fetch2/gitsm.py b/bitbake/lib/bb/fetch2/gitsm.py
index b21fed2669..152bdc98c4 100644
--- a/bitbake/lib/bb/fetch2/gitsm.py
+++ b/bitbake/lib/bb/fetch2/gitsm.py
@@ -130,6 +130,8 @@ class GitSM(Git):
             url += &apos;;protocol=%s&apos; % proto
             url += &quot;;name=%s&quot; % module
             url += &quot;;subpath=%s&quot; % paths[module]
+            if ud.user:
+                url += &quot;;user=%s&quot; % ud.user 
 
             ld = d.createCopy()
             # Not necessary to set SRC_URI, since we&apos;re passing the URI to

and ask Tony to submit it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91016</commentid>
    <comment_count>3</comment_count>
    <who name="Tony Tascioglu">tony.tascioglu</who>
    <bug_when>2021-07-23 16:53:05 +0000</bug_when>
    <thetext>Sorry, I lost track of this. I&apos;ll get to it as soon as I can.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96032</commentid>
    <comment_count>4</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-26 13:24:03 +0000</bug_when>
    <thetext>I&apos;ve checked :
* &quot;user=&quot; parameter of SRC_URI in indeed not passed to submodules (as of bitbake commit 64bc00a46d). Same for the gitsm://USER@... part of the URL
* The patch does fix that (I&apos;ll attach a refreshed version of the patch)

However :
* Passing password from git SRC_URI is not supported [0]
* I don&apos;t see the point supporting passing the user but not the password
* Recommended method to give a password to git SRC_URI is .netrc (for the git over http protocol)
* This .netrc config does apply for git submodules
* Using .netrc, I have no trouble having a git submodule pointing to http git URL using authentication. 

I would close this ticket since what the reporter want is supported (via the only supported method : .netrc) but I have a doubt since the observation &quot;user is not propagated to submodules&quot; is still true.

[0] : https://git.openembedded.org/bitbake/tree/lib/bb/fetch2/git.py?id=a0d8108eba8d542707740d00c66c1c5f5b963f18#n692</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96033</commentid>
    <comment_count>5</comment_count>
      <attachid>4963</attachid>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-26 14:25:23 +0000</bug_when>
    <thetext>Created attachment 4963
Refreshed patch &quot;gitsm: propagate user parameter to submodules&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96129</commentid>
    <comment_count>6</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-27 15:47:38 +0000</bug_when>
    <thetext>From bug triage meeting 2023-07-27 :
* I will send a patch commenting in the code that we don&apos;t support this (so we don&apos;t get more bugs about this)
* Then, close this bug as WONTFIX</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96143</commentid>
    <comment_count>7</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-07-28 16:29:45 +0000</bug_when>
    <thetext>&gt; * I will send a patch commenting in the code that we don&apos;t support this (so we don&apos;t get more bugs about this)

=&gt; https://lists.openembedded.org/g/bitbake-devel/message/14893</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>96174</commentid>
    <comment_count>8</comment_count>
    <who name="Yoann Congal">yoann.congal</who>
    <bug_when>2023-08-03 12:41:21 +0000</bug_when>
    <thetext>Non-support documented here : https://git.yoctoproject.org/poky/commit/?id=d8a51fd6288b54c2fe9d08a65a50e2d8cd38b91b

I close the bug I &quot;won&apos;t fix&quot; but the way to handle this is to use a .netrc file which will contain the username and the password.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>4567</attachid>
            <date>2019-09-25 07:44:29 +0000</date>
            <delta_ts>2023-07-26 14:25:23 +0000</delta_ts>
            <desc>Path that fixes the problem for me</desc>
            <filename>gitsm.diff</filename>
            <type>application/octet-stream</type>
            <size>542</size>
            <attacher name="marom">inno.test</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL2JpdGJha2UvbGliL2JiL2ZldGNoMi9naXRzbS5weSBiL2JpdGJha2UvbGli
L2JiL2ZldGNoMi9naXRzbS5weQppbmRleCBiMjFmZWQyNjY5Li4xNTJiZGM5OGM0IDEwMDY0NAot
LS0gYS9iaXRiYWtlL2xpYi9iYi9mZXRjaDIvZ2l0c20ucHkKKysrIGIvYml0YmFrZS9saWIvYmIv
ZmV0Y2gyL2dpdHNtLnB5CkBAIC0xMzAsNiArMTMwLDggQEAgY2xhc3MgR2l0U00oR2l0KToKICAg
ICAgICAgICAgIHVybCArPSAnO3Byb3RvY29sPSVzJyAlIHByb3RvCiAgICAgICAgICAgICB1cmwg
Kz0gIjtuYW1lPSVzIiAlIG1vZHVsZQogICAgICAgICAgICAgdXJsICs9ICI7c3VicGF0aD0lcyIg
JSBwYXRoc1ttb2R1bGVdCisgICAgICAgICAgICAjaWYgdWQudXNlcjoKKyAgICAgICAgICAgICMg
ICAgdXJsICs9ICI7dXNlcj0lcyIgJSB1ZC51c2VyIAogCiAgICAgICAgICAgICBsZCA9IGQuY3Jl
YXRlQ29weSgpCiAgICAgICAgICAgICAjIE5vdCBuZWNlc3NhcnkgdG8gc2V0IFNSQ19VUkksIHNp
bmNlIHdlJ3JlIHBhc3NpbmcgdGhlIFVSSSB0bwo=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>4963</attachid>
            <date>2023-07-26 14:25:23 +0000</date>
            <delta_ts>2023-07-26 14:25:23 +0000</delta_ts>
            <desc>Refreshed patch &quot;gitsm: propagate user parameter to submodules&quot;</desc>
            <filename>0001-gitsm-propagate-user-parameter-to-submodules.patch</filename>
            <type>text/plain</type>
            <size>923</size>
            <attacher name="Yoann Congal">yoann.congal</attacher>
            
              <data encoding="base64">RnJvbSAxY2NlZDk4MzAwZGNlZTc1NTE0ZjRiYWNhOTExYjNjYzI2OTJiZjRmIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBtYXJvbSA8aW5uby50ZXN0QHlhaG9vLmNvbT4KRGF0ZTogV2Vk
LCAyNiBKdWwgMjAyMyAxNToyNzoyMyArMDIwMApTdWJqZWN0OiBbUEFUQ0hdIGdpdHNtOiBwcm9w
YWdhdGUgdXNlciBwYXJhbWV0ZXIgdG8gc3VibW9kdWxlcwoKTkI6IHBhdGNoIGZpcnN0IHBvc3Rl
ZCBieSAibWFyb20iIG9uIGh0dHBzOi8vYnVnemlsbGEueW9jdG9wcm9qZWN0Lm9yZy9zaG93X2J1
Zy5jZ2k/aWQ9MTM1NTAKClNpZ25lZC1vZmYtYnk6IFlvYW5uIENvbmdhbCA8eW9hbm4uY29uZ2Fs
QHNtaWxlLmZyPgotLS0KIGxpYi9iYi9mZXRjaDIvZ2l0c20ucHkgfCAyICsrCiAxIGZpbGUgY2hh
bmdlZCwgMiBpbnNlcnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvbGliL2JiL2ZldGNoMi9naXRzbS5w
eSBiL2xpYi9iYi9mZXRjaDIvZ2l0c20ucHkKaW5kZXggZjhlMjM5YmM1Li43YTdmMGJmNTMgMTAw
NjQ0Ci0tLSBhL2xpYi9iYi9mZXRjaDIvZ2l0c20ucHkKKysrIGIvbGliL2JiL2ZldGNoMi9naXRz
bS5weQpAQCAtMTIzLDYgKzEyMyw4IEBAIGNsYXNzIEdpdFNNKEdpdCk6CiAgICAgICAgICAgICB1
cmwgKz0gIjtuYW1lPSVzIiAlIG1vZHVsZQogICAgICAgICAgICAgdXJsICs9ICI7c3VicGF0aD0l
cyIgJSBtb2R1bGUKICAgICAgICAgICAgIHVybCArPSAiO25vYnJhbmNoPTEiCisgICAgICAgICAg
ICBpZiB1ZC51c2VyOgorICAgICAgICAgICAgICAgIHVybCArPSAiO3VzZXI9JXMiICUgdWQudXNl
cgogCiAgICAgICAgICAgICBsZCA9IGQuY3JlYXRlQ29weSgpCiAgICAgICAgICAgICAjIE5vdCBu
ZWNlc3NhcnkgdG8gc2V0IFNSQ19VUkksIHNpbmNlIHdlJ3JlIHBhc3NpbmcgdGhlIFVSSSB0bwot
LSAKMi4zMC4yCgo=
</data>
<flag name="commit"
          id="15"
          type_id="4"
          status="-"
          setter="yoann.congal"
    />
          </attachment>
      

    </bug>

</bugzilla>