From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7026321669488640000 X-Received: by 2002:a17:907:8a12:: with SMTP id sc18mr19583372ejc.274.1637754830897; Wed, 24 Nov 2021 03:53:50 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c98f:: with SMTP id c15ls4254135edt.0.gmail; Wed, 24 Nov 2021 03:53:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJyR2dD7SD+ixKx4pAkxe5peA1N2/kz12O65kzice6vyYKrDN1Nkx4sXBTSWYAh3GSv0NhNb X-Received: by 2002:a05:6402:1ca2:: with SMTP id cz2mr23501782edb.302.1637754829955; Wed, 24 Nov 2021 03:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1637754829; cv=none; d=google.com; s=arc-20160816; b=pY4B5qIy6PQDRUj0KpYB7l+WeR4xGdLU/Q3Xqczy7ffeNVMS+vdWXJKHv2BvGDcBVu Q9TlFga6G5GjoNMQhhLmJG3p0/waoEH56RamxnqI2XjVnhXkY1s4pWsJgaWEdyUsqCte RbsMXA1Q9fv7+wqrcP0oLhcAUKYqGvAAQGNCyjuHb1jznD66L85OMBVYgjQki1ZQy+xg OpSDauPAXwp3Hzxmlv395fQ0aMIxpDMDcYNYTzk8XvEUl6V2y0eeg1sq2t3kh7dVFP3q AmHOR+7rsM5pluU3HvkYPMci4kSzDrusK6mNOQ4sfIpmjmykz2dfI75uyr8wgOWgCuQ5 COlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:message-id:from:references:cc:to:subject; bh=ArVZPYuJGwsXNE4dVLDpjHrLGcDfK743BqULVDoaVLQ=; b=Xe5YLiglPO+8DxedwPWQRUTL4TEvRSwirC+N0YP71tvbCzycJPZBD4DCg/PZ/Zfogd 9dHgDrP+cW367vFOCZROutgpuy7VmiPPRM0c7UsbYEjrh5KmS7R0Vuo48OszwgNlJitW rkye3YLbpfbHX/l5yFjkDRnp7Zw3Rl/4G1cBP0w+I9JM10qPRLBaSk8UPbaG+iuRgbua Yb4eVT50DQH9AYNCtuvEfNXN47v65M52yKDYBAiYMggqdPCfiyAAjWK2LuPMMWyeYqb6 caZGE2D+J8Fl59o7XO5tvQFnyd2swB+ZO9YXR1ok5Rg02tzy8Ts69dkgu2Tij1V7tqYN Rm3Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Return-Path: Received: from shymkent.ilbers.de (shymkent.ilbers.de. [85.214.156.166]) by gmr-mx.google.com with ESMTPS id eb8si816685edb.0.2021.11.24.03.53.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 24 Nov 2021 03:53:49 -0800 (PST) Received-SPF: pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) client-ip=85.214.156.166; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of amikan@ilbers.de designates 85.214.156.166 as permitted sender) smtp.mailfrom=amikan@ilbers.de Received: from [192.168.67.164] (mm-237-77-214-37.mgts.dynamic.pppoe.byfly.by [37.214.77.237] (may be forged)) (authenticated bits=0) by shymkent.ilbers.de (8.15.2/8.15.2/Debian-8) with ESMTPSA id 1AOBrmVL013986 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 24 Nov 2021 12:53:49 +0100 Subject: Re: [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD To: "Schmidt, Adriaan" , "Moessbauer, Felix" 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: Anton Mikanovich Message-ID: Date: Wed, 24 Nov 2021 14:53:43 +0300 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; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on shymkent.ilbers.de X-TUID: RDqVXwRw7QqV Thanks for that digging, I also got the same results: the command was executed with the same euid, cwd and HOME values, but tried to access ~/.config/git/attributes only once for some reason. 24.11.2021 12:30, Schmidt, Adriaan wrote: > 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 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 > -- 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