Skip to content

feat(cross): union augment lists across layers#111

Merged
jwinarske merged 1 commit into
mainfrom
jw/cross-augment-union
Jul 10, 2026
Merged

feat(cross): union augment lists across layers#111
jwinarske merged 1 commit into
mainfrom
jw/cross-augment-union

Conversation

@jwinarske

@jwinarske jwinarske commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

augment lists were replaced on extends/override, so a project or app
layer that declared its own augment lost any augment inherited from the layer below it. Only sysroot.dev_packages accumulated across the chain — an inconsistency that makes a shared, inheritable augment impossible.

Change

Union augment in _mergeCross, mirroring the existing dev_packages rule: base entries first (order-preserving), a derived entry replaces a base entry that names the same pkg, and a new pkg appends.

This lets a shared augment defined once — e.g. an ivi-homescreen crash handler (sentry-native, gated on BUILD_CRASH_HANDLER) — survive a board or target that also declares its own augment (e.g. libdisplay-info), instead of one silently dropping the other.

Docs + tests

  • README and the raspberry-pi-family example note that augment unions like dev_packages (same-pkg replaces).
  • cross_project_test.dart covers the union of distinct pkgs and the same-pkg override across the board layer.

augment lists were replaced when a derived layer declared its own, so an
augment defined once in a lower layer was lost. Only sysroot.dev_packages
accumulated.

Union augment the same way in both merge paths:
- _mergeCross (the extends chain: app -> project -> board)
- the shared -> target merge (a cross.targets variant, or a .emb/base.emb.yaml
  shared block folding into each target)

base entries first (order-preserving), a derived entry replaces a base entry
that names the same pkg, and a new pkg appends. This lets a shared augment
(e.g. an ivi-homescreen crash handler defined once in .emb/base.emb.yaml)
survive a target that also declares its own augment (e.g. libdisplay-info),
instead of one silently dropping the other.

Document the rule in the README and the raspberry-pi-family example. Tests
cover the union across the extends layer and the shared -> target merge, plus
the same-pkg override.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske force-pushed the jw/cross-augment-union branch from 21b2be1 to 934ad7a Compare July 10, 2026 23:26
@jwinarske jwinarske changed the title feat(cross): union augment lists across extends layers feat(cross): union augment lists across layers Jul 10, 2026
@jwinarske
jwinarske merged commit 69154a9 into main Jul 10, 2026
39 checks passed
@jwinarske
jwinarske deleted the jw/cross-augment-union branch July 10, 2026 23:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant