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.

(From OE-Core rev: e522169c5f95de6fc74b43672573700d8eb8e082)

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Richard Purdie
2025-06-12 16:46:37 +01:00
parent c5d7c7a230
commit d5d35a27b4
6 changed files with 15 additions and 9 deletions

View File

@@ -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"

View File

@@ -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

View File

@@ -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)

View File

@@ -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)

View File

@@ -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 = ''

View File

@@ -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: