Skip to content

fix(cross): exclude gated-off augments from the sysroot key#112

Merged
jwinarske merged 1 commit into
mainfrom
jw/cross-key-gated-augment
Jul 11, 2026
Merged

fix(cross): exclude gated-off augments from the sysroot key#112
jwinarske merged 1 commit into
mainfrom
jw/cross-key-gated-augment

Conversation

@jwinarske

@jwinarske jwinarske commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

sysrootKey hashed every declared augment, but a build only stages augments whose requires_define gate is satisfied (added in #110). So a gated-off augment — e.g. an off-by-default crash handler declared once in a shared .emb/base.emb.yaml (#111 makes it inheritable) — changed the sysroot_key and build_key for every target, invalidating the shared store entry and drifting emb.lock, even though nothing extra was built.

Fix

Count an augment toward sysrootKey only when its gate is satisfied by the target's effective defines — matching what actually stages into the sysroot. A plain build's key is unchanged by a dormant augment; enabling the feature (--define …=ON) yields a distinct key, as it should (the sysroot genuinely differs).

Test

cross_keys_test.dart: a requires_define-gated augment leaves sysrootKey equal to the no-augment key when its define is absent, and changes it when the define is on.

sysrootKey hashed every declared augment, but the build only stages augments
whose requires_define gate is satisfied. So a gated-off augment (e.g. an
off-by-default crash handler declared in .emb/base.emb.yaml) changed the
sysroot_key and build_key for every target -- invalidating the shared store
entry and drifting emb.lock -- even though nothing extra was built.

Count an augment toward sysrootKey only when its gate is satisfied by the
target's effective defines, matching what actually stages into the sysroot. A
plain build's key is then unchanged by a dormant augment; enabling the feature
(--define ...=ON) yields a distinct key, as it should.

Signed-off-by: Joel Winarske <joel.winarske@linux.com>
@jwinarske
jwinarske merged commit fc9fea3 into main Jul 11, 2026
39 checks passed
@jwinarske
jwinarske deleted the jw/cross-key-gated-augment branch July 11, 2026 00:37
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