All of lore.kernel.org
 help / color / mirror / Atom feed
* Modifying SRC_URI before it is parsed by the fetcher
@ 2026-05-12 14:47 EXT-Antti Gärding
  2026-05-12 15:07 ` [yocto] " Alexander Kanavin
  0 siblings, 1 reply; 15+ messages in thread
From: EXT-Antti Gärding @ 2026-05-12 14:47 UTC (permalink / raw)
  To: yocto@lists.yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 1529 bytes --]

Hi,

I am developing a .bbclass file that modifies SRC_URI of the inheriting recipe before bitbake (in this case, the git fetcher) initializes its internal data structures with that data. Prepended to any task or as a dedicated task before any other tasks is too late, but a Python function declared __anonymous seems to be invoked right after parsing the recipe, which is early enough.

My log prints, however, revealed that such function is invoked not only at that point but also multiple times when building the recipe. I didn't inspect it thoroughly enough to be sure, but I got the impression that it might be invoked once during each task. That is not a critical issue right now, but it makes the logs look weird and requires extra care to make sure that running the function multiple times doesn't have any unwanted side-effects.

Is there any way to have code executed only right after parsing the recipe? In this case, the initialization of the internal data structures which it must precede seems to happen in urldata_init() of class Git in poky/bitbake/lib/bb/fetch2/git.py.

I discovered that there is variable BB_CURRENTTASK which is None on the very first run and contains the name of the current task on other runs. I tried making my function check it and act only when it is None, but that resulted in errors about basehash value having changed and bitbake thus considering the metadata non-deterministic.

Could BB_CURRENTTASK be somehow utilized to achieve what I am trying?


BR,
Antti Gärding

[-- Attachment #2: Type: text/html, Size: 4427 bytes --]

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2026-05-13 15:32 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-12 14:47 Modifying SRC_URI before it is parsed by the fetcher EXT-Antti Gärding
2026-05-12 15:07 ` [yocto] " Alexander Kanavin
2026-05-12 16:05   ` EXT-Antti Gärding
2026-05-12 16:13     ` Quentin Schulz
2026-05-13  6:26       ` EXT-Antti Gärding
2026-05-13  6:38         ` ChenQi
2026-05-13 12:35           ` EXT-Antti Gärding
2026-05-13 12:42             ` Alexander Kanavin
2026-05-13 12:51               ` EXT-Antti Gärding
2026-05-13 13:11       ` EXT-Antti Gärding
2026-05-13 13:51         ` Alexander Kanavin
2026-05-13 14:22           ` EXT-Antti Gärding
2026-05-13 14:35             ` Alexander Kanavin
2026-05-13 15:07               ` EXT-Antti Gärding
2026-05-13 15:32                 ` Quentin Schulz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.