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
[flutter_tools] Remove sound null safety flag #120936
[flutter_tools] Remove sound null safety flag #120936
Conversation
44f905d
to
6338250
Compare
@@ -168,7 +167,6 @@ require.config({ | |||
define("$bootstrapModule", ["$entrypoint", "dart_sdk"], function(app, dart_sdk) { | |||
dart_sdk.dart.setStartAsyncSynchronously(true); | |||
dart_sdk._debugger.registerDevtoolsFormatter(); | |||
dart_sdk.dart.nonNullAsserts($nullAssertions); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nshahan is it ok that I deleted this line? Or should I leave this line and hard-code the value (since I deleted the CLI arg in this PR)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, looks like good cleanup. This is totally unneeded as long as you are prevented from passing
--no-sound-null-safety
when compiling. It will be defaulted to false
in the compiled SDK until it is fully cleaned up.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
FYI @a-siva |
@@ -91,12 +91,7 @@ enum HostArtifact { | |||
webPlatformDart2JSSoundKernelDill, | |||
|
|||
/// The precompiled SDKs and sourcemaps for web debug builds. | |||
webPrecompiledSdk, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this cleanup related to the flag removal?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, these are the unsound parts of the web sdk, which are no longer reachable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This #122215 is tracking not building it
} | ||
flutterUsage.sendEvent(kNullSafetyCategory, 'runtime-mode', label: nullSafetyMode.toString()); | ||
flutterUsage.sendEvent(kNullSafetyCategory, 'stats', parameters: CustomDimensions( | ||
nullSafeMigratedLibraries: migrated, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these fields be removed from the CustomDimensions
class?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooh, good catch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about this diff 3519e1f
packages/flutter_tools/lib/src/reporting/custom_dimensions.dart
Outdated
Show resolved
Hide resolved
@@ -225,7 +225,7 @@ class TestCase { | |||
for (final File test in tests) { | |||
final String testPath = path.join(path.dirname(test.path), 'lib', path.basenameWithoutExtension(test.path)); | |||
final ProcessRunnerResult result = await runner.runProcess( | |||
<String>[flutter, 'test', '--enable-experiment=non-nullable', '--null-assertions', testPath], | |||
<String>[flutter, 'test', '--enable-experiment=non-nullable', testPath], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is that non-nullable experiment flag used anymore? If this is the Dart SDK experiment flag it is no longer needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, good catch
This reverts commit 7c3088c.
Fixes #118810
Remove both the
--sound-null-safety
and--null-assertions
flags from the Flutter CLI tool. These will be removed from the Dart SDK in the 3.0 release. Before this change, we were defaulting to--sound-null-safety
and--no-null-assertions
, and providing a warning if the user explicitly overrode this that they were going to be deprecated soon.Note there is no change in this PR related to the
--native-null-assertions
flag; it defaults to on but the user can explicitly disable it, which is the desired behavior per #118810 (comment).