From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7026321669488640000 X-Received: by 2002:a63:4a5d:: with SMTP id j29mr574425pgl.455.1637753156425; Wed, 24 Nov 2021 03:25:56 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:d4cc:: with SMTP id o12ls8508694plg.11.gmail; Wed, 24 Nov 2021 03:25:55 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAW/tG1v0LYN3Px8qm+aFE6ysgstYMbm1yEjDvv65ekzs5IrIL+TvwxHEyn4TPPPN0mIDu X-Received: by 2002:a17:902:768b:b0:144:e570:c7d2 with SMTP id m11-20020a170902768b00b00144e570c7d2mr16908719pll.86.1637753155667; Wed, 24 Nov 2021 03:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637753155; cv=none; d=google.com; s=arc-20160816; b=UUCQQlK2MeW4SD9F668Vz28iKNPV4S+A9kOUgCd7uFGNAKL2WU8vIitC6r7irzSl7E NqfX09ytFcw1oJfWm5/YzFv/GhFruTBBeUk/k3zu0Nsz9i8TXqE/mklvKmK1SHZJBSzb cmlYqBd2vcdvQRhHb7Z8kYCE9btGDiYYyG/NOayQzGdo14XWeXqIk4n7xB6ATfJKweL+ LhJmmN6uc2YqOMBanAh4q8W3B11a1fI1BXDWW2wLrQoIboFfSzVF/48wF1zrH1RkFftS IkTxh3IfMYsCmDBkhI0QP6I57n0v071FotVmRlXWrWX5FzjjhoqhzxOBCsDW7O03fqKf tPFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=vEAnDcNS7YzuFEhVl8rO/zy+UUO5H+mJtJJ41KT5AVs=; b=TbCu3k9C8t3CqfsKNfcSo3/ccP4mYH54Ii/N1hJGViBE8lC9O+0ib2TSYjMO0fmsPR Gp68evWQW73jdFFZQ6z7GmEcOX5GkQhrjul9AwZ77Tut6x0rtgB1oXZpCVwTCcEkVeFn yAR9wLgURYfgWf8f/ofYtg5mwkNiO9/bH7kBlRBSJEm/m6Xjb++eXCN5PSoWAgGPa5V6 0Cya9wspUEKFKWNDATmSkk0p0AZOhrA4G4V4tXVAoMg5BP1T8z92UuMKt+nAzaTfNRG6 tBzzUgSWPJt9TUAnYdGBH7B1SF6LPNy92Z7PSdyXfE6lHy5EsU2aEFQ9oORkHPGuidsj BMtg== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@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 y2si2083030pjp.2.2021.11.24.03.25.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Nov 2021 03:25:55 -0800 (PST) Received-SPF: pass (google.com: domain of jan.kiszka@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 jan.kiszka@siemens.com designates 194.138.37.39 as permitted sender) smtp.mailfrom=jan.kiszka@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 1AOBPrkf031009 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 24 Nov 2021 12:25:53 +0100 Received: from [167.87.0.79] ([167.87.0.79]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id 1AOBPrW2020194; Wed, 24 Nov 2021 12:25:53 +0100 Subject: Re: [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD To: "Moessbauer, Felix" , "Schmidt, Adriaan" , Anton Mikanovich Cc: "isar-users@googlegroups.com" , "henning.schild@siemens.com" , Baurzhan Ismagulov References: <20211104110507.2358692-1-felix.moessbauer@siemens.com> <4bf7b75d-f431-9a07-96f0-a1168af073d3@ilbers.de> <8836f60a-e1f6-59e6-1343-cdb5902dbf96@ilbers.de> From: Jan Kiszka Message-ID: Date: Wed, 24 Nov 2021 12:25:52 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: gGezrYxFZcsI On 24.11.21 11:15, Moessbauer, Felix wrote: >> -----Original Message----- >> From: Schmidt, Adriaan (T RDA IOT SES-DE) >> Sent: Wednesday, November 24, 2021 10:31 AM >> To: Anton Mikanovich ; Moessbauer, Felix (T RDA IOT >> SES-DE) >> Cc: isar-users@googlegroups.com; Schild, Henning (T RDA IOT SES-DE) >> ; Baurzhan Ismagulov >> Subject: RE: [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD >> >> 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:// >>>>>> patc >>>>>> >>>>> >> hwork.openembedded.org%2Fpatch%2F133517%2F&data=04%7C01%7 >> Cfe >>>>> lix.mo >>>>> >> essbauer%40siemens.com%7C8e3a031610c74e6dd76c08d9a9caf3f5%7C38ae >> 3 >>>>> bcd95 >>>>> >> 794fd4addab42e1495d55a%7C1%7C0%7C637727511405820881%7CUnknown >> % >>>>> 7CTWFpbG >>>>> >> Zsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6 >> M >>>>> n >>>>> 0% >>>>> >> 3D%7C3000&sdata=od2HCs8VUwZqOzifBdItzcjb5a7j85g33J44%2BiMMjC >> M >>>>> %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://gith >>> >> ub.com%2Filbers%2Fisar%2F&data=04%7C01%7Cfelix.moessbauer%40s >> iemens.com%7C764b1f78193440841ad508d9af2d1949%7C38ae3bcd95794fd4 >> addab42e1495d55a%7C1%7C0%7C637733430489004007%7CUnknown%7CTW >> FpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJX >> VCI6Mn0%3D%7C3000&sdata=Z52wROzfuVc2F49yGYmmut7JmJ2I46N% >> 2Bd911OolR%2Fi4%3D&reserved=0 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 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. > > Thanks for debugging this. > IMO this is neither an ISAR issue in general, nor related to the patches. > The patches just make the misconfiguration visible. > > We could get around that by telling git to not consider any user or system config files (this requires a very recent git 2.32): > export GIT_CONFIG_SYSTEM=/dev/null > export GIT_CONFIG_GLOBAL=/dev/null > > This could be done in the isar-init-build-env. > However, I am not sure if we really want to do so. > The ISAR release CMD is provided by the user and by that, also the user should be responsible for a correctly setup environment. > > Opinions? I think it would make sense to silence git error/warning messages in the default ISAR_RELEASE_CMD definition. But anything else would go beyond reasonable, specifically due to unpredictable side effects. Jan -- Siemens AG, T RDA IOT Corporate Competence Center Embedded Linux