summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/fetch2/git.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-21 14:48:11 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-03-22 13:57:04 +0000
commit04c27888d05e16791cfb5ebc3b51f9f02923775b (patch)
treea7e732b52f22cd44bfb9332e908ce6a6d71c30e9 /bitbake/lib/bb/fetch2/git.py
parent2b8761e5fc0cbef8e43a2246450098e9b48413c0 (diff)
downloadpoky-04c27888d05e16791cfb5ebc3b51f9f02923775b.tar.gz
bitbake: fetch2: Add autorev warning when it is set too late
Bitbake expects a consistent metadata environment when it parses. There are plenty of ways you can set a recipe to autorev at a point where parts of the fetcher have already been triggered leading to obsure bugs which I struggled to debug, let alone anyone not familar with the code. If anyone is running into the message from the commit, the issue is likely one of timing. Keep in mind that the anonymous python code in base.bbclass will expand variables like FILESPATH, WORKDIR and others which contain PV. The recipe needs to be set to AUTOREV before that anonymous python runs. In particular, that means you can't set SRCREV = "${AUTOREV}" in other anonymous python, it needs to happen earlier. (Bitbake rev: 4d9ec332d5bfc8b60b54f8ec2a17d34e35aa903a) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/fetch2/git.py')
-rw-r--r--bitbake/lib/bb/fetch2/git.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 66c2a7e540..d0d68538e2 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -737,7 +737,7 @@ class Git(FetchMethod):
737 raise bb.fetch2.FetchError("Recipe uses a floating tag/branch '%s' for repo '%s' without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE)." % (ud.unresolvedrev[name], ud.host+ud.path)) 737 raise bb.fetch2.FetchError("Recipe uses a floating tag/branch '%s' for repo '%s' without a fixed SRCREV yet doesn't call bb.fetch2.get_srcrev() (use SRCPV in PV for OE)." % (ud.unresolvedrev[name], ud.host+ud.path))
738 738
739 # Ensure we mark as not cached 739 # Ensure we mark as not cached
740 bb.fetch2.get_autorev(d) 740 bb.fetch2.mark_recipe_nocache(d)
741 741
742 output = self._lsremote(ud, d, "") 742 output = self._lsremote(ud, d, "")
743 # Tags of the form ^{} may not work, need to fallback to other form 743 # Tags of the form ^{} may not work, need to fallback to other form