From 199422cd2d21065a722d7532a8107a298afe6102 Mon Sep 17 00:00:00 2001 From: Alexander Aprelev Date: Thu, 13 Sep 2018 09:01:47 -0700 Subject: [PATCH] Skip first time full dill transfer (#21133) * Don't sync first full kernel file. * Update the comment --- packages/flutter_tools/lib/src/devfs.dart | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/packages/flutter_tools/lib/src/devfs.dart b/packages/flutter_tools/lib/src/devfs.dart index fd47054fac..0594742d7f 100644 --- a/packages/flutter_tools/lib/src/devfs.dart +++ b/packages/flutter_tools/lib/src/devfs.dart @@ -509,16 +509,20 @@ class DevFS { outputPath: dillOutputPath ?? fs.path.join(getBuildDirectory(), 'app.dill'), packagesFilePath : _packagesFilePath, ); - final String compiledBinary = compilerOutput?.outputFilename; - if (compiledBinary != null && compiledBinary.isNotEmpty) { - final Uri entryUri = fs.path.toUri(projectRootPath != null - ? fs.path.relative(pathToReload, from: projectRootPath) - : pathToReload, - ); - if (!dirtyEntries.containsKey(entryUri)) { - final DevFSFileContent content = DevFSFileContent(fs.file(compiledBinary)); - dirtyEntries[entryUri] = content; - numBytes += content.size; + // Don't send full kernel file that would overwrite what VM already + // started loading from. + if (!bundleFirstUpload) { + final String compiledBinary = compilerOutput?.outputFilename; + if (compiledBinary != null && compiledBinary.isNotEmpty) { + final Uri entryUri = fs.path.toUri(projectRootPath != null + ? fs.path.relative(pathToReload, from: projectRootPath) + : pathToReload, + ); + if (!dirtyEntries.containsKey(entryUri)) { + final DevFSFileContent content = DevFSFileContent(fs.file(compiledBinary)); + dirtyEntries[entryUri] = content; + numBytes += content.size; + } } } if (dirtyEntries.isNotEmpty) {