-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[dev_compiler] Support enabling asserts for expression evaluation #43986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@annagrin - when creating an issue on the sdk repo - if you know the area for it (like |
Sure, thanks! |
One reason that compiling an assertion requires the source is that flutter requested when assertions fail the error message includes the source code that failed. The VM does this, but I don't know if the VM does this for assertions written in debugger expressions. We could double check if they do and if so how do they get the source code? I think another possibility here would be to just not include that information in the error message if there isn't a valid source location available. We could have a separate path when compiling assertions in the expression compiler that is more forgiving and not expect source location to be available. I think it would be understandable if you were to write a failing assertion expression in the debugger and you didn't get back source information when it failed. A message that just says something like "Assertion failed. Error from compiled expression." |
Update: I am changing the DDC compiler code to be resilient to this failure - ie have some reporting with missing information. This allows us to enable asserts in the expression compiler and add tests in the SDK that match the CI bot configurations. https://dart-review.googlesource.com/c/sdk/+/317448 Evaluating
Note that VM does something similar:
|
Closes: #53077 Towards: #43986 Change-Id: I60df13b8ff29a0865a45b3a48a97af0ce94460b7 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/317448 Reviewed-by: Nicholas Shahan <[email protected]> Commit-Queue: Anna Gringauze <[email protected]>
When assertions appear in a debugger expression they now have a synthetic source location available. This also allows for the lookup of the actual source. Issue: #43986 Fixes: #54956 Change-Id: I34ae5f810593b40282929d02cb290de86603922f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/356287 Reviewed-by: Sigmund Cherem <[email protected]> Commit-Queue: Nicholas Shahan <[email protected]>
Uh oh!
There was an error while loading. Please reload this page.
Ddc relies on source information during compilation for creating assert statements. This information is not available if the kernel is loaded from dill, as in expression compilation provided by the expression compilation worker.
Suggestion: store needed source text for asserts in kernel instead.
Alternative suggestion: source information (such as file and offsets) and invoke some post-failure step to add source text to the failure message.
See:
sdk/pkg/dev_compiler/lib/src/kernel/compiler.dart
Line 3617 in 2259593
The text was updated successfully, but these errors were encountered: