Hi Richard, That makes much more sense, thank you. Setting BB_FETCH_REQUIRE_DETERMINISM as a per-layer flag in OE-core and having BitBake enforce it is a cleaner approach than catching FetchError in setup_revisions().
could you please point me to where in BitBake the network access would be triggered so I know the right place to check this flag? I believe it would be in latest_revision() or srcrev_internal_helper(), but I want to confirm before implementing. Best regards, Sai Sneha On Tue, 9 Jun 2026 at 2:58 PM, Richard Purdie < [email protected]> wrote: > On Tue, 2026-06-09 at 14:49 +0530, Sai Sneha via lists.openembedded.org > wrote: > > Following up on the suggestions to fix this in the BitBake > fetchers using supports_srcrev(), I have tried implementing that > approach locally. Here is what I did and how it works. > > The fix has two parts: > > Part 1 — BitBake fix (prevent parse crash): > The crash happens in setup_revisions() when srcrev_internal_helper() > raises a FetchError for missing SRCREV. This propagates up through > expandWithRefs() as an ExpansionError which halts parsing for all > recipes. The fix catches FetchError in setup_revisions() and sets > a missing_srcrev flag on the FetchData object: > > def setup_revisions(self, d): > try: > self.revision = srcrev_internal_helper(self, d, self.name) > except FetchError: > self.revision = None > self.missing_srcrev = True > > git.py and hg.py also needed a guard to prevent calling > latest_revision() when missing_srcrev is set, since that would > trigger a live network fetch under BB_NO_NETWORK=1. > > > That is going to break some of our other protections for invalid SRCREV > setups and swallow other errors. > > How about instead we set a flag in OE-Core on a per layer basis: > > BB_FETCH_REQUIRE_DETERMINISM:layer-core = "1" > > and this simply changes the fetcher behaviour to error if it would touch > the network? > > Cheers, > > Richard >
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#238284): https://lists.openembedded.org/g/openembedded-core/message/238284 Mute This Topic: https://lists.openembedded.org/mt/119719972/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
