Skip to content

[VM] Hide unsound null safety flag if build requires it #50348

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

Closed
a-siva opened this issue Oct 31, 2022 · 10 comments
Closed

[VM] Hide unsound null safety flag if build requires it #50348

a-siva opened this issue Oct 31, 2022 · 10 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team

Comments

@a-siva
Copy link
Contributor

a-siva commented Oct 31, 2022

Starting in Dart3.beta, the SDK will have a new build flag to determine whether an SDK supports unsound null safety on any of its commands. When the flag indicates that unsound mode is not supported, then the VM needs to provide an error if a user passes in the --no-sound-null-safety flag.

@a-siva a-siva added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on labels Oct 31, 2022
@a-siva a-siva added this to the Dart 3 beta milestone Oct 31, 2022
@a-siva a-siva self-assigned this Oct 31, 2022
@a-siva a-siva added triaged Issue has been triaged by sub team and removed vm-triaged labels Dec 20, 2022
@a-siva
Copy link
Contributor Author

a-siva commented Dec 21, 2022

This CL is blocked on the following

@mit-mit
Copy link
Member

mit-mit commented Feb 9, 2023

Hi @a-siva what remains that blocks this change?

@a-siva
Copy link
Contributor Author

a-siva commented Feb 9, 2023

Hi @a-siva what remains that blocks this change?

@sigmundch
Copy link
Member

FYI - re dart2js - @natebiggs has a CL in progress to update the dart2js invocation to use sound null safety. He is out this week, but we can get a more accurate estimate when he returns next week.

@a-siva
Copy link
Contributor Author

a-siva commented Feb 17, 2023

This CL https://dart-review.googlesource.com/c/sdk/+/283981 attempts to add a build time option for removing the unsound null safety flag, currently this fails to build the SDK, once @natebiggs lands the CL to update dart2js I can try building the SDK again.

@biggs0125
Copy link

I expect to land my CL (https://dart-review.git.corp.google.com/c/sdk/+/280221) early next week. I'm waiting for the equivalent internal change to roll around a bit to make sure nothing comes up.

@biggs0125
Copy link

I've landed the above change, Dart2JS should now run in sound null safe mode.

@a-siva
Copy link
Contributor Author

a-siva commented Feb 23, 2023

I've landed the above change, Dart2JS should now run in sound null safe mode.

Confirmed that the Dart SDK builds successfully now.

@a-siva
Copy link
Contributor Author

a-siva commented Feb 23, 2023

Here is what I learnt about the use of Flutter's Dart SDK internally from @chingjun
Flutter's Dart SDK is used in the following scenarios

  • to compile a kernel / AOT that needs to be compatible with a prebuilt Flutter Engine (Dart VM)
  • to run a prebuilt dill file

Basically all Flutter Dart code internally will be compiled with the frontend_server that is in the downloaded Dart SDK
The --no-sound-null-safety flag is being passed when calling the kernel_worker and frontend_server as all this code has not been migrated.

This pretty much means we cannot remove the -no-sound-null-safety flag from the 'dart compile kernel' or dart compile aot-snapshot commands in dart cli until all this code is migrated. The Dart VM will have to retain the ability to run unsound null safe code when it reads a dill file that was compiled with that option.

@a-siva
Copy link
Contributor Author

a-siva commented Mar 2, 2023

We have decided to not implement this build flag for 3.0 and hence removing the milestone, the option of locking down the no-sound-null-safety option in the compiler has already landed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. P2 A bug or feature request we're likely to work on triaged Issue has been triaged by sub team
Projects
None yet
Development

No branches or pull requests

5 participants