<?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>13133</bug_id>
          
          <creation_ts>2019-01-10 14:56:50 +0000</creation_ts>
          <short_desc>Git submodule fetcher fails if last component of path is different than the URL</short_desc>
          <delta_ts>2019-05-17 08:57:01 +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>major</bug_severity>
          <target_milestone>2.8 M2</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Florian Kauer">koalo</reporter>
          <assigned_to name="Mark Hatle">mark.hatle</assigned_to>
          <cc>koalo</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</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>82725</commentid>
    <comment_count>0</comment_count>
    <who name="Florian Kauer">koalo</who>
    <bug_when>2019-01-10 14:56:50 +0000</bug_when>
    <thetext>Preconditions/Environment
-------------------------
Poky thud @ 87e3a9739d2c28f7fb9d8991586430c2c9bf149c

Triggering Action/Cause
-----------------------
I use the following recipe for fetching and building the Microsoft Azure C SDK:

DESCRIPTION = &quot;C SDK for Microsoft Azure IoT&quot;
AUTHOR = &quot;Microsoft Corporation&quot;
HOMEPAGE = &quot;https://github.com/Azure/azure-iot-sdk-c&quot;
LICENSE = &quot;MIT&quot;
LIC_FILES_CHKSUM = &quot;file://LICENSE;md5=4283671594edec4c13aeb073c219237a&quot;

SRC_URI = &quot;\
	gitsm://github.com/Azure/azure-iot-sdk-c.git;rev=acff8b1677150cb165a7b111745144cf8fab76cc \
&quot;

PR = &quot;r0&quot;

inherit cmake

DEPENDS = &quot;\
	curl \
	util-linux \
	openssl \
&quot;

RDEPENDS_${PN} = &quot;\
	util-linux-libuuid \
&quot;

S = &quot;${WORKDIR}/git&quot;
B = &quot;${WORKDIR}/build&quot;


Expectation
-----------
The fetch and compilation is successful.

Actual Result
-------------
ERROR: azure-iot-sdk-c-1.2.11-r0 do_unpack: Fetcher failure: Submodule azure-c-shared-utility does not exist in /home/[...]/build/downloads/git2/github.com.Azure.azure-iot-sdk-c.git/modules/c-utility or /home/[...]/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/azure-iot-sdk-c/1.2.11-r0/git/.git/modules/c-utility.
ERROR: azure-iot-sdk-c-1.2.11-r0 do_unpack: Function failed: base_do_unpack
ERROR: Logfile of failure stored in: /home/[...]/build/tmp/work/cortexa9hf-neon-poky-linux-gnueabi/azure-iot-sdk-c/1.2.11-r0/temp/log.do_unpack.8798
ERROR: Task (/home/[...]/recipes-connectivity/azure-iot-sdk-c/azure-iot-sdk-c_1.2.11.bb:do_unpack) failed with exit code &apos;1&apos;

Reproducibility
---------------
Always.

Details
-------
After the commit https://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/bitbake/lib/bb/fetch2/gitsm.py?id=a042179a784bab6a6f4bd5d63db80c1c02624b1c it not longer seems to be possible to fetch git submodules that are named differently than the source repository. For example:

[submodule &quot;azure-c-shared-utility&quot;]
	path = c-utility
	url = https://github.com/Azure/azure-c-shared-utility.git

A short debugging reveals that the fetch would be successful if line 157 of gitsm.py (https://git.yoctoproject.org/cgit/cgit.cgi/poky/tree/bitbake/lib/bb/fetch2/gitsm.py?h=thud#n157) would be
modpath = os.path.join(repo_conf, &apos;modules&apos;, module)
as before, but I do not know enough about the system to understand if that is the actual reason for the bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83814</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2019-05-15 11:42:47 +0000</bug_when>
    <thetext>I believe another user report the same thing with slightly different symptoms.  I believe I have a patch for this issue and will be sending it up for review soon.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>83844</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2019-05-17 08:57:01 +0000</bug_when>
    <thetext>Believed to be fixed in master bitbake commit: fd27ab60d33553dba13de39394edaaac04e446b3</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>