On 22/01/2020 17.39, Rasmus Villemoes via Lists.Yoctoproject.Org wrote:
> On 22/01/2020 16.50, Richard Purdie wrote:
>> On Wed, 2020-01-22 at 15:46 +0000, Rasmus Villemoes wrote:
>>> On 22/01/2020 15.35, Richard Purdie wrote:
>>>> Bitbake can only detect direct references to variables. The code
>>>> above only runs at configure time, not at parse time so its not
>>>> really surprising that bitbake can't know what its doing.
>>>
>>> Well, I thought that as well at first. But there must be something
>>> done at run-time to feed back the variable dependencies, because if I
>>> add a completely dumb
>>>
>>> python do_configure() {
>>>     import fileinput
>>> +    d.getVar("VARIABLE") # silly
>>>     with open("foo.txt", "w") as out:
>>>         for line in
>>> fileinput.input(files=d.getVar("FOO_INPUT").split()):
>>>             line = d.expand(line)
>>>             out.write(line)
>>> }
>>>
> So thinking out loud (and apologies if this is very silly): Would it be
> possible to implement some auto-deps class

Alternatively, as I will only need this for files I provide via file://
SRC_URIs, perhaps that fetcher could be taught a ";varexpand=1"
parameter. Bitbake must be doing md5sum or similar on local files anyway
(? how else are changes in those detected), so having varexpand=1 mean
"grep all ${foo} references and add foo to do_unpack[vardeps]" during
parsing shouldn't add that much.

And of course having bitbake automatically actually do the expansion as
part of placing the file in WORKDIR means one can avoid that logic
altogether in the recipe (so my do_configure could become a simple shell
function that does "cat ${FOO_INPUT} > foo.txt").

Rasmus
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#48088): https://lists.yoctoproject.org/g/yocto/message/48088
Mute This Topic: https://lists.yoctoproject.org/mt/69979676/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to