public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Alexander Smirnov <asmirnov@ilbers.de>
To: Henning Schild <henning.schild@siemens.com>,
	Jan Kiszka <jan.kiszka@siemens.com>
Cc: isar-users <isar-users@googlegroups.com>
Subject: Re: [PATCH] Make sure git repos are usable inside buildchroot
Date: Wed, 14 Feb 2018 12:43:43 +0300	[thread overview]
Message-ID: <d3c954ce-0f26-2f3e-38b1-3461d333edb2@ilbers.de> (raw)
In-Reply-To: <20180214103027.2c4a7606@mmd1pvb1c.ad001.siemens.net>

On 02/14/2018 12:30 PM, Henning Schild wrote:
> There is a similar patch from Alex floating around. My opinion is

Thanks for the reference ;-)

> still, this should be fixed upstream and we can wait. After all nobody
> forces anyone to use git and most git-servers should offer tarballs,
> which are probably often faster than git.
> 
> I would rather mark git as broken in the fetcher, but that might just
> me a result of me not liking git at all ;).

More easy workaround is also floating on the list:

https://groups.google.com/forum/#!msg/isar-users/sAcJqSx_vqs/wetXTcMLCQAJ;context-place=forum/isar-users

Just repack objects to working dir.

Alex

> 
> Henning
> 
> Am Wed, 14 Feb 2018 10:14:18 +0100
> schrieb Jan Kiszka <jan.kiszka@siemens.com>:
> 
>> From: Jan Kiszka <jan.kiszka@siemens.com>
>>
>> bitbake clones git repos into the package workdir in shared mode. This
>> creates an alternates link to the original download folder. However,
>> that path is invalid inside buildchroot. This disturbs package builds
>> which try to derive information from the git repo, such as tags or the
>> delta to the last release.
>>
>> Bind-mount the downloads folder and patch the alternates file to
>> restore the git repo access inside buildchroot.
>>
>> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>> ---
>>
>> Applies on top of "Move buildchroot mounts into dpkg-base class", v3.
>>
>> This obsoletes the bitbake patch Henning developed to disable sharing.
>>
>> Tested via jailhouse-images (required changes not yet pushed) where
>> the Jailhouse recipe makes use of this.
>>
>>   meta/classes/dpkg-base.bbclass                   | 10 ++++++++++
>>   meta/recipes-devtools/buildchroot/buildchroot.bb |  1 +
>>   2 files changed, 11 insertions(+)
>>
>> diff --git a/meta/classes/dpkg-base.bbclass
>> b/meta/classes/dpkg-base.bbclass index 895ff26..241dc2c 100644
>> --- a/meta/classes/dpkg-base.bbclass
>> +++ b/meta/classes/dpkg-base.bbclass
>> @@ -1,6 +1,15 @@
>>   # This software is a part of ISAR.
>>   # Copyright (C) 2017 Siemens AG
>>   
>> +do_adjust_git() {
>> +    if [ -f ${WORKDIR}/${S}/.git/objects/info/alternates ]; then
>> +        sed -i ${WORKDIR}/${S}/.git/objects/info/alternates \
>> +            -e 's|${DL_DIR}|/downloads|'
>> +    fi
>> +}
>> +
>> +addtask adjust_git after do_unpack before do_build
>> +
>>   # Add dependency from buildchroot creation
>>   do_build[depends] = "buildchroot:do_build"
>>   
>> @@ -30,6 +39,7 @@ do_build() {
>>       sudo flock ${MOUNT_LOCKFILE} -c ' \
>>           if ! grep -q ${BUILDCHROOT_DIR}/isar-apt /proc/mounts; then \
>>               mount --bind ${DEPLOY_DIR_APT}/${DISTRO}
>> ${BUILDCHROOT_DIR}/isar-apt; \
>> +            mount --bind ${DL_DIR} ${BUILDCHROOT_DIR}/downloads; \
>>               mount -t devtmpfs -o mode=0755,nosuid devtmpfs
>> ${BUILDCHROOT_DIR}/dev; \ mount -t proc none ${BUILDCHROOT_DIR}/proc;
>> \ fi'
>> diff --git a/meta/recipes-devtools/buildchroot/buildchroot.bb
>> b/meta/recipes-devtools/buildchroot/buildchroot.bb index
>> 62979f5..9b4e7d3 100644 ---
>> a/meta/recipes-devtools/buildchroot/buildchroot.bb +++
>> b/meta/recipes-devtools/buildchroot/buildchroot.bb @@ -38,6 +38,7 @@
>> do_build() {
>>       sudo rm -rf ${BUILDCHROOT_DIR}
>>       mkdir -p ${BUILDCHROOT_DIR}/isar-apt
>> +    mkdir -p ${BUILDCHROOT_DIR}/downloads
>>       mkdir -p ${BUILDCHROOT_DIR}/dev
>>       mkdir -p ${BUILDCHROOT_DIR}/proc
>>       mkdir -p ${BUILDCHROOT_DIR}/sys
> 

-- 
With best regards,
Alexander Smirnov

ilbers GmbH
Baierbrunner Str. 28c
D-81379 Munich
+49 (89) 122 67 24-0
http://ilbers.de/
Commercial register Munich, HRB 214197
General manager: Baurzhan Ismagulov

  reply	other threads:[~2018-02-14  9:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-14  9:14 Jan Kiszka
2018-02-14  9:30 ` Henning Schild
2018-02-14  9:43   ` Alexander Smirnov [this message]
2018-02-14  9:59     ` Jan Kiszka
2018-02-14 19:40 ` [PATCH v2] " 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=d3c954ce-0f26-2f3e-38b1-3461d333edb2@ilbers.de \
    --to=asmirnov@ilbers.de \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.com \
    --cc=jan.kiszka@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