Unverified Commit c72f18fc authored by Jonah Williams's avatar Jonah Williams Committed by GitHub

Add builders and engine hash to fingerprint (#29434)

parent 3618199a
......@@ -12,10 +12,12 @@ import '../android/android_sdk.dart';
import '../artifacts.dart';
import '../build_info.dart';
import '../bundle.dart';
import '../cache.dart';
import '../compile.dart';
import '../dart/package_map.dart';
import '../globals.dart';
import '../ios/mac.dart';
import '../project.dart';
import 'context.dart';
import 'file_system.dart';
import 'fingerprint.dart';
......@@ -79,6 +81,11 @@ class AOTSnapshotter {
IOSArch iosArch,
List<String> extraGenSnapshotOptions = const <String>[],
}) async {
FlutterProject flutterProject;
if (fs.file('pubspec.yaml').existsSync()) {
flutterProject = await FlutterProject.current();
}
final FlutterEngine engine = FlutterEngine(cache);
if (!_isValidAotPlatform(platform, buildMode)) {
printError('${getNameForTargetPlatform(platform)} does not support AOT compilation.');
return 1;
......@@ -180,6 +187,8 @@ class AOTSnapshotter {
'entryPoint': mainPath,
'sharedLib': buildSharedLibrary.toString(),
'extraGenSnapshotOptions': extraGenSnapshotOptions.join(' '),
'engineHash': engine.version,
'buildersUsed': '${flutterProject != null ? await flutterProject.hasBuilders : false}',
},
depfilePaths: <String>[],
);
......
......@@ -148,8 +148,7 @@ class CodeGeneratingKernelCompiler implements KernelCompiler {
fileSystemScheme: kMultiRootScheme,
depFilePath: depFilePath,
targetModel: targetModel,
// Pass an invalid file name to prevent frontend_server from initializing from dill.
initializeFromDill: 'none_file',
initializeFromDill: initializeFromDill,
);
}
}
......@@ -185,8 +184,7 @@ class CodeGeneratingResidentCompiler implements ResidentCompiler {
fileSystemScheme: kMultiRootScheme,
targetModel: TargetModel.flutter,
unsafePackageSerialization: unsafePackageSerialization,
// Pass an invalid file name to prevent frontend_server from initializing from dill.
initializeFromDill: 'none_file',
initializeFromDill: initializeFromDill,
);
if (runCold) {
return residentCompiler;
......
......@@ -16,9 +16,11 @@ import 'base/io.dart';
import 'base/platform.dart';
import 'base/process_manager.dart';
import 'base/terminal.dart';
import 'cache.dart';
import 'convert.dart';
import 'dart/package_map.dart';
import 'globals.dart';
import 'project.dart';
KernelCompiler get kernelCompiler => context[KernelCompiler];
......@@ -214,6 +216,11 @@ class KernelCompiler {
final String frontendServer = artifacts.getArtifactPath(
Artifact.frontendServerSnapshotForEngineDartSdk
);
FlutterProject flutterProject;
if (fs.file('pubspec.yaml').existsSync()) {
flutterProject = await FlutterProject.current();
}
final FlutterEngine engine = FlutterEngine(cache);
// TODO(cbracken): eliminate pathFilter.
// Currently the compiler emits buildbot paths for the core libs in the
......@@ -227,6 +234,8 @@ class KernelCompiler {
'entryPoint': mainPath,
'trackWidgetCreation': trackWidgetCreation.toString(),
'linkPlatformKernelIn': linkPlatformKernelIn.toString(),
'engineHash': engine.version,
'buildersUsed': '${flutterProject != null ? await flutterProject.hasBuilders : false}',
},
depfilePaths: <String>[depFilePath],
pathFilter: (String path) => !path.startsWith('/b/build/slave/'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment