Skip to content

test/demo: emulate layer-aggregation filesystem + cross-layer dynamic linking (#671) - #673

Merged
Ulrond merged 2 commits into
developfrom
feature/layer-aggregation-test
Jul 5, 2026
Merged

test/demo: emulate layer-aggregation filesystem + cross-layer dynamic linking (#671)#673
Ulrond merged 2 commits into
developfrom
feature/layer-aggregation-test

Conversation

@Ulrond

@Ulrond Ulrond commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Closes #671.

Our Yocto test stages the SDK into a flat sysroot. Real deployment uses the layer-aggregation model (spec): independently-mounted /mw and /vendor layers, each exposing modules via aggregation dirs (lib/, ld.so.conf.d/) of symlinks, wired for dynamic linking through /etc/ld.so.conf.d/<layer>.conf + ldconfig.

What it does

tests/fake-layers/run-fake-layers.sh:

  • stages the binder SDK + HAL interface libs as MW-layer modules (/mw/binder, /mw/halif) with aggregation symlinks + per-module ld.so.conf.d,
  • builds a vendor-layer library that links a HAL lib from the MW layer (the cross-layer dependency),
  • wires /etc/ld.so.conf.d/{mw,vendor}.conf and runs ldconfig,
  • asserts: aggregation symlinks resolve; ldconfig registers the binder+HAL libs via the aggregated ld.so.conf.d; and the vendor lib's MW-provided dependency resolves across layers (nothing "not found").

Doubles as a demo (prints the emulated layer tree; --keep to inspect). No root/mount needed; skips cleanly without ldconfig/ldd/compiler.

Verified

4/4 assertions pass locally (aggregation symlinks, ldconfig registration, cross-layer resolution of libcommon from /vendor/mw).

Relates to #672 (per-layer build model) and #662 (per-layer binder).

…#671)

Add tests/fake-layers/run-fake-layers.sh — models the read-only-layer
deployment (/mw + /vendor) from the directory & dynamic-linking spec, rather
than a flat sysroot: each layer exposes its modules through aggregation
directories (lib/, ld.so.conf.d/) of symlinks, wired via /etc/ld.so.conf.d/
<layer>.conf + ldconfig.

The MW layer provides the binder runtime + HAL interface libs; a vendor-layer
library links a HAL lib from the MW layer; the test asserts the cross-layer
dependency resolves through the ld.so.conf.d aggregation (not rpath / not a
flat sysroot). No root/mount needed — emulated in a work dir, validated with
ldconfig (registration) + ldd (resolution). Doubles as a demo (prints the
layer tree; --keep). Skips cleanly without ldconfig/ldd/compiler.

Verified: 4/4 assertions pass (aggregation symlinks, ldconfig registration,
cross-layer resolution of libcommon from /vendor into /mw).
Copilot AI review requested due to automatic review settings July 3, 2026 09:48
@github-project-automation github-project-automation Bot moved this to Architecture Review Required in halif_aidl Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new on-demand test/demo to model the real layer-aggregation deployment layout (/mw + /vendor) and validate dynamic-linker wiring in a throwaway rootfs, complementing the existing flat-sysroot fake-yocto test.

Changes:

  • Document the new tests/fake-layers/ test/demo in tests/README.md, with a link to the directory + dynamic-linking spec.
  • Add tests/fake-layers/run-fake-layers.sh to stage MW/vendor “modules”, create aggregation symlinks, run ldconfig, and check cross-layer library resolution.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
tests/README.md Adds a new section describing the fake-layers/ test/demo and its intent.
tests/fake-layers/run-fake-layers.sh New script that emulates /mw and /vendor layer trees, wires ld.so.conf.d, runs ldconfig, and asserts aggregation + cross-layer linking behavior.

Comment thread tests/fake-layers/run-fake-layers.sh
Comment thread tests/fake-layers/run-fake-layers.sh Outdated
Comment thread tests/README.md Outdated
@Ulrond Ulrond self-assigned this Jul 3, 2026
@Ulrond Ulrond added this to the Next Release milestone Jul 3, 2026
@Ulrond Ulrond moved this from Architecture Review Required to Under Review in halif_aidl Jul 4, 2026
@Ulrond Ulrond added Minor Change Additive, backwards-compatible interface change — bumps minor; the default for real work scope:infrastructure Repo tooling, CI/CD, scripts, governance docs labels Jul 4, 2026
…review)

Copilot review:
- vendor lib now links against the MW *aggregation* dir (${MW}/lib) rather than
  the module-private ${MW}/halif/lib — the path a real vendor consumes, so it
  also proves the aggregation symlinks are usable.
- README: distinguish the two assertions — ldconfig *registers* via the per-layer
  ld.so.conf.d (cache), ldd *resolves* against the aggregated lib dirs
  (LD_LIBRARY_PATH, since host ldd can't read the work-dir cache). The prior
  wording implied ldd used the ld.so.conf.d cache.
@Ulrond

Ulrond commented Jul 4, 2026

Copy link
Copy Markdown
Collaborator Author

Copilot review addressed: vendor lib now links via the MW aggregation dir (${MW}/lib), and the README now distinguishes ldconfig registration (via ld.so.conf.d) from ldd resolution (via LD_LIBRARY_PATH against the aggregated dirs). On the top-level <layer>.conf pointing at <layer>/lib: that dir aggregates every module's libs as symlinks, so it's a valid aggregation model (the per-module confs are also symlinked into ld.so.conf.d/).

@Ulrond
Ulrond merged commit bdc3e46 into develop Jul 5, 2026
4 checks passed
@Ulrond
Ulrond deleted the feature/layer-aggregation-test branch July 5, 2026 08:32
@github-project-automation github-project-automation Bot moved this from Under Review to Resolved in halif_aidl Jul 5, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 5, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Minor Change Additive, backwards-compatible interface change — bumps minor; the default for real work scope:infrastructure Repo tooling, CI/CD, scripts, governance docs

Projects

Status: Resolved

Development

Successfully merging this pull request may close these issues.

test/demo: emulate the layer-aggregation filesystem (MW/vendor) + cross-layer dynamic linking

2 participants