public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Henning Schild <henning.schild@siemens.com>
Cc: "[ext] Raphael Lisicki" <raphael.lisicki@siemens.com>,
	isar-users@googlegroups.com
Subject: Re: do_adjust_git in dpkg-base.bbclass not working for gitsm fetcher
Date: Tue, 1 Dec 2020 17:44:56 +0100	[thread overview]
Message-ID: <2f933d46-71cc-c24f-515f-3b94a9634049@siemens.com> (raw)
In-Reply-To: <20201201164029.00af5bd5@md1za8fc.ad001.siemens.net>

On 01.12.20 16:40, Henning Schild wrote:
> Am Tue, 1 Dec 2020 12:41:08 +0100
> schrieb "[ext] Jan Kiszka" <jan.kiszka@siemens.com>:
> 
>> On 01.12.20 11:41, [ext] Raphael Lisicki wrote:
>>> Hi,
>>>
>>> the function do_adjust_git does not work if the fetcher has been
>>> set to "gitsm" which is required if the project contains git
>>> submodules.
>>>
>>> See
>>> https://github.com/siemens/isar/blob/master/meta/classes/dpkg-base.bbclass#L26
>>>
>>>
>>> This will cause the .git/objects/info/alternates remain unmodified,
>>> which in turn breaks git from inside the buildchroot.  
>>
>> From
>> https://www.yoctoproject.org/docs/latest/bitbake-user-manual/bitbake-user-manual.html#gitsm-fetcher:
>>
>> "The Git Submodules fetcher is not a complete fetcher implementation.
>> The fetcher has known issues where it does not use the normal source
>> mirroring infrastructure properly. [...]"
>>
>> For that reason already, I would strongly discourage the use of this
>> fetcher. And that's why it was never tested with Isar (to my best
>> knowledge).
> 
> I have seen people use git submodules in isar recipes. But they are
> hairy indeed. A big issue is whether those submodules are absolute or
> relative to their main repo. Relative is your best bet, absolute will
> break authentication since you might find yourself wanting to clone with
> ssh and gitsm contains absolute https links.
> 
> If you control that main repo, you might want to switch to relative ...
> if you can. Doing that breaks the "forking workflow" ... now every
> contributor needs to fork all, or switch to absolute before working.
> 
> The worst case would be nested submodules ...
> 
> I found it best to switch over to repeating the submodule stuff in the
> recipe, naming all modules with their shas and where they should be
> cloned. Hard to maintain ... but you can write helper scripts writing
> ".inc" files containing the bits and using a clone with initialized
> modules as input.
> 
> SRC_URI = "gitsm://foo.git;destsuffix=${P}"
> SRCREV = "0815"
> 
> becomes
> 
> SRC_URI = "git://foo.git;destsuffix=${P};name=main
> SRCREV_main = "0815"
> SRC_URI += "git://bar.git;destsuffix=${P}/modules/bar;name=module1
> SRC_URI += "git://baz.git;destsuffix=${P}/mod/baz;name=module2
> SRCREV_module1 = "1234"
> SRCREV_module2 = "abcd"
> 
> Those last 4 lines can be generated from ".gitmodules" and "git ls-tree
> <main-repo-sha> <sm-path>" and stored in an include.
> 

That's a better pattern, indeed.

Maybe someone wants to hack up some scripts/unroll-gitsm.sh to spit out
those lines for a given recipe.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

  reply	other threads:[~2020-12-01 16:44 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 10:41 Raphael Lisicki
2020-12-01 11:41 ` Jan Kiszka
2020-12-01 15:40   ` Henning Schild
2020-12-01 16:44     ` Jan Kiszka [this message]
2020-12-01 18:51       ` Henning Schild
2020-12-02 17:10     ` Raphael Lisicki
2020-12-02 18:03       ` Jan Kiszka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2f933d46-71cc-c24f-515f-3b94a9634049@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=raphael.lisicki@siemens.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox