[OE-core] Modifying SRC_URI from anonymous python
Andre McCurdy
armccurdy at gmail.com
Thu Nov 17 21:28:54 UTC 2016
I have a supplier who provides recipes which set SRC_URI to their
private git servers. To make those same recipes usable by others (ie
me), some anonymous python is used to transform the default SRC_URI
(elements which contain private git URLs are replaced, patches and
other files are left as-is).
This apparently worked in OE 2.0 but from 2.1 onwards the anonymous
python which modifies SRC_URI races with the anonymous python in
base.bbclass which parses SRC_URI to determine additional
do_fetch/do_unpack dependencies and whether or not to call
fetch2.get_srcrev(). Specifically I get failures because
fetch2.get_srcrev() sees the original SRC_URI and tries to resolve
AUTOREV from a repo to which I don't have access.
The proposed solution from the supplier is this patch to base.bbclass:
@@ -598,7 +598,7 @@ python () {
d.appendVarFlag('do_unpack', 'depends', '
file-native:do_populate_sysroot')
if needsrcrev:
- d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}")
+ d.setVar("SRCPV", "${@bb.fetch2.get_srcrev(d)}", parsing=True)
set_packagetriplet(d)
After reading the setVar source I'm not very clear how or why this
works, but it looks dubious. What is parsing=True intended to do?
Is it documented somewhere that modifying SRC_URI from anonymous
python isn't allowed? I've now seen two suppliers both independently
run into the same problem when updating to OE 2.1.
More information about the Openembedded-core
mailing list