From: Richard Purdie Date: Thu, 12 Jun 2025 15:46:37 +0000 (+0100) Subject: lib/oe: Move vardepexclude entries alongside functions X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e522169c5f95de6fc74b43672573700d8eb8e082;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git lib/oe: Move vardepexclude entries alongside functions Now we have decorators that can do this, move the variable dependencies exclusions alongside the code that needs them for maintainability. Signed-off-by: Richard Purdie --- diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf index e600d9d774..8686c0a25f 100644 --- a/meta/conf/bitbake.conf +++ b/meta/conf/bitbake.conf @@ -987,11 +987,3 @@ MULTILIB_VARIANTS ??= "" # support unihashes. BB_UNIHASH ?= "${BB_TASKHASH}" -oe.sstatesig.find_sstate_manifest[vardepsexclude] = "BBEXTENDCURR BBEXTENDVARIANT OVERRIDES PACKAGE_EXTRA_ARCHS" -oe.utils.get_multilib_datastore[vardepsexclude] = "DEFAULTTUNE_MULTILIB_ORIGINAL OVERRIDES" -oe.path.format_display[vardepsexclude] = "TOPDIR" -oe.utils.get_bb_number_threads[vardepsexclude] = "BB_NUMBER_THREADS" -oe.package.save_debugsources_info[vardepsexclude] = "BB_NUMBER_THREADS" -oe.package.read_debugsources_info[vardepsexclude] = "BB_NUMBER_THREADS" -oe.packagedata.emit_pkgdata[vardepsexclude] = "BB_NUMBER_THREADS" -oe.packagedata.read_subpkgdata_extended[vardepsexclude] = "BB_NUMBER_THREADS" diff --git a/meta/lib/oe/package.py b/meta/lib/oe/package.py index 60392cbced..ce69151e5d 100644 --- a/meta/lib/oe/package.py +++ b/meta/lib/oe/package.py @@ -16,6 +16,7 @@ import mmap import subprocess import shutil +import bb.parse import oe.cachedpath def runstrip(file, elftype, strip, extra_strip_sections=''): @@ -1049,6 +1050,7 @@ def copydebugsources(debugsrcdir, sources, d): if os.path.exists(p) and not os.listdir(p): os.rmdir(p) +@bb.parse.vardepsexclude("BB_NUMBER_THREADS") def save_debugsources_info(debugsrcdir, sources_raw, d): import json import bb.compress.zstd @@ -1081,6 +1083,7 @@ def save_debugsources_info(debugsrcdir, sources_raw, d): with bb.compress.zstd.open(debugsources_file, "wt", encoding="utf-8", num_threads=num_threads) as f: json.dump(sources_dict, f, sort_keys=True) +@bb.parse.vardepsexclude("BB_NUMBER_THREADS") def read_debugsources_info(d): import json import bb.compress.zstd diff --git a/meta/lib/oe/packagedata.py b/meta/lib/oe/packagedata.py index 2d1d6ddeb7..b6a10a930a 100644 --- a/meta/lib/oe/packagedata.py +++ b/meta/lib/oe/packagedata.py @@ -7,6 +7,7 @@ import codecs import os import json +import bb.parse import bb.compress.zstd import oe.path @@ -64,6 +65,7 @@ def read_subpkgdata_dict(pkg, d): ret[newvar] = subd[var] return ret +@bb.parse.vardepsexclude("BB_NUMBER_THREADS") def read_subpkgdata_extended(pkg, d): import json import bb.compress.zstd @@ -182,6 +184,7 @@ def runtime_mapping_rename(varname, pkg, d): #bb.note("%s after: %s" % (varname, d.getVar(varname))) +@bb.parse.vardepsexclude("BB_NUMBER_THREADS") def emit_pkgdata(pkgfiles, d): def process_postinst_on_target(pkg, mlprefix): pkgval = d.getVar('PKG:%s' % pkg) diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py index 5d21cdcbdf..a1efe97d88 100644 --- a/meta/lib/oe/path.py +++ b/meta/lib/oe/path.py @@ -10,6 +10,8 @@ import shutil import subprocess import os.path +import bb.parse + def join(*paths): """Like os.path.join but doesn't treat absolute RHS specially""" return os.path.normpath("/".join(paths)) @@ -77,6 +79,7 @@ def replace_absolute_symlinks(basedir, d): os.remove(path) os.symlink(base, path) +@bb.parse.vardepsexclude("TOPDIR") def format_display(path, metadata): """ Prepare a path for display to the user. """ rel = relative(metadata.getVar("TOPDIR"), path) diff --git a/meta/lib/oe/sstatesig.py b/meta/lib/oe/sstatesig.py index 826549948e..ef687f5d41 100644 --- a/meta/lib/oe/sstatesig.py +++ b/meta/lib/oe/sstatesig.py @@ -3,6 +3,7 @@ # # SPDX-License-Identifier: GPL-2.0-only # +import bb.parse import bb.siggen import bb.runqueue import oe @@ -493,6 +494,7 @@ def sstate_get_manifest_filename(task, d): d2.setVar("SSTATE_MANMACH", extrainf) return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2) +@bb.parse.vardepsexclude("BBEXTENDCURR", "BBEXTENDVARIANT", "OVERRIDES", "PACKAGE_EXTRA_ARCHS") def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache): d2 = d variant = '' diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py index d272dd2b8d..a11db5f3cd 100644 --- a/meta/lib/oe/utils.py +++ b/meta/lib/oe/utils.py @@ -9,6 +9,8 @@ import multiprocessing import traceback import errno +import bb.parse + def read_file(filename): try: f = open( filename, "r" ) @@ -265,6 +267,7 @@ def execute_pre_post_process(d, cmds): bb.note("Executing %s ..." % cmd) bb.build.exec_func(cmd, d) +@bb.parse.vardepsexclude("BB_NUMBER_THREADS") def get_bb_number_threads(d): return int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1) @@ -467,7 +470,7 @@ def host_gcc_version(d, taskcontextonly=False): version = match.group(1) return "-%s" % version if version in ("4.8", "4.9") else "" - +@bb.parse.vardepsexclude("DEFAULTTUNE_MULTILIB_ORIGINAL", "OVERRIDES") def get_multilib_datastore(variant, d): localdata = bb.data.createCopy(d) if variant: