public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Henning Schild <henning.schild@siemens.com>
To: "[ext] Jan Kiszka" <jan.kiszka@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 16:40:29 +0100	[thread overview]
Message-ID: <20201201164029.00af5bd5@md1za8fc.ad001.siemens.net> (raw)
In-Reply-To: <ace9f3ca-bffb-243c-02d7-901b0ba968a1@siemens.com>

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.

Henning

> In general, git submodules are hairy. And specifically in the context
> of distro (like Debian), their presence indicate that you rather want
> them as "Build-Depends" and properly packaged.
> 
> Jan
> 


  reply	other threads:[~2020-12-01 15:40 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 [this message]
2020-12-01 16:44     ` Jan Kiszka
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=20201201164029.00af5bd5@md1za8fc.ad001.siemens.net \
    --to=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@siemens.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