From: Anuj Mittal <anuj.mittal@intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [honister][PATCH] crate-fetch: fix setscene failures
Date: Thu, 24 Mar 2022 19:02:56 +0800 [thread overview]
Message-ID: <20220324110256.6989-1-anuj.mittal@intel.com> (raw)
From: Richard Purdie <richard.purdie@linuxfoundation.org>
In sstate.bbclass, when fetching an sstate object we have:
pstaging_fetch(sstatefetch, d):
[...]
localdata.setVar('SRCPV', d.getVar('SRCPV'))
i.e. some code which expands SRCPV before it changes SRC_URI for the sstate
tarball fetching. In crate-fetch.bbclass we have:
def import_crate(d):
import crate
if not getattr(crate, 'imported', False):
bb.fetch2.methods.append(crate.Crate())
crate.imported = True
def crate_get_srcrev(d):
import_crate(d)
return bb.fetch2.get_srcrev(d)
SRCPV = "${@crate_get_srcrev(d)}"
and so an "import crate" occurs when pstating_fetch() is called. That succeeds
and all is well but the bb.fetch2.get_srcrev(d) call fails since there is no url
in SRC_URI which supports srcrev() resulting in:
| WARNING: rust-cross-core2-32-musl-1.54.0-r0 do_deploy_source_date_epoch_setscene: ExpansionError('SRCPV', '${@crate_get_srcrev(d)}', FetchError('SRCREV was used yet no valid SCM was found in SRC_URI', None))
| WARNING: Logfile for failed setscene task is /home/pokybuild/yocto-worker/musl-qemux86/build/build/tmp/work/x86_64-linux/rust-cross-core2-32-musl/1.54.0-r0/temp/log.do_deploy_source_date_epoch_setscene.3133099
| WARNING: Setscene task (/home/pokybuild/yocto-worker/musl-qemux86/build/meta/recipes-devtools/rust/rust-cross_1.54.0.bb:do_deploy_source_date_epoch_setscene) failed with exit code '1' - real task will be run instead
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
---
meta/classes/crate-fetch.bbclass | 3 +++
1 file changed, 3 insertions(+)
diff --git a/meta/classes/crate-fetch.bbclass b/meta/classes/crate-fetch.bbclass
index a7fa22b2a0..04d76c0de8 100644
--- a/meta/classes/crate-fetch.bbclass
+++ b/meta/classes/crate-fetch.bbclass
@@ -22,6 +22,9 @@ crate_import_handler[eventmask] = "bb.event.RecipePreFinalise"
def crate_get_srcrev(d):
import_crate(d)
+ srcuri = d.getVar("SRC_URI")
+ if "crate://" not in srcuri and "git://" not in srcuri:
+ return "Invalid"
return bb.fetch2.get_srcrev(d)
# Override SRCPV to make sure it imports the fetcher first
--
2.35.1
reply other threads:[~2022-03-24 11:03 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220324110256.6989-1-anuj.mittal@intel.com \
--to=anuj.mittal@intel.com \
--cc=openembedded-core@lists.openembedded.org \
/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