Bug 14844

Summary: SCM Mirror : Use Git mirror for fetching the Sources
Product: [Build System, Metadata & Runtime] BitBake Reporter: Ravi Vikkram <Vikkram.Ravi>
Component: bitbakeAssignee: Ravi Vikkram <Vikkram.Ravi>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium CC: poky.bs.watcher, poky.watcher, randy.macleod, richard.purdie
Version: 3.1.15   
Target Milestone: 3.1.18   
Hardware: x86   
OS: arm   
Whiteboard: NIR 07/15
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Ravi Vikkram 2022-06-20 09:30:13 UTC
As We do develop software with multiple company collaboration, company A stores all the software Sources in GIT SCM and company B mirrors the repository in the their GIT SCM. The bb files reference the GIT SCM of the company A , the developers from the company B still fetch the source from the GIT SCM of the company A and not the mirror repository of the company B. 

Git mirroring is when a mirror copies the refs & the remote-tracking branches. It is  functionally identical copy that is interchangeable with the original.

What did I try already :


PREMIRRORS_append += "git://git@git.abc.a.com:8080/.* git://abc.b.com/repos/projects/k/.*\n"

A premirror append always look for tar file of the source repository. 

Expectation:

I want to replace the domain name of the company A with the company B so that I could use both the repository in each of its domain.
Comment 1 Richard Purdie 2022-06-22 14:15:49 UTC
Can you give a little more information about why/how that failed?

In theory you should be able to setup a PREMIRROR entry as you describe. It would look for mirror tarballs but should also try the full url replacement as you want.

I assume you're using an older release and hence the "_append" syntax rather than ":append"? That syntax wouldn't work with 4.0.

We do various manipulations such as adding a ;protocol=https fallback for ;protocol=git:

https://git.yoctoproject.org/poky/tree/meta/classes/mirrors.bbclass#n76

so your case should be simpler and also work.
Comment 2 Randy MacLeod 2022-06-23 14:35:16 UTC
As per Richard's comments, need info state.
Comment 3 Ravi Vikkram 2022-06-24 05:56:24 UTC
I have updated the version of the Poky Distro version to 3.1.15
Comment 4 Ravi Vikkram 2022-06-27 09:43:00 UTC
I have added to the required information
Comment 5 Richard Purdie 2022-06-27 18:57:34 UTC
Thanks for the additional information, it helps a lot to know this is dunfell. Even in dunfell, the MIRRORS entries I mentioned are present though:

https://git.yoctoproject.org/poky/tree/meta/classes/mirrors.bbclass?h=dunfell#n73

so in theory mapping two urls like that should work. 

We need to establish what exactly isn't working. Do you have a fetch log and PREMIRRORS entry which shows what is being attempted/not attempted you could share please?

In your example I notice that the domains, user, path and ports are different so it could be able one of these that is the trigger for an issue.
Comment 6 Randy MacLeod 2022-06-30 15:00:33 UTC
Ravi, see Richards comment and please reply.
Comment 7 Ravi Vikkram 2022-07-18 14:52:54 UTC
The above solutions worked for me with the example shown in the bbclass. Thank you
Comment 8 Ravi Vikkram 2022-08-09 03:56:20 UTC
The solution does work on the version. Thanks . Hence I mark it as not a Bug