public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Moessbauer, Felix" <felix.moessbauer@siemens.com>
To: "henning.schild@siemens.com" <henning.schild@siemens.com>
Cc: "isar-users@googlegroups.com" <isar-users@googlegroups.com>,
	Baurzhan Ismagulov <ibr@radix50.net>,
	Anton Mikanovich <amikan@ilbers.de>
Subject: RE: [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD
Date: Thu, 18 Nov 2021 08:36:25 +0000	[thread overview]
Message-ID: <AM9PR10MB4869A2EEF832E4CD925171F9899B9@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20211117175430.06217822@md1za8fc.ad001.siemens.net>

> -----Original Message-----
> From: Henning Schild <henning.schild@siemens.com>
> Sent: Wednesday, November 17, 2021 5:55 PM
> To: Anton Mikanovich <amikan@ilbers.de>
> Cc: Moessbauer, Felix (T RDA IOT SES-DE) <felix.moessbauer@siemens.com>;
> isar-users@googlegroups.com
> Subject: Re: [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD
> 
> Am Wed, 17 Nov 2021 16:05:31 +0300
> schrieb Anton Mikanovich <amikan@ilbers.de>:
> 
> > 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%2Fpa
> > >
> tchwork.openembedded.org%2Fpatch%2F133517%2F&amp;data=04%7C01%7C
> feli
> > >
> x.moessbauer%40siemens.com%7C41165dba8b90412ea40208d9a9eaf011%7C3
> 8ae
> > >
> 3bcd95794fd4addab42e1495d55a%7C1%7C0%7C637727648792760989%7CUnk
> nown%
> > >
> 7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiL
> C
> > >
> JXVCI6Mn0%3D%7C3000&amp;sdata=tiU23Wb9SkVh01PyueQHb9i7K4p3YuhmN
> k4Lj3
> > > Bvg8U%3D&amp;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.
> 
> Well once you sed in there you might also get a "dirty" somewhere. The reason
> the output might differ in gitlab is simply the clone depth which defaults to
> something like 50. If your last tag is 534 commits away you will get only g<sha>
> because there are no tags in your not super-deep clone.

I don't think that is the case here. As long as the ISAR_RELEASE_CMD reports the exactly same value for a single bitbake invocation, we are fine.
The value itself doesn't matter and can also change across invocations of bitbake.
That's exactly the point of the patch to correctly detect changes to the environment and reflect them in /etc/os-release.

Just to make sure we are all on the same page:
With this patch, ISAR_RELEASE_CMD is executed in a anonymous function of the image recipe.
By that it runs at bitbake parsing time and sets the variable IMAGE_BUILD_ID to the output of the command.
As this variable is part of the metadata, it must not change during a single bitbake invocation.
Otherwise bitbake reports "metadata is non-deterministic".

However, it is perfectly fine to change the value across builds (e.g. incremental ones and even without a single modification to a recipe).
That will become relevant once SState is enabled:
In case the rootfs is cached, the ISAR_RELEASE_CMD was not executed again, leading to invalid information in /etc/os-release (e.g. by missing a tag).
This is fixed by the patch.

> 
> Workarounds are to tag more often or to clone deeper. I am not sure git
> describe can be told how many commits to consider in the past. So its output
> might simply differ depending on how deep you cloned.

What you describe here is just about unexpected results in /etc/os-release, because the expected git tag is not in the history.
That's a different story and cannot be addressed by ISAR, but only by the user.

Felix

> 
> Henning

      reply	other threads:[~2021-11-18  8:36 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 11:05 Felix Moessbauer
2021-11-04 11:05 ` [PATCH v4 1/2] always invoke ISAR_RELEASE_CMD to invalidate downstream tasks on change Felix Moessbauer
2021-11-04 11:05 ` [PATCH v4 2/2] Ensure generation of /etc/os-release is idempotent Felix Moessbauer
2021-11-04 13:12 ` [PATCH v4 0/2] Improve handling of ISAR_RELEASE_CMD Henning Schild
2021-11-16 18:09 ` Anton Mikanovich
2021-11-17 10:45   ` Moessbauer, Felix
2021-11-17 13:05     ` Anton Mikanovich
2021-11-17 15:57       ` Moessbauer, Felix
2021-11-17 16:39         ` Baurzhan Ismagulov
2021-11-22 15:28         ` Anton Mikanovich
2021-11-24  9:30           ` Schmidt, Adriaan
2021-11-24 10:15             ` Moessbauer, Felix
2021-11-24 11:25               ` Jan Kiszka
2021-11-24 11:54                 ` Anton Mikanovich
2021-11-24 12:11               ` Henning Schild
2021-11-29  9:09                 ` Anton Mikanovich
2021-11-29  9:50                   ` Henning Schild
2021-11-29  9:55                     ` Anton Mikanovich
2021-11-29 13:04                   ` Anton Mikanovich
2021-11-29 13:18                     ` Henning Schild
2021-11-29 14:20                       ` Anton Mikanovich
2021-11-30 10:03                         ` Moessbauer, Felix
2021-12-01 10:39                           ` Anton Mikanovich
2021-12-02 14:55                           ` Anton Mikanovich
2021-12-03  9:51                             ` Moessbauer, Felix
2021-11-24 11:53             ` Anton Mikanovich
2021-11-24 12:35             ` Henning Schild
2021-11-24 12:52               ` Anton Mikanovich
2021-11-17 16:54       ` Henning Schild
2021-11-18  8:36         ` Moessbauer, Felix [this message]

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=AM9PR10MB4869A2EEF832E4CD925171F9899B9@AM9PR10MB4869.EURPRD10.PROD.OUTLOOK.COM \
    --to=felix.moessbauer@siemens.com \
    --cc=amikan@ilbers.de \
    --cc=henning.schild@siemens.com \
    --cc=ibr@radix50.net \
    --cc=isar-users@googlegroups.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