-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
BE building decides some code is opted in on its own, then compiler crashes with 'name' sent to null #43988
Comments
Someone pointed out 2.12's opt-in by default policy for the null-safety breaking change, which might explain the nullability errors. But it doesn't seem to. All of the files that it complains about are in the main package being compiled, which does have an SDK constraint, minimum 2.4.0. And so do both of the packages in which we get compile errors, of 2.7.0 and 2.7.1 respectively. However, I notice that all of the files that it complains about are either in /web or /test directories, which suggests that that opt-in might not be respecting the package SDK constraint correctly for org-dartlang-app: URLs within the package. It seemed to do it for all three .dart files in that package's web directory, and for both tests in one particular test directory, but not in any others. And there were two occurrences of the compiler crash, both in dependencies. Adding the language version comment to all of the problem files manually removes those errors, but the compiler still crashes. |
We seem to have two problems:
I'll look into 1. @jakemac53 Do you know how the compiler is invoked in this setting? If we synthesize urls with the |
@alanknight-wk For 1. did the compilation output any other errors that the one at |
Further investigating 1. it seems that the CFE sometimes generates a forwarding stub with no target. This is very dependent on the particular hierarchy and is hard to reproduce. I've managed to reproduce simpler case that would not have caused the crash in dev_compiler. @alanknight-wk If you can make a repro of the hierarchy that triggers the crash it would be much appreciated. |
As far as I am aware build_web_compilers does properly support This was implemented for null safety though, so you would need a new-ish build_web_compilers to get that functionality, and it definitely did not work for a while in dart2js at least. |
The dev_logging_test error was an instance of 2, treating the files in /test of the main package as package-less and therefore opted-in. There were two instances of the compiler crash. They are two different files, but look similar - both occur in emitSuperTarget. One of the files is just a lot of re-exports, but the other one is code and only contains one super call, of the form
I'll see if I can reproduce that with a smaller example. |
If the underlying cause the the forwarding stubs without target the might not be any super call in the user code - making the culprit so much harder to find! |
OK, so it seems likely that upgrading the version of build_runner it's using might address issue 2. I hadn't changed anything about the pubspec. Upgrading to analyzer 0.40.5 seems to break built_value, but analyzer 0.40.1 combined with bleeding edge build_runner does not give those nullability errors. |
In response to #43988 Change-Id: I3aa73a073b275b634b679bebfa2bf2ed9c292074 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/170087 Reviewed-by: Jens Johansen <[email protected]> Commit-Queue: Johnni Winther <[email protected]>
I've landed https://dart-review.googlesource.com/c/sdk/+/170087 in the Dart repo. I removes the failure that I could reproduce. @alanknight-wk can you verify that it fixes the crash? |
Yes, that fixes it. |
Dart SDK version: 2.12.0-edge.2259593f836cf975f8d9aa86b3134f0c8748acd7 (be) (Thu Oct 29 18:52:56 2020 +0000) on "macos_x64"
This is building a large package that's previously been built with 2.7.2, unmodified. None of this code has been opted in.
A large part of the way through building it starts giving messages for a couple of files like
[SEVERE] build_web_compilers:ddc on test/unit/dev_logging_test.ddc.module:
Error compiling dartdevc module:wdesk|test/unit/dev_logging_test.ddc.js
test/unit/dev_logging_test.dart:19:13: Error: Non-nullable variable 'sub' must be assigned before it can be used.
await sub?.cancel();
^^^
After two such files we then get
We're sorry, you've found a bug in our compiler.
You can report this bug at:
https://github.com/dart-lang/sdk/issues/labels/web-dev-compiler
Please include the information below in your report, along with
any other information that may help us track it down. Thanks!
-------------------- %< --------------------
dartdevc -k arguments: --kernel --dart-sdk-summary=/Users/alanknight/dart/dart-git/sdk/xcodebuild/ReleaseX64/dart-sdk/lib/_internal/ddc_sdk.dill --modules=amd --no-summarize -o packages/graph_ui/graph_form.ddc.js --source-map ...
The text was updated successfully, but these errors were encountered: