<?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>13233</bug_id>
          
          <creation_ts>2019-03-25 06:37:37 +0000</creation_ts>
          <short_desc>fetch2: try_premirror(): improve on updating repo from mirror</short_desc>
          <delta_ts>2022-06-09 06:57:30 +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>0.0.0</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>enhancement</bug_severity>
          <target_milestone>4.1 M1</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Robert Yang">liezhi.yang</reporter>
          <assigned_to name="Pavel Zhukov">pavel</assigned_to>
          <cc>pavel</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.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>83308</commentid>
    <comment_count>0</comment_count>
    <who name="Robert Yang">liezhi.yang</who>
    <bug_when>2019-03-25 06:37:37 +0000</bug_when>
    <thetext>Currently, when rework in an old build, e.g, suppose
there is a foo_git.bb:

1) Add foo.git to PREMIRROR

2) In builddir
$ bitbake foo
Then foo.git will be fetched into DL_DIR, which is premirror_foo.git.

3) Upgrade foo_git.bb&apos;s SRCREV, and this SRCREV isn&apos;t in premirror_foo.git since
   it&apos;s very new.

4) Upgrade foo.git in PREMIRROR, now it contains the SRCREV of step 3

5) Go to the old builddir
$ bitbake foo

Then it won&apos;t update from PREMIRROR if BB_FETCH_PREMIRRORONLY is not set,
and it would fail to build if BB_NO_NETWORK = &quot;1&quot; since SRCREV can&apos;t be found
in DL_DIR. Now the problem is:

- Set BB_FETCH_PREMIRRORONLY = &quot;0&quot; and BB_NO_NETWORK = &quot;1&quot; will make foo fail
  to build.

- Set BB_FETCH_PREMIRRORONLY = &quot;1&quot; will make it work for foo_git.bb, but it
  may not work for another recipe such as foo_X_git.bb even if
  BB_NO_NETWORK = &quot;0&quot;.(Imagine the PREMIRROR doesn&apos;t contain foo_X_git.bb&apos;s
  SRCREV)

- Set BB_FETCH_PREMIRRORONLY = &quot;0&quot; and BB_NO_NETWORK = &quot;0&quot; will make foo work,
  but it won&apos;t upgrade from PREMIRROR, though everything is up-to-date there.
  It will update DL_DIR from SRC_URI, this isn&apos;t good when network is slow.


But if we make try_mirror always return true would get a little complex, for example if premirrors is a tarball
mirror of a git repo rather than a full repo.

If you change this to always return True, it would always download the
mirror tarball for a git repo rather than trying to do a git pull in
the main repo which would just download the delta.

The correct behaviour would probably be to work out whether we can do a
&quot;git fetch&quot; update from any source, then go back to pulling mirror
tarballs if we can&apos;t get the revision by the other means.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>93423</commentid>
    <comment_count>1</comment_count>
    <who name="Pavel Zhukov">pavel</who>
    <bug_when>2022-06-09 06:57:30 +0000</bug_when>
    <thetext>This should be fixed in: https://git.openembedded.org/bitbake/commit/?id=b47ecab3e3aad5c5c376ec023aa82a51aa0f3b86 and covered by FetchPremirroronlyLocalTest</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>