summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-12 16:46:37 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2025-06-16 17:57:29 +0100
commitd5d35a27b4c46dbdb58ffc42dbdbbce21e433f81 (patch)
treec272fbec3aa7d3b051c81a5ab0e4b225f39f6d5f
parentc5d7c7a23056dc67c4f6c6851169662a9696c5d3 (diff)
downloadpoky-d5d35a27b4c46dbdb58ffc42dbdbbce21e433f81.tar.gz
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>
-rw-r--r--meta/conf/bitbake.conf8
-rw-r--r--meta/lib/oe/package.py3
-rw-r--r--meta/lib/oe/packagedata.py3
-rw-r--r--meta/lib/oe/path.py3
-rw-r--r--meta/lib/oe/sstatesig.py2
-rw-r--r--meta/lib/oe/utils.py5
6 files changed, 15 insertions, 9 deletions
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 ??= ""
987# support unihashes. 987# support unihashes.
988BB_UNIHASH ?= "${BB_TASKHASH}" 988BB_UNIHASH ?= "${BB_TASKHASH}"
989 989
990oe.sstatesig.find_sstate_manifest[vardepsexclude] = "BBEXTENDCURR BBEXTENDVARIANT OVERRIDES PACKAGE_EXTRA_ARCHS"
991oe.utils.get_multilib_datastore[vardepsexclude] = "DEFAULTTUNE_MULTILIB_ORIGINAL OVERRIDES"
992oe.path.format_display[vardepsexclude] = "TOPDIR"
993oe.utils.get_bb_number_threads[vardepsexclude] = "BB_NUMBER_THREADS"
994oe.package.save_debugsources_info[vardepsexclude] = "BB_NUMBER_THREADS"
995oe.package.read_debugsources_info[vardepsexclude] = "BB_NUMBER_THREADS"
996oe.packagedata.emit_pkgdata[vardepsexclude] = "BB_NUMBER_THREADS"
997oe.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
16import subprocess 16import subprocess
17import shutil 17import shutil
18 18
19import bb.parse
19import oe.cachedpath 20import oe.cachedpath
20 21
21def runstrip(file, elftype, strip, extra_strip_sections=''): 22def runstrip(file, elftype, strip, extra_strip_sections=''):
@@ -1049,6 +1050,7 @@ def copydebugsources(debugsrcdir, sources, d):
1049 if os.path.exists(p) and not os.listdir(p): 1050 if os.path.exists(p) and not os.listdir(p):
1050 os.rmdir(p) 1051 os.rmdir(p)
1051 1052
1053@bb.parse.vardepsexclude("BB_NUMBER_THREADS")
1052def save_debugsources_info(debugsrcdir, sources_raw, d): 1054def save_debugsources_info(debugsrcdir, sources_raw, d):
1053 import json 1055 import json
1054 import bb.compress.zstd 1056 import bb.compress.zstd
@@ -1081,6 +1083,7 @@ def save_debugsources_info(debugsrcdir, sources_raw, d):
1081 with bb.compress.zstd.open(debugsources_file, "wt", encoding="utf-8", num_threads=num_threads) as f: 1083 with bb.compress.zstd.open(debugsources_file, "wt", encoding="utf-8", num_threads=num_threads) as f:
1082 json.dump(sources_dict, f, sort_keys=True) 1084 json.dump(sources_dict, f, sort_keys=True)
1083 1085
1086@bb.parse.vardepsexclude("BB_NUMBER_THREADS")
1084def read_debugsources_info(d): 1087def read_debugsources_info(d):
1085 import json 1088 import json
1086 import bb.compress.zstd 1089 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 @@
7import codecs 7import codecs
8import os 8import os
9import json 9import json
10import bb.parse
10import bb.compress.zstd 11import bb.compress.zstd
11import oe.path 12import oe.path
12 13
@@ -64,6 +65,7 @@ def read_subpkgdata_dict(pkg, d):
64 ret[newvar] = subd[var] 65 ret[newvar] = subd[var]
65 return ret 66 return ret
66 67
68@bb.parse.vardepsexclude("BB_NUMBER_THREADS")
67def read_subpkgdata_extended(pkg, d): 69def read_subpkgdata_extended(pkg, d):
68 import json 70 import json
69 import bb.compress.zstd 71 import bb.compress.zstd
@@ -182,6 +184,7 @@ def runtime_mapping_rename(varname, pkg, d):
182 184
183 #bb.note("%s after: %s" % (varname, d.getVar(varname))) 185 #bb.note("%s after: %s" % (varname, d.getVar(varname)))
184 186
187@bb.parse.vardepsexclude("BB_NUMBER_THREADS")
185def emit_pkgdata(pkgfiles, d): 188def emit_pkgdata(pkgfiles, d):
186 def process_postinst_on_target(pkg, mlprefix): 189 def process_postinst_on_target(pkg, mlprefix):
187 pkgval = d.getVar('PKG:%s' % pkg) 190 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
10import subprocess 10import subprocess
11import os.path 11import os.path
12 12
13import bb.parse
14
13def join(*paths): 15def join(*paths):
14 """Like os.path.join but doesn't treat absolute RHS specially""" 16 """Like os.path.join but doesn't treat absolute RHS specially"""
15 return os.path.normpath("/".join(paths)) 17 return os.path.normpath("/".join(paths))
@@ -77,6 +79,7 @@ def replace_absolute_symlinks(basedir, d):
77 os.remove(path) 79 os.remove(path)
78 os.symlink(base, path) 80 os.symlink(base, path)
79 81
82@bb.parse.vardepsexclude("TOPDIR")
80def format_display(path, metadata): 83def format_display(path, metadata):
81 """ Prepare a path for display to the user. """ 84 """ Prepare a path for display to the user. """
82 rel = relative(metadata.getVar("TOPDIR"), path) 85 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 @@
3# 3#
4# SPDX-License-Identifier: GPL-2.0-only 4# SPDX-License-Identifier: GPL-2.0-only
5# 5#
6import bb.parse
6import bb.siggen 7import bb.siggen
7import bb.runqueue 8import bb.runqueue
8import oe 9import oe
@@ -493,6 +494,7 @@ def sstate_get_manifest_filename(task, d):
493 d2.setVar("SSTATE_MANMACH", extrainf) 494 d2.setVar("SSTATE_MANMACH", extrainf)
494 return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2) 495 return (d2.expand("${SSTATE_MANFILEPREFIX}.%s" % task), d2)
495 496
497@bb.parse.vardepsexclude("BBEXTENDCURR", "BBEXTENDVARIANT", "OVERRIDES", "PACKAGE_EXTRA_ARCHS")
496def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache): 498def find_sstate_manifest(taskdata, taskdata2, taskname, d, multilibcache):
497 d2 = d 499 d2 = d
498 variant = '' 500 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
9import traceback 9import traceback
10import errno 10import errno
11 11
12import bb.parse
13
12def read_file(filename): 14def read_file(filename):
13 try: 15 try:
14 f = open( filename, "r" ) 16 f = open( filename, "r" )
@@ -265,6 +267,7 @@ def execute_pre_post_process(d, cmds):
265 bb.note("Executing %s ..." % cmd) 267 bb.note("Executing %s ..." % cmd)
266 bb.build.exec_func(cmd, d) 268 bb.build.exec_func(cmd, d)
267 269
270@bb.parse.vardepsexclude("BB_NUMBER_THREADS")
268def get_bb_number_threads(d): 271def get_bb_number_threads(d):
269 return int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1) 272 return int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1)
270 273
@@ -467,7 +470,7 @@ def host_gcc_version(d, taskcontextonly=False):
467 version = match.group(1) 470 version = match.group(1)
468 return "-%s" % version if version in ("4.8", "4.9") else "" 471 return "-%s" % version if version in ("4.8", "4.9") else ""
469 472
470 473@bb.parse.vardepsexclude("DEFAULTTUNE_MULTILIB_ORIGINAL", "OVERRIDES")
471def get_multilib_datastore(variant, d): 474def get_multilib_datastore(variant, d):
472 localdata = bb.data.createCopy(d) 475 localdata = bb.data.createCopy(d)
473 if variant: 476 if variant: