Repository navigation
feat(native): report macro errors natively without re-running Python - #1051
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
With native rendering as the default, a failing compile re-ran the whole render stage in Python only to report its error. Every macro ran twice, side effects included.
Changes
run_with_macro_bridgeruns the stage once and raises its first error directly. Every error in that stage is raised by the same Python code over the same inputs, in the same order: macro execution errors (with the macro's exception as the cause), non-string returns, unparsable arguments, unknown, private and inaccessible macros, and load-time call cycles. Only memo/store replay of successful calls differs, which the macro determinism contract covers.NativeStageMismatchErrors and are covered by the expansion differential.--varsor macro output) now falls back to Python instead of raisingUnicodeEncodeError. A call whose store key cannot be built (encoding or recursion failure) is treated as uncacheable: it runs normally and is not stored.bridge_independentno longer changes behaviour. Parity tests still use it to count natively produced exact errors.expected_native_entriesfield.Verification
error_type. New failure-corpus cases are included, plus a CLI test for a surrogate--varsvalue with the store attached.make check-ci,make testand the hygiene scan pass.