Created attachment 4567 [details] 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 = "gitsm://${COMPANY_GIT_REPO}/path/to/project.git;protocol=https;user=${GIT_USER}" The project has a submodule requiring the same username/password but bitbake exits with a message like fatal: could not read Username for 'https://${COMPANY_GIT_REPO}': 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.
I found another way to solve the problem by making the url of the submodule relative. So I rewrote [submodule "mysubmodule"] path = mysubmodule url = https://myhost/mysubmodule.git as [submodule "mysubmodule"] 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.
Mark, Unless you reply today, I'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 += ';protocol=%s' % proto url += ";name=%s" % module url += ";subpath=%s" % paths[module] + if ud.user: + url += ";user=%s" % ud.user ld = d.createCopy() # Not necessary to set SRC_URI, since we're passing the URI to and ask Tony to submit it.
Sorry, I lost track of this. I'll get to it as soon as I can.
I've checked : * "user=" 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'll attach a refreshed version of the patch) However : * Passing password from git SRC_URI is not supported [0] * I don'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 "user is not propagated to submodules" is still true. [0] : https://git.openembedded.org/bitbake/tree/lib/bb/fetch2/git.py?id=a0d8108eba8d542707740d00c66c1c5f5b963f18#n692
Created attachment 4963 [details] Refreshed patch "gitsm: propagate user parameter to submodules"
From bug triage meeting 2023-07-27 : * I will send a patch commenting in the code that we don't support this (so we don't get more bugs about this) * Then, close this bug as WONTFIX
> * I will send a patch commenting in the code that we don't support this (so we don't get more bugs about this) => https://lists.openembedded.org/g/bitbake-devel/message/14893
Non-support documented here : https://git.yoctoproject.org/poky/commit/?id=d8a51fd6288b54c2fe9d08a65a50e2d8cd38b91b I close the bug I "won't fix" but the way to handle this is to use a .netrc file which will contain the username and the password.