From 143103a1c457ebfd4fe088cc5d8233b934d3e2a9 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Tue, 11 Mar 2025 08:03:02 -0600 Subject: lib: Fix dependencies on SPDX code The SPDX library code was being ignored from taskhash calculations due to accidentally being omitted from BBIMPORTS. This meant that changes in the code or dependent variables would not cause the task to rebuild correctly. In order to add spdx_common, convert the `Dep` object from a named tuple to a frozen dataclass. These function more or less equivalently, but the bitbake code parser cannot handle named tuples. Finally, the vardepsexclude that used to be present on the recipe tasks needs to be moved to the python code in order for the variables to be correctly ignored. Several unused exclusions were removed (From OE-Core rev: eb597bf61cbcb0a4d43149404c93eec0894fb4c7) Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- meta/lib/oe/__init__.py | 2 +- meta/lib/oe/spdx_common.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'meta/lib/oe') diff --git a/meta/lib/oe/__init__.py b/meta/lib/oe/__init__.py index d760481283..3179a3f3d2 100644 --- a/meta/lib/oe/__init__.py +++ b/meta/lib/oe/__init__.py @@ -11,4 +11,4 @@ __path__ = extend_path(__path__, __name__) # processed correctly (e.g. qa) BBIMPORTS = ["qa", "data", "path", "utils", "types", "package", "packagedata", \ "packagegroup", "sstatesig", "lsb", "cachedpath", "license", \ - "reproducible", "rust", "buildcfg", "go"] + "reproducible", "rust", "buildcfg", "go", "spdx30_tasks", "spdx_common"] diff --git a/meta/lib/oe/spdx_common.py b/meta/lib/oe/spdx_common.py index 23a17271d6..e1b26edaaf 100644 --- a/meta/lib/oe/spdx_common.py +++ b/meta/lib/oe/spdx_common.py @@ -12,7 +12,7 @@ import re import shutil from pathlib import Path - +from dataclasses import dataclass LIC_REGEX = re.compile( rb"^\W*SPDX-License-Identifier:\s*([ \w\d.()+-]+?)(?:\s+\W*)?$", @@ -77,7 +77,11 @@ def process_sources(d): return True -Dep = collections.namedtuple("Dep", ["pn", "hashfn", "in_taskhash"]) +@dataclass(frozen=True) +class Dep(object): + pn: str + hashfn: str + in_taskhash: bool def collect_direct_deps(d, dep_task): -- cgit v1.2.3-54-g00ecf