Date
1 - 6 of 6
Custom DISTRO_VERSION with git describe
Ayoub Zaki
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 2) I created a my_distro_version.bbclass with following: def my_distro_version(d): 3) Then I inherited it my meta-mylayer/conf/distro/my_distro.conf : INHERIT += "my_distro_version" so far so good I can see that DISTRO_VERSION is following the git describe : MACHINE = "beaglebone-yocto" 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. 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
|
|
Mikko Rapeli
Hi,
On Thu, Apr 28, 2022 at 01:04:22PM +0200, Ayoub Zaki via lists.yoctoproject.org wrote: hello,I would also add --always and --dirty to be sure non-tagged clones of repo work and builds with local modifications get marked as such. DISTRO_VERSION := "${@my_distro_version(d)}"proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, That should do it :) Cheers, -Mikko
|
|
Ayoub Zaki
Hi, thanks for the quick reply I tried your suggestion but I get: Traceback (most recent call last): File "Var <DISTRO_VERSION[:=]>", line 1, in <module> bb.data_smart.ExpansionError: Failure expanding variable DISTRO_VERSION[:=], expression was ${@my_distro_version(d)} which triggered exception NameError: name 'my_distro_version' is not defined I think in this case the INHERIT doesn't work ! Best regards,
On Thu, Apr 28, 2022 at 1:15 PM <Mikko.Rapeli@...> wrote: Hi,
|
|
Mikko Rapeli
On Thu, Apr 28, 2022 at 01:25:03PM +0200, Ayoub Zaki wrote:
Hi,Did you include the bbclass? I think in this case the INHERIT doesn't work !Well I have in distro config: require classes/distroversion.bbclass which has a single python function def get_distro_version(d, dirty=True, abbrev=None): which basically calls "git describe --always --dirty --abbrev=8", the last one was added when git versions started behaving differently and breaking reproducibility. And then distro config also has: DISTRO_VERSION := "${@get_distro_version(d)}" This works for me up to yocto 3.1 dunfell at least. Cheers, -Mikko
|
|
Ayoub Zaki
I'm also suing dunfell branch, I did a small modification in my_distro_version.bbclass: def my_distro_version(d): Then in meta-mylayer/conf/distro/my_distro.conf I used: INHERIT += "my_distro_version" It seems to be working now :-) Thank you for the support :-) cheers, On Thu, Apr 28, 2022 at 1:32 PM <Mikko.Rapeli@...> wrote: On Thu, Apr 28, 2022 at 01:25:03PM +0200, Ayoub Zaki wrote:
|
|
Mikko Rapeli
Hi,
On Thu, Apr 28, 2022 at 01:38:35PM +0200, Ayoub Zaki wrote: I'm also suing dunfell branch, I did a small modification inGood! Just a hint that you might want to set SDK_VERSION to the same. Cheers, -Mikko
|
|