Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
a1636b6f
Unverified
Commit
a1636b6f
authored
May 28, 2020
by
Jonah Williams
Committed by
GitHub
May 28, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Revert "[flutter_tools] always initialize the resident runner from dill (#52497)" (#58193)
parent
0cca3c1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
40 deletions
+2
-40
resident_runner.dart
packages/flutter_tools/lib/src/resident_runner.dart
+1
-19
resident_runner_test.dart
...lutter_tools/test/general.shard/resident_runner_test.dart
+1
-21
No files found.
packages/flutter_tools/lib/src/resident_runner.dart
View file @
a1636b6f
...
...
@@ -23,7 +23,6 @@ import 'base/utils.dart';
import
'build_info.dart'
;
import
'build_system/build_system.dart'
;
import
'build_system/targets/localizations.dart'
;
import
'bundle.dart'
;
import
'cache.dart'
;
import
'codegen.dart'
;
import
'compile.dart'
;
...
...
@@ -84,12 +83,6 @@ class FlutterDevice {
if
(
device
.
platformType
==
PlatformType
.
fuchsia
)
{
targetModel
=
TargetModel
.
flutterRunner
;
}
// For both web and non-web platforms we initialize dill to/from
// a shared location for faster bootstrapping. If the compiler fails
// due to a kernel target or version mismatch, no error is reported
// and the compiler starts up as normal. Unexpected errors will print
// a warning message and dump some debug information which can be
// used to file a bug, but the compiler will still start up correctly.
if
(
targetPlatform
==
TargetPlatform
.
web_javascript
)
{
generator
=
ResidentCompiler
(
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebSdk
,
mode:
buildInfo
.
mode
),
...
...
@@ -102,9 +95,6 @@ class FlutterDevice {
compilerMessageConsumer:
(
String
message
,
{
bool
emphasis
,
TerminalColor
color
,
})
=>
globals
.
printTrace
(
message
),
initializeFromDill:
getDefaultCachedKernelPath
(
trackWidgetCreation:
buildInfo
.
trackWidgetCreation
,
),
targetModel:
TargetModel
.
dartdevc
,
experimentalFlags:
experimentalFlags
,
platformDill:
globals
.
fs
.
file
(
globals
.
artifacts
...
...
@@ -129,9 +119,6 @@ class FlutterDevice {
targetModel:
targetModel
,
experimentalFlags:
experimentalFlags
,
dartDefines:
buildInfo
.
dartDefines
,
initializeFromDill:
getDefaultCachedKernelPath
(
trackWidgetCreation:
buildInfo
.
trackWidgetCreation
,
),
packagesPath:
globalPackagesPath
,
);
}
...
...
@@ -704,6 +691,7 @@ abstract class ResidentRunner {
final
bool
ipv6
;
final
String
_dillOutputPath
;
/// The parent location of the incremental artifacts.
@visibleForTesting
final
Directory
artifactDirectory
;
final
String
packagesFilePath
;
final
String
projectRootPath
;
...
...
@@ -1208,12 +1196,6 @@ abstract class ResidentRunner {
Future
<
void
>
preExit
()
async
{
// If _dillOutputPath is null, we created a temporary directory for the dill.
if
(
_dillOutputPath
==
null
&&
artifactDirectory
.
existsSync
())
{
final
File
outputDill
=
globals
.
fs
.
file
(
dillOutputPath
);
if
(
outputDill
.
existsSync
())
{
outputDill
.
copySync
(
getDefaultCachedKernelPath
(
trackWidgetCreation:
trackWidgetCreation
,
));
}
artifactDirectory
.
deleteSync
(
recursive:
true
);
}
}
...
...
packages/flutter_tools/test/general.shard/resident_runner_test.dart
View file @
a1636b6f
...
...
@@ -4,10 +4,10 @@
import
'dart:async'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/cache.dart'
;
import
'package:vm_service/vm_service.dart'
as
vm_service
;
import
'package:file/memory.dart'
;
import
'package:file_testing/file_testing.dart'
;
import
'package:flutter_tools/src/artifacts.dart'
;
import
'package:flutter_tools/src/base/command_help.dart'
;
import
'package:flutter_tools/src/base/common.dart'
;
...
...
@@ -521,24 +521,6 @@ void main() {
expect
(
otherRunner
.
artifactDirectory
.
path
,
contains
(
'foobar'
));
}));
test
(
'ResidentRunner copies output dill to cache location during preExit'
,
()
=>
testbed
.
run
(()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
residentRunner
.
artifactDirectory
.
childFile
(
'app.dill'
).
writeAsStringSync
(
'hello'
);
await
residentRunner
.
preExit
();
final
File
cacheDill
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
getBuildDirectory
(),
'cache.dill'
));
expect
(
cacheDill
,
exists
);
expect
(
cacheDill
.
readAsStringSync
(),
'hello'
);
}));
test
(
'ResidentRunner handles output dill missing during preExit'
,
()
=>
testbed
.
run
(()
async
{
fakeVmServiceHost
=
FakeVmServiceHost
(
requests:
<
VmServiceExpectation
>[]);
await
residentRunner
.
preExit
();
final
File
cacheDill
=
globals
.
fs
.
file
(
globals
.
fs
.
path
.
join
(
getBuildDirectory
(),
'cache.dill'
));
expect
(
cacheDill
,
isNot
(
exists
));
}));
test
(
'ResidentRunner can run source generation'
,
()
=>
testbed
.
run
(()
async
{
final
FakeProcessManager
processManager
=
globals
.
processManager
as
FakeProcessManager
;
final
Directory
dependencies
=
globals
.
fs
.
directory
(
...
...
@@ -1158,8 +1140,6 @@ void main() {
target:
null
,
)).
generator
as
DefaultResidentCompiler
;
expect
(
residentCompiler
.
initializeFromDill
,
globals
.
fs
.
path
.
join
(
getBuildDirectory
(),
'cache.dill'
));
expect
(
residentCompiler
.
librariesSpec
,
globals
.
fs
.
file
(
globals
.
artifacts
.
getArtifactPath
(
Artifact
.
flutterWebLibrariesJson
))
.
uri
.
toString
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment