<?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>9825</bug_id>
          
          <creation_ts>2016-06-24 18:44:33 +0000</creation_ts>
          <short_desc>allow alternates with full protocol specs for improving bitbake git functionality</short_desc>
          <delta_ts>2021-11-02 21:48:54 +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>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>  </status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>Future</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexander Stohr">alexander.stohr</reporter>
          <assigned_to name="Richard Purdie">richard.purdie</assigned_to>
          <cc>leonardo.sandoval.gonzalez</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>sgw</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Yes (doc changes required)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>63326</commentid>
    <comment_count>0</comment_count>
    <who name="Alexander Stohr">alexander.stohr</who>
    <bug_when>2016-06-24 18:44:33 +0000</bug_when>
    <thetext>Example of a equivalent set of git repository access methods:

git://git.gnome.org/mobile-broadband-provider-info
https://git.gnome.org/browse/mobile-broadband-provider-info
ssh://USERNAME@git.gnome.org/git/mobile-broadband-provider-info
(of course there are more variants for other repos...)

people might prefer a certain way of access, e.g. password protected access or always HTTP (due to local firewalls they barely can control) instead of the normal &quot;git&quot; protocol when going for the sources of a certain bitbake package.

there should be the option for specfiying patterns for servers at a central location or even locally (with less wild cards) for a single recipe.

in above set the recipe creator would simply write e.g. the git-protocol path to his scripting variables. but at a central place something like this can be there:

server=git.gnome.org
username= # if you keep this empty then any alternate statement using this item gets discarded
alternate=git://%server%/%package%
alternate=https://%server%/browse/%package%
alternate=ssh://%username%@%server%/git/%package%

further it can be very helpful to occasionally insert a local file path for all git locations (for things that got cloned earlier using &quot;git clone &lt;...&gt;&quot; or if not on the master &quot;git clone --bare --mirror&quot; - it&apos;s already supported by the build tools). at the beginning of the git master file it could look like this:

alternate_universal=/home/john.smith/Downloads/git-mirrors/%package%

maybe providing a preferred git protocol or even an order for probing might be of some sense: (it might even make some sense if it is available locally per server in a similar fashion)

priority=ssh,https,http,git # leftmost protocol has highest priority in probing

at the ruleset in the recipes it might be helpful in some cases when such alternates are available as well, as a temporary or even a permanent local/public selection for whatever solution to a task. Example:

SRC_URI=&quot;git://git.gnome.org/mobile-broadband-provider-info;alternate=file:///usr/local/src/git-mirrors-shared/for-embedded-board-xy/%package%;alternate=https://%server%/browse/%package%;altrnate=ssh://%username%@%server%/git/%package%&quot;

Obviously if a globally stored rule is reasonable then it should be created first by the script creator, simply for better joint long-term maintenance efforts. but the flexibility for individual tweaking seems to be reasonable as well - thus the global settings might step back in favour for the more local settings.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63521</commentid>
    <comment_count>1</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2016-06-30 14:46:59 +0000</bug_when>
    <thetext>This is really complicated because different people want different things, sometimes even depending on their location. Rather than adding more syntax, it would make most sense to use MIRRORS and PREMIRRORS to handle this. That also gives a convenient way of setting policy.

Its likely that MIRRORS doesn&apos;t quite have enough magic to handle the parameter part of the urls so that would need to be fixed. We&apos;d also want to add tests to bitbake-selftest for this.

I am worried about putting more complexity into what is already a complex piece of code which is why I don&apos;t want to rush into changing this, or add yet more syntax which potentially conflicts with MIRRORS.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91876</commentid>
    <comment_count>2</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2021-11-02 21:48:54 +0000</bug_when>
    <thetext>A totally generic &quot;use X, Y, Z&quot; in order of preference isn&apos;t possible since not all urls support all protocols and even when they do the form can be different. An example is git.yoctoproject.org where https ans git work but the urls are slightly different.

That said, there are possibilities and remapping urls like this is basically what MIRRORS and PREMIRRORS are for.

The good news is that parameter remapping now also works, so it is possible to take a protocol=git parameter and change it to protocol=https, or add a new parameter in a mirror url and other forms of manipulation too. With that now working I believe this issue is addressed as much as we can ever make it.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>