Commit 906103dd authored by Michael Goderbauer's avatar Michael Goderbauer Committed by GitHub

eliminate sky snapshot (#8631)

* eliminate sky snapshot

* roll engine
parent e2dccc5e
f9c1f5fa539fdfcbcae65a1dd09d1d05949da459 6e54f5e31f084d2e54a510959f68b89e4d2fdffd
\ No newline at end of file
...@@ -18,7 +18,6 @@ enum Artifact { ...@@ -18,7 +18,6 @@ enum Artifact {
dartVmEntryPointsAndroidTxt, dartVmEntryPointsAndroidTxt,
genSnapshot, genSnapshot,
skyShell, skyShell,
skySnapshot,
snapshotDart, snapshotDart,
flutterFramework, flutterFramework,
vmSnapshotData, vmSnapshotData,
...@@ -43,8 +42,6 @@ String _artifactToFileName(Artifact artifact) { ...@@ -43,8 +42,6 @@ String _artifactToFileName(Artifact artifact) {
return 'dart_vm_entry_points_android.txt'; return 'dart_vm_entry_points_android.txt';
case Artifact.genSnapshot: case Artifact.genSnapshot:
return 'gen_snapshot'; return 'gen_snapshot';
case Artifact.skySnapshot:
return 'sky_snapshot';
case Artifact.skyShell: case Artifact.skyShell:
return 'sky_shell'; return 'sky_shell';
case Artifact.snapshotDart: case Artifact.snapshotDart:
...@@ -144,18 +141,17 @@ class CachedArtifacts extends Artifacts { ...@@ -144,18 +141,17 @@ class CachedArtifacts extends Artifacts {
String _getHostArtifactPath(Artifact artifact, TargetPlatform platform) { String _getHostArtifactPath(Artifact artifact, TargetPlatform platform) {
switch (artifact) { switch (artifact) {
case Artifact.genSnapshot:
// For script snapshots any gen_snapshot binary will do. Returning gen_snapshot for
// android_arm in profile mode because it is available on all supported host platforms.
return _getAndroidArtifactPath(artifact, TargetPlatform.android_arm, BuildMode.profile);
case Artifact.skyShell: case Artifact.skyShell:
case Artifact.skySnapshot:
if (platform == TargetPlatform.windows_x64) if (platform == TargetPlatform.windows_x64)
throw new UnimplementedError('Artifact $artifact not available on platfrom $platform.'); throw new UnimplementedError('Artifact $artifact not available on platfrom $platform.');
continue returnResourcePath; continue fallThrough;
case Artifact.genSnapshot: fallThrough:
case Artifact.vmSnapshotData: case Artifact.vmSnapshotData:
case Artifact.isolateSnapshotData: case Artifact.isolateSnapshotData:
if (platform != TargetPlatform.windows_x64)
throw new UnimplementedError('Artifact $artifact not available on platfrom $platform.');
continue returnResourcePath;
returnResourcePath:
case Artifact.icudtlDat: case Artifact.icudtlDat:
final String engineArtifactsPath = cache.getArtifactDirectory('engine').path; final String engineArtifactsPath = cache.getArtifactDirectory('engine').path;
final String platformDirName = getNameForTargetPlatform(platform); final String platformDirName = getNameForTargetPlatform(platform);
...@@ -228,8 +224,6 @@ class LocalEngineArtifacts extends Artifacts { ...@@ -228,8 +224,6 @@ class LocalEngineArtifacts extends Artifacts {
return _genSnapshotPath(platform); return _genSnapshotPath(platform);
case Artifact.skyShell: case Artifact.skyShell:
return _skyShellPath(platform); return _skyShellPath(platform);
case Artifact.skySnapshot:
return _skySnapshotPath();
case Artifact.isolateSnapshotData: case Artifact.isolateSnapshotData:
case Artifact.vmSnapshotData: case Artifact.vmSnapshotData:
return fs.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact)); return fs.path.join(engineOutPath, 'gen', 'flutter', 'lib', 'snapshot', _artifactToFileName(artifact));
...@@ -256,13 +250,6 @@ class LocalEngineArtifacts extends Artifacts { ...@@ -256,13 +250,6 @@ class LocalEngineArtifacts extends Artifacts {
return fs.path.join(engineOutPath, clang, _artifactToFileName(Artifact.genSnapshot)); return fs.path.join(engineOutPath, clang, _artifactToFileName(Artifact.genSnapshot));
} }
String _skySnapshotPath() {
final String clangPath = fs.path.join(engineOutPath, 'clang_x64', _artifactToFileName(Artifact.skySnapshot));
if (fs.isFileSync(clangPath))
return clangPath;
return fs.path.join(engineOutPath, _artifactToFileName(Artifact.skySnapshot));
}
String _skyShellPath(TargetPlatform platform) { String _skyShellPath(TargetPlatform platform) {
if (getCurrentHostPlatform() == HostPlatform.linux_x64) { if (getCurrentHostPlatform() == HostPlatform.linux_x64) {
return fs.path.join(engineOutPath, _artifactToFileName(Artifact.skyShell)); return fs.path.join(engineOutPath, _artifactToFileName(Artifact.skyShell));
......
...@@ -8,7 +8,6 @@ import 'artifacts.dart'; ...@@ -8,7 +8,6 @@ import 'artifacts.dart';
import 'asset.dart'; import 'asset.dart';
import 'base/common.dart'; import 'base/common.dart';
import 'base/file_system.dart'; import 'base/file_system.dart';
import 'base/platform.dart';
import 'base/process.dart'; import 'base/process.dart';
import 'build_info.dart'; import 'build_info.dart';
import 'dart/package_map.dart'; import 'dart/package_map.dart';
...@@ -33,52 +32,6 @@ Future<int> createSnapshot({ ...@@ -33,52 +32,6 @@ Future<int> createSnapshot({
String snapshotPath, String snapshotPath,
String depfilePath, String depfilePath,
String packages String packages
}) {
if (platform.isWindows) {
return _creteScriptSnapshotWithGenSnapshot(
mainPath: mainPath,
snapshotPath: snapshotPath,
depfilePath: depfilePath,
packages: packages
);
}
return _createScriptSnapshotWithSkySnapshot(
mainPath: mainPath,
snapshotPath: snapshotPath,
depfilePath: depfilePath,
packages: packages
);
}
Future<int> _createScriptSnapshotWithSkySnapshot({
String mainPath,
String snapshotPath,
String depfilePath,
String packages
}) {
assert(mainPath != null);
assert(snapshotPath != null);
assert(packages != null);
final String snapshotterPath = artifacts.getArtifactPath(Artifact.skySnapshot);
final List<String> args = <String>[
snapshotterPath,
'--packages=$packages',
'--snapshot=$snapshotPath'
];
if (depfilePath != null) {
args.add('--depfile=$depfilePath');
args.add('--build-output=$snapshotPath');
}
args.add(mainPath);
return runCommandAndStreamOutput(args);
}
Future<int> _creteScriptSnapshotWithGenSnapshot({
String mainPath,
String snapshotPath,
String depfilePath,
String packages
}) { }) {
assert(mainPath != null); assert(mainPath != null);
assert(snapshotPath != null); assert(snapshotPath != null);
......
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