Skip to content

tecnix: intern builtin argument names at call time, not statically - #49

Merged
joshheinrichs-shopify merged 1 commit into
mainfrom
fix-iteration-order
Aug 13, 2026
Merged

tecnix: intern builtin argument names at call time, not statically#49
joshheinrichs-shopify merged 1 commit into
mainfrom
fix-iteration-order

Conversation

@joshheinrichs-shopify

Copy link
Copy Markdown
Contributor

Adding gitDir, resolver, rev, checkoutPath, and targets to StaticEvalSymbols assigned them the lowest symbol ids, ahead of every symbol interned while evaluating user code. Bindings iterate in symbol-id order, so pre-interning common attr names like 'targets' and 'rev' observably reordered attribute iteration for every attrset containing them -- for example, which error a deepSeq (or nix-unit's forceValueDeep) surfaces first out of an attrset with several throwing attributes.

These lookups run once per tecnixTargets/tecnixTargetNames call, right before git subprocesses, SQLite reads, and target evaluation, so the static ids bought nothing measurable. Intern the names at call time instead, like upstream's fetcher builtins do, which restores upstream-identical iteration order.

Adding gitDir, resolver, rev, checkoutPath, and targets to
StaticEvalSymbols assigned them the lowest symbol ids, ahead of every
symbol interned while evaluating user code. Bindings iterate in
symbol-id order, so pre-interning common attr names like 'targets' and
'rev' observably reordered attribute iteration for every attrset
containing them -- for example, which error a deepSeq (or nix-unit's
forceValueDeep) surfaces first out of an attrset with several throwing
attributes.

These lookups run once per tecnixTargets/tecnixTargetNames call, right
before git subprocesses, SQLite reads, and target evaluation, so the
static ids bought nothing measurable. Intern the names at call time
instead, like upstream's fetcher builtins do, which restores
upstream-identical iteration order.
@joshheinrichs-shopify

Copy link
Copy Markdown
Contributor Author

trivial fix just gonna merge

@joshheinrichs-shopify
joshheinrichs-shopify merged commit 0e6838b into main Aug 13, 2026
12 checks passed
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