From d3fe8522c81f9ee54c81383a570880a9ce3f4b88 Mon Sep 17 00:00:00 2001 From: rpone Date: Sun, 1 Nov 2026 11:11:03 +0800 Subject: [PATCH] fix(source-drivers): a pending kernel link defers the export check The report read the linked kernel's exports, but a clean tree links the kernel only after the archive builders have run (the bootstrap pass stops at the link by design), so the step failed on a fresh checkout. The report now names the pending pass; the final kernel link remains the unresolved check. --- scripts/build-sheng-source-drivers.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/scripts/build-sheng-source-drivers.py b/scripts/build-sheng-source-drivers.py index 0969bc0..5d09ae7 100644 --- a/scripts/build-sheng-source-drivers.py +++ b/scripts/build-sheng-source-drivers.py @@ -180,7 +180,11 @@ def main(): family_flags = ['-I', str(storage), '-I', str(generated), '-Wno-error'] components['IOStorageFamily'] = [(storage / (name + '.cpp'), family_flags) for name in names] components['IOStorageFamily'].append((implementation, family_flags)) - kernel_exports = nm(kernel, '-gU') + # A first build from a clean tree links the kernel only after the archive builders have + # run (the bootstrap pass stops at the link by design); the final kernel link is then the + # unresolved check. The report names the pending pass instead of listing every import. + kernel_linked = kernel.is_file() + kernel_exports = nm(kernel, '-gU') if kernel_linked else None entries = {} for component, sources in components.items(): objects, details = [], [] @@ -230,13 +234,14 @@ def main(): Path(__file__), ROOT / 'scripts/prepare-storage-headers.py', ROOT / 'scripts/kernel_target.py')}, target=target.TRIPLE, recipe=str(recipe), recipe_sha256=sha(recipe), c_recipe=str(c_recipe), c_recipe_sha256=sha(c_recipe), - kernel=str(kernel), kernel_sha256=sha(kernel), + kernel=str(kernel), kernel_sha256=sha(kernel) if kernel_linked else None, + kernel_export_pass='linked' if kernel_linked else 'pending-final-link', source_pins={name: pins[name] for name in ('IOStorageFamily', 'IOHIDFamily')}, sdk=str(sdk), components=entries, storage_family_iig=generation, touch_firmware=dict(path=str(firmware), sha256=sha(firmware), size=len(data)), partial_link=dict(object=str(partial), sha256=sha(partial), passed=True), - unresolved_after_native_kernel=sorted(nm(partial, '-u') - kernel_exports), + unresolved_after_native_kernel=(sorted(nm(partial, '-u') - kernel_exports) if kernel_exports is not None else []), compile_pass=True, link_qualified=False, runtime_qualified=False, edge_gestures_qualified=False, limitations=['Family imports have no target binding in this build.',