Skip to content

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Mar 6, 2020

Description

  • Remove dependency injection from GenSnapshot and AotBuilder.
  • Update tests to use FakeProcessManager
  • Delete duplicate AOT build code in aot.dart and replace with assemble, since we can't get rid of the command for now.
  • Delete duplicate kernel compilation code in GenSnapshot

Upon refactoring test code, discover that the LocalEngineArtifacts._engineSrcPath and Artifact.snapshotDart are completely unused (might predate gen snapshot?). Remove and refactor.

@fluttergithubbot fluttergithubbot added tool Affects the "flutter" command-line tool. See also t: labels. work in progress; do not review labels Mar 6, 2020
@jonahwilliams jonahwilliams marked this pull request as ready for review March 6, 2020 20:46
@zanderso zanderso self-requested a review March 6, 2020 21:42
@Piinks
Copy link
Contributor

Piinks commented Mar 6, 2020

Same here: The flutter-gold check can be disregarded here. I just made a change in flutter/cocoon for it to ignore changes that don't run golden file tests, so it won't be coming back around to update this one.

case TargetPlatform.darwin_x64:
case TargetPlatform.linux_x64:
case TargetPlatform.windows_x64:
case TargetPlatform.fuchsia_arm64:
Copy link
Member

Choose a reason for hiding this comment

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

Fuchsia supports AOT, but not via this path. Maybe some more targeted tool exit message for fuchsia would be good.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

status?.cancel();
globals.printError(error.toString());
return;
throwToolExit(null);
Copy link
Member

Choose a reason for hiding this comment

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

A message here would probably be helpful, even if it was just something like "The AOT build failed".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done


final SnapshotType snapshotType = SnapshotType(platform, buildMode);
final int genSnapshotExitCode =
await _timedStep('snapshot(CompileTime)', 'aot-snapshot',
Copy link
Member

Choose a reason for hiding this comment

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

Is this timing info still captured some other way? Or is this reporting no longer valuable because we expect users to be taking a different path?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We don't use a _timedStep for the current AOT build.

All of this timing information is captured via PerformanceMeasurement classes. This isn't hooked up to analytics yet, but I could update this PR to do so. This has the benefit of allowing uniform handling of build performance

https://github.com/flutter/flutter/blob/master/packages/flutter_tools/lib/src/build_system/build_system.dart#L619

I could wire this up in this PR or do it separately

Copy link
Member

Choose a reason for hiding this comment

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

Separately sgtm.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Filled #52842 to track

Copy link
Contributor

Choose a reason for hiding this comment

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

Removing this _timedStep removed the compilation times from the log output reported using the --report-timings flag in Golem benchmarking of Flutter.

The failure was not noticed, because the previous backup code path that was used before the --report-timings flag was introduced started running again.

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

lgtm w/ small fix

bool bitcode = kBitcodeEnabledDefault,
bool quiet = true,
Iterable<DarwinArch> iosBuildArchs = defaultIOSArchs,
}) async {
Copy link
Member

Choose a reason for hiding this comment

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

Also TargetPlatform.fuchsia_arm64

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, thanks!

@lock
Copy link

lock bot commented Apr 2, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants