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.
This commit is contained in:
rpone authored and Sharky Wang committed 2026-11-01 11:11:13 +08:00
1 parent 8f63c39ef5
commit d3fe8522c8
1 file changed
+8 -3
+8 -3
View File
@@ -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.',