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