From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7026321669488640000 X-Received: by 2002:ac2:4555:: with SMTP id j21mr14614008lfm.120.1637757324223; Wed, 24 Nov 2021 04:35:24 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6512:3e10:: with SMTP id i16ls2442971lfv.3.gmail; Wed, 24 Nov 2021 04:35:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJyxrWDXc4fY5Lav00kheJAVnCZe0IQGy2Mmm9/SUEydsR3RJtbl1jivOzZbKOaE/iuopeSf X-Received: by 2002:a05:6512:33bc:: with SMTP id i28mr14198240lfg.33.1637757323139; Wed, 24 Nov 2021 04:35:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637757323; cv=none; d=google.com; s=arc-20160816; b=WKGSaQi6pKS8ZHZ1olJ8GD8QCChBcXVkCMdTtPMbTUojmE4oPuYwZNOL+SiqizERey pXnaAc3SCnx+bkMpbGclMzrylVvhgyDYnBzvIj8w/6bAqgDYk4zSU8C4U0KGYPiHyWx+ T4q4+JW3wh2oC+RWbNhQQzt9f1bajUWbHHZxKiyxXmIc2H3QP3H5aK5CzKDr0Lzs9bGO HZg5Ib/a5rbL0FoqDTf9/DdqR4Xa+iVc0GW155FpFkFotc1fbEw5CJXQT3KjLSdVTnlj xERC4PMJF3ZW5GWpJ8DuaKKDxOlY3PTKjs05jz/wDntF03MaRKa7vYa+4qL7PLqiIN9s h8RQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=7zMRBlX57ePFI3HGxbH5uuTWFq1f9C+JBfX2a8WKDGQ=; b=NBqUsdCnRBNVSsgoK0GvBw8IAC5RUi3FHhsvDT0HHRNL0F2cIbZFXnIK1yuq1KRo/O 8uqYaH1yD/HA658kaaE4G4NS65lXZIkub5frfBwS56D7JAePrjQ7ag88035gfId8A9xA JfLAO0PVIDzAtAUKobdQHlJvpCHfRlXsYPnS6aeba6wPWwkUtzQp4e+tbOD+axvroPZ3 FYTushxlyaD1YulkE63mHTclMtTgCHjQtn1VaxaOVwXO7mxtm8a07NbGDhJT9njZYqWn gS74i7uoGfRngDAqrJQ/Qi8HzRAmXapuP2hbYjTUGIVhX8FFyatK3elV2rjM/PNppVh5 SJWw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from lizzard.sbs.de (lizzard.sbs.de. [194.138.37.39]) by gmr-mx.google.com with ESMTPS id h12si1017228lfv.4.2021.11.24.04.35.22 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Nov 2021 04:35:23 -0800 (PST) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) client-ip=194.138.37.39; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by lizzard.sbs.de (8.15.2/8.15.2) with ESMTPS id 1AOCZMqw006004 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Nov 2021 13:35:22 +0100 Received: from md1za8fc.ad001.siemens.net ([139.25.69.80]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 1AOCZMmP012583; Wed, 24 Nov 2021 13:35:22 +0100 Date: Wed, 24 Nov 2021 13:35:21 +0100 From: Henning Schild To: "Schmidt, Adriaan (T RDA IOT SES-DE)" Cc: Anton Mikanovich , "Moessbauer, Felix (T RDA IOT SES-DE)" , "isar-users@googlegroups.com" , Baurzhan Ismagulov Subject: Re: [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD Message-ID: <20211124133521.510db3c9@md1za8fc.ad001.siemens.net> In-Reply-To: References: <20211104110507.2358692-1-felix.moessbauer@siemens.com> <4bf7b75d-f431-9a07-96f0-a1168af073d3@ilbers.de> <8836f60a-e1f6-59e6-1343-cdb5902dbf96@ilbers.de> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: EnzO9/Q8K9Rg Am Wed, 24 Nov 2021 10:30:48 +0100 schrieb "Schmidt, Adriaan (T RDA IOT SES-DE)" : > Anton Mikanovich, 22. November 2021 16:28: > > To: Moessbauer, Felix (T RDA IOT SES-DE) > > Cc: isar-users@googlegroups.com; > > Schild, Henning (T RDA IOT SES-DE) ; > > Schmidt, Adriaan (T RDA IOT SES-DE) ; > > Baurzhan Ismagulov Subject: Re: [PATCH v4 0/2] > > Improve handling of ISAR_RELEASE_CMD > > > > 17.11.2021 18:57, Moessbauer, Felix wrote: > > >> -----Original Message----- > > >> From: Anton Mikanovich > > >> Sent: Wednesday, November 17, 2021 2:06 PM > > >> To: Moessbauer, Felix (T RDA IOT SES-DE) > > >> Cc: isar-users@googlegroups.com > > >> Subject: Re: [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD > > >> > > >> 17.11.2021 13:45, Moessbauer, Felix wrote: > > >>> Hi Anton, > > >>> > > >>> Unfortunately I cannot reproduce this, but this is very likely > > >>> related to > > a not > > >> idempotent ISAR_RELEASE_CMD. > > >>> As stated in the API changelog, the ISAR_RELEASE_CMD shall be > > >>> idempotent > > >> (and technically must be for MC targets). > > >>> By that, no things like timestamps must be included. > > >>> > > >>> If you point me to the location where the ISAR_RELEASE_CMD is > > >>> set for CI > > >> builds, I can have a look. > > >>> Another issue could be that changes to the git happen during > > >>> build (e.g. > > adding > > >> a tag, making the repo dirty, etc...). > > >>> In that case (starting with a clean build, ending up with a > > >>> dirty one), > > the CI > > >> generated files have to be added to the .gitignore. > > >>> In Yocto there is a lengthy discussion about the idempotence > > >>> sanity check > > [1] > > >> and why recipes have to be written in this way. > > >>> Best regards, > > >>> Felix > > >>> > > >>> [1] > > >>> https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatc > > >>> > > >> hwork.openembedded.org%2Fpatch%2F133517%2F&data=04%7C01%7Cfe > > >> lix.mo > > >> essbauer%40siemens.com%7C8e3a031610c74e6dd76c08d9a9caf3f5%7C38ae3 > > >> bcd95 > > >> 794fd4addab42e1495d55a%7C1%7C0%7C637727511405820881%7CUnknown% > > >> 7CTWFpbG > > >> Zsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn > > >> 0% > > >> 3D%7C3000&sdata=od2HCs8VUwZqOzifBdItzcjb5a7j85g33J44%2BiMMjCM > > >> %3D&a > > >>> mp;reserved=0 > > >>> > > >> Default ISAR_RELEASE_CMD can be found in > > >> meta/classes/image.bbclass as: ISAR_RELEASE_CMD_DEFAULT = "git > > >> -C ${LAYERDIR_core} describe --tags -- dirty --match > > >> 'v[0-9].[0-9]*'" which results in something like > > >> `v0.7-534-g6752a45` This issue is > > reproduced > > >> inside Jenkins only, but not locally or in gitlab/kas. > > > Then it's likely that Jenkins modifies files in the source tree. > > > One thing you could try is to explicitly make the git "dirty", or > > > simply > > try a static ISAR_RELEASE_CMD. > > > > > > Anyways, how should we proceed here? > > > > > > Felix > > >> -- > > >> Anton Mikanovich > > >> Promwad Ltd. > > >> External service provider of ilbers GmbH Maria-Merian-Str. 8 > > >> 85521 Ottobrunn, Germany > > >> +49 (89) 122 67 24-0 > > >> Commercial register Munich, HRB 214197 > > >> General Manager: Baurzhan Ismagulov > > > > We've reproduced the issue even locally without CI by manually > > setting username, clone and build: > > > > $ sudo chroot --userspec= /bin/bash -c "cd > > /tmp && git clone -b https://github.com/ilbers/isar/ > > isar-repo && cd isar-repo && source isar-init-build-env && bitbake > > mc:qemuamd64-bullseye:isar-image-base" > > > > So the issue is related to chroot build but not only Jenkins. I was wondering where the sudo chroot was put around the RELEASE_CMD and could not find that. Because that place is just wrong if it does not also set HOME or use sudo -E or use bash -l. If one wants a proper shell inside a chroot one needs to "log in" and not inherit env ... especially not with sudo (which messes with env) But it seems that no such code is part of isar. But maybe part of the ilbers ci? Henning > I was able to reproduce, and I'm seeing that sometimes `git describe` > returns: > > warning: unable to access '/root/.config/git/attributes': Permission > denied v2.0-1-gf7f18a4-dirty > (with the extra warning line in its stdout, which then becomes part > of IMAGE_BUILD_ID) > > So sometimes git wants to access config in $HOME, which is `/root` > when you run `sudo chroot`, and thus not readable to the user set via > --userspec. It works if you `export HOME=/somewhere/readable/by/user` > after entering the chroot. > > I don't know why that access to $HOME/.config only happens on some of > the calls. > > Adriaan >