[yocto] Mercurial fetcher doesn't work for me (patch included)

Aaron Cohen aaron at assonance.org
Mon Nov 26 12:34:27 PST 2018


I'm trying to write a recipe for a local repo that is kept in mercurial,
and encountering the following problem:


> Traceback (most recent call last):
>   File "/home/joel-cohen/code/waveos2/poky/bitbake/lib/bb/data_smart.py",
> line 808, in DataSmart.getVarFlag(var='PV', flag='_content', expand=True,
> noweakdefault=False, parsing=False, retparser=False):
>              if expand or retparser:
>     >            parser = self.expandWithRefs(value, cachename)
>              if expand:
>   File "/home/joel-cohen/code/waveos2/poky/bitbake/lib/bb/data_smart.py",
> line 416, in DataSmart.expandWithRefs(s='0.0.4+git${SRCPV}', varname='PV'):
>                  try:
>     >                s = __expand_var_regexp__.sub(varparse.var_sub, s)
>                      try:
>   File "/home/joel-cohen/code/waveos2/poky/bitbake/lib/bb/data_smart.py",
> line 108, in VariableParse.var_sub(match=<_sre.SRE_Match object; span=(9,
> 17), match='${SRCPV}'>):
>                          raise Exception("variable %s references itself!"
> % self.varname)
>     >            var = self.d.getVarFlag(key, "_content")
>                  self.references.add(key)
>   File "/home/joel-cohen/code/waveos2/poky/bitbake/lib/bb/data_smart.py",
> line 808, in DataSmart.getVarFlag(var='SRCPV', flag='_content',
> expand=True, noweakdefault=False, parsing=False, retparser=False):
>              if expand or retparser:
>     >            parser = self.expandWithRefs(value, cachename)
>              if expand:
>   File "/home/joel-cohen/code/waveos2/poky/bitbake/lib/bb/data_smart.py",
> line 430, in DataSmart.expandWithRefs(s='${@bb.fetch2.get_srcrev(d)}',
> varname='SRCPV'):
>                  except Exception as exc:
>     >                raise ExpansionError(varname, s, exc) from exc
>
> bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression
> was ${@bb.fetch2.get_srcrev(d)} which triggered exception AttributeError:
> 'FetchData' object has no attribute 'moddir'


I've fixed this with the following patch, which moves some code in the Hg
fetcher to later in the urldata_init method, after some necessary variables
have been initialized. I'm not sure if I'm alone in seeing this problem or
not?

Thanks for any help,
Aaron
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20181126/82c84af7/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: poky.patch
Type: text/x-patch
Size: 1073 bytes
Desc: not available
URL: <http://lists.yoctoproject.org/pipermail/yocto/attachments/20181126/82c84af7/attachment.bin>


More information about the yocto mailing list