Skip to content

driver nnbd - #74856

Merged
dnfield merged 6 commits into
flutter:masterfrom
dnfield:nnbd_fuchsia
Jan 28, 2021
Merged

dnfield merged 6 commits into
flutter:masterfrom
dnfield:nnbd_fuchsia

Conversation

@dnfield

@dnfield dnfield commented Jan 27, 2021

Copy link
Copy Markdown
Contributor

NNBD migration for flutter_driver.

I've spot checked this on one or two tests from the devicelab locally. If it goes red on devicelab we can revert.

I'll also see if I can get a FROB run, but this will require a g3fix to enable null safety for the package internally.

Fixes #74849

@flutter-dashboard flutter-dashboard Bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. c: contributor-productivity Team-specific productivity, code health, technical debt. labels Jan 27, 2021
@google-cla google-cla Bot added the cla: yes label Jan 27, 2021
// found in the LICENSE file.

// @dart = 2.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra lines?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and in some of the other files as well below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing that.

///
/// * [getWidgetDiagnostics], which gets the [DiagnosticsNode] of a [Widget].
Future<Map<String, Object>> getRenderObjectDiagnostics(
Future<Map<String, dynamic>> getRenderObjectDiagnostics(

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not Object anymore?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here and below.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over aggressive find and replace. I tried making more things not dynamic and they weren't ready to change. Changing back.

/// Creates a SceneDisplayLagSummarizer given the timeline events.
SceneDisplayLagSummarizer(this.sceneDisplayLagEvents) {
for (final TimelineEvent event in sceneDisplayLagEvents) {
for (final TimelineEvent event in sceneDisplayLagEvents!) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why's the final field sceneDisplayLagEvents nullable in the first place then? Wouldn't this always crash when you instantiate SceneDisplayLagSummarizer(null)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, updating this. I think we just were missing an assert there.. Making it non-null.

/// This is parsed from "traceEvents" data within [json] and sorted by
/// timestamp. Anything without a valid timestamp is put in the beginning.
final List<TimelineEvent> events;
final List<TimelineEvent>? events;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's surprising that this can be null. Can we document that? Or should it always be an (sometimes empty) list?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I'm pretty sure the method that parses this was written in an overly cautious way. I was going to not change it, but I'm realizing now that it can only return null if another thing thatisn't allowed to be null (json) was null. I'm going to change it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wrong.

This can be null if the trace events are null in the JSON. I'll document it for now.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think changing it to an empty list would be fine, but would like to do that separately from this migration in case anything depends on this behavior.

@dnfield

dnfield commented Jan 28, 2021

Copy link
Copy Markdown
Contributor Author

I didn't update the packages correctly - we'll need to get an updated version of dwds that allows for quiver, or see if we can drop quiver.

Since the tool depends on quiver and dwds, it might be worth doing anyway to help unblock the tool.

@dnfield

dnfield commented Jan 28, 2021

Copy link
Copy Markdown
Contributor Author

ok, it looks like we can use fake_async, which is migrated and isn't conflicting in this repo.

@goderbauer goderbauer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// found in the LICENSE file.

// @dart = 2.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's still not fixed here :)

// found in the LICENSE file.

// @dart = 2.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra blank line

// found in the LICENSE file.

// @dart = 2.8

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blank line

@fluttergithubbot

Copy link
Copy Markdown
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Windows tool_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@fluttergithubbot

Copy link
Copy Markdown
Contributor

This pull request is not suitable for automatic merging in its current state.

  • The status or check suite Windows tool_tests has failed. Please fix the issues identified (or deflake) before re-applying this label.

@dnfield

dnfield commented Jan 28, 2021

Copy link
Copy Markdown
Contributor Author

Windows flaked twice on me for things I'm pretty sure are unrelated to this patch (native crashes in Dart). Merged up to head and trying again...

@dnfield
dnfield merged commit 3ece9c6 into flutter:master Jan 28, 2021
args: serialized,
).then<Map<String, dynamic>>((vms.Response value) => value.json);
response = await _warnIfSlow<Map<String, dynamic>>(
).then<Map<String, dynamic>>((vms.Response value) => value.json!);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are seeing stack traces in our build failures that come from the _warnIfSlow method following this when it evaluates the future. The error is that a Map<String, dynamic> can't be null, so I believe that ! operator on this line may be encountering a null value here and failing the NNBD assertion.

@jonahwilliams

Copy link
Copy Markdown
Contributor

We're not going to consider cherry picks to stable and beta for null safe driver or integration test. We evaluated this when creating the release branch for flutter 2 and concluded that it was too risky. Null safe driver and integration test will be available in the next beta/stable release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: tests "flutter test", flutter_test, or one of our tests c: contributor-productivity Team-specific productivity, code health, technical debt. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Migrate flutter_driver to null safety

5 participants