All of lore.kernel.org
 help / color / mirror / Atom feed
* Custom DISTRO_VERSION with git describe
@ 2022-04-28 11:04 Ayoub Zaki
  2022-04-28 11:15 ` [yocto] " Mikko.Rapeli
  0 siblings, 1 reply; 6+ messages in thread
From: Ayoub Zaki @ 2022-04-28 11:04 UTC (permalink / raw)
  To: yocto

[-- Attachment #1: Type: text/plain, Size: 2046 bytes --]

hello,


I would like to have a custom DISTRO_VERSION based on "git describe" of my
layer:


1) In my layer meta-mylayer/conf/layer.conf, I defined the following:

# Set variable to get the location of the layer
> MY_LAYER_BASE := '${LAYERDIR}'



2) I created a my_distro_version.bbclass with following:

def my_distro_version(d):
>     import subprocess
>     project_path = d.getVar('MY_LAYER_BASE', True)
>     cmd = "git describe --tags"
>     proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True,
> cwd=project_path)
>     out, err =  proc.communicate()
>     return out.decode("utf-8").rstrip()


3)  Then I inherited it my  meta-mylayer/conf/distro/my_distro.conf :

INHERIT += "my_distro_version"
> DISTRO_VERSION = "${@my_distro_version(d)}"


>

so far so good I can see that DISTRO_VERSION is following the git describe :


NOTE: Resolving any missing task queue dependencies

MACHINE = "beaglebone-yocto"
> DISTRO = "my-distro"
> DISTRO_VERSION = "v1.4-rc14"
> TUNE_FEATURES = "arm vfp cortexa8 neon callconvention-hard"
> TARGET_FPU = "hard"
> meta-mylayer = "HEAD:ca8a5390db5e5280c3b178097ad36900c97160a8"
> meta-swupdate = "HEAD:2e08de8582aa18871657ea8283ea35a050927d4f"
> meta-qt5 = "HEAD:6bfe29d9e8fdd5c2fd17c736814b6df859b3af50"



But I'm getting a lot of errors :



the basehash value changed from
efc66702573a04ced9af3be8902d643f8709969ad8cdf19b822e9bd14910c755 to
d24664027a632185bda9807951586efdf9b9160bb7cef2524d7c9d577cc6f527. The
metadata is not deterministic and this needs to be fixed.
> ERROR: The following commands may help:
> ERROR: $ bitbake my-image -cdo_image_wic -Snone
> ERROR: Then:
> ERROR: $ bitbake my-image -cdo_image_wic -Sprintdiff



and some of the recipes don't get the right  DISTRO_VERSION.

probably a multi processing problem in yocto since I used

INHERIT += "my_distro_version" all recipes will want to execute
DISTRO_VERSION = "${@my_distro_version(d)}".



I didn't find a way to get  DISTRO_VERSION =
"${@my_distro_version(d)}" executed only once!


Any suggestions ?


Thanks

[-- Attachment #2: Type: text/html, Size: 5406 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2022-04-28 11:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-28 11:04 Custom DISTRO_VERSION with git describe Ayoub Zaki
2022-04-28 11:15 ` [yocto] " Mikko.Rapeli
2022-04-28 11:25   ` Ayoub Zaki
2022-04-28 11:32     ` Mikko.Rapeli
2022-04-28 11:38       ` Ayoub Zaki
2022-04-28 11:52         ` Mikko.Rapeli

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.