v1.7.8 hotfixes (#35423)
Cherry-pick the following PRs onto v1.7.8-hotfixes to prepare for release.
https://github.com/flutter/engine/pull/9581
https://github.com/flutter/engine/pull/9464
https://github.com/flutter/flutter/pull/35221
diff --git a/bin/internal/engine.version b/bin/internal/engine.version
index ba3f9ed..96e1d7d 100644
--- a/bin/internal/engine.version
+++ b/bin/internal/engine.version
@@ -1 +1 @@
-d004bcd4d619fc3574761d63d7cf7b7291332c79
+b1cb0d9e9b44393efeb735f664672a74732cdc8b
diff --git a/packages/flutter_tools/lib/src/commands/build_bundle.dart b/packages/flutter_tools/lib/src/commands/build_bundle.dart
index 924b3c8..da0c7fc 100644
--- a/packages/flutter_tools/lib/src/commands/build_bundle.dart
+++ b/packages/flutter_tools/lib/src/commands/build_bundle.dart
@@ -103,7 +103,7 @@
case TargetPlatform.darwin_x64:
case TargetPlatform.windows_x64:
case TargetPlatform.linux_x64:
- if (FlutterVersion.instance.isStable) {
+ if (!FlutterVersion.instance.isMaster) {
throwToolExit('$targetPlatform is not supported on stable Flutter.');
}
break;
diff --git a/packages/flutter_tools/lib/src/commands/create.dart b/packages/flutter_tools/lib/src/commands/create.dart
index f50d5b9..f1feee0 100644
--- a/packages/flutter_tools/lib/src/commands/create.dart
+++ b/packages/flutter_tools/lib/src/commands/create.dart
@@ -613,7 +613,7 @@
'iosLanguage': iosLanguage,
'flutterRevision': FlutterVersion.instance.frameworkRevision,
'flutterChannel': FlutterVersion.instance.channel,
- 'web': web && !FlutterVersion.instance.isStable,
+ 'web': web && FlutterVersion.instance.isMaster
};
}
diff --git a/packages/flutter_tools/lib/src/commands/precache.dart b/packages/flutter_tools/lib/src/commands/precache.dart
index f7d3fdd..ece8460 100644
--- a/packages/flutter_tools/lib/src/commands/precache.dart
+++ b/packages/flutter_tools/lib/src/commands/precache.dart
@@ -50,7 +50,7 @@
final Set<DevelopmentArtifact> requiredArtifacts = <DevelopmentArtifact>{};
for (DevelopmentArtifact artifact in DevelopmentArtifact.values) {
// Don't include unstable artifacts on stable branches.
- if (FlutterVersion.instance.isStable && artifact.unstable) {
+ if (!FlutterVersion.instance.isMaster && artifact.unstable) {
continue;
}
if (argResults[artifact.name]) {
diff --git a/packages/flutter_tools/lib/src/commands/run.dart b/packages/flutter_tools/lib/src/commands/run.dart
index 0fe853b..aeabe1f 100644
--- a/packages/flutter_tools/lib/src/commands/run.dart
+++ b/packages/flutter_tools/lib/src/commands/run.dart
@@ -352,7 +352,7 @@
);
}
- if (argResults['dart-flags'] != null && FlutterVersion.instance.isStable) {
+ if (argResults['dart-flags'] != null && !FlutterVersion.instance.isMaster) {
throw UsageException('--dart-flags is not available on the stable '
'channel.', null);
}
@@ -411,7 +411,7 @@
}
// Only support "web mode" on non-stable branches with a single web device
// in a "hot mode".
- final bool webMode = !FlutterVersion.instance.isStable
+ final bool webMode = FlutterVersion.instance.isMaster
&& devices.length == 1
&& await devices.single.targetPlatform == TargetPlatform.web_javascript;
diff --git a/packages/flutter_tools/lib/src/desktop.dart b/packages/flutter_tools/lib/src/desktop.dart
index d41a663..501e241 100644
--- a/packages/flutter_tools/lib/src/desktop.dart
+++ b/packages/flutter_tools/lib/src/desktop.dart
@@ -26,9 +26,9 @@
if (isRunningFromDaemon) {
final bool platformEnabled = platform
.environment['ENABLE_FLUTTER_DESKTOP']?.toLowerCase() == 'true';
- return platformEnabled && !FlutterVersion.instance.isStable;
+ return platformEnabled && FlutterVersion.instance.isMaster;
}
- return !FlutterVersion.instance.isStable;
+ return FlutterVersion.instance.isMaster;
}
/// Kills a process on linux or macOS.
diff --git a/packages/flutter_tools/lib/src/runner/flutter_command.dart b/packages/flutter_tools/lib/src/runner/flutter_command.dart
index 8443ba4..24fc9db 100644
--- a/packages/flutter_tools/lib/src/runner/flutter_command.dart
+++ b/packages/flutter_tools/lib/src/runner/flutter_command.dart
@@ -565,7 +565,7 @@
Future<void> validateCommand() async {
// If we're on a stable branch, then don't allow the usage of
// "experimental" features.
- if (isExperimental && FlutterVersion.instance.isStable) {
+ if (isExperimental && !FlutterVersion.instance.isMaster) {
throwToolExit('Experimental feature $name is not supported on stable branches');
}
@@ -661,17 +661,17 @@
case TargetPlatform.ios:
return DevelopmentArtifact.iOS;
case TargetPlatform.darwin_x64:
- if (!FlutterVersion.instance.isStable) {
+ if (FlutterVersion.instance.isMaster) {
return DevelopmentArtifact.macOS;
}
return null;
case TargetPlatform.windows_x64:
- if (!FlutterVersion.instance.isStable) {
+ if (!FlutterVersion.instance.isMaster) {
return DevelopmentArtifact.windows;
}
return null;
case TargetPlatform.linux_x64:
- if (!FlutterVersion.instance.isStable) {
+ if (!FlutterVersion.instance.isMaster) {
return DevelopmentArtifact.linux;
}
return null;
diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart
index 6d1503f..f564873 100644
--- a/packages/flutter_tools/lib/src/version.dart
+++ b/packages/flutter_tools/lib/src/version.dart
@@ -32,9 +32,10 @@
return _repositoryUrl;
}
- /// Whether we are currently on the stable branch.
- bool get isStable {
- return getBranchName() == 'stable';
+ /// Whether we are currently on the master branch.
+ bool get isMaster {
+ final String branchName = getBranchName();
+ return !<String>['dev', 'beta', 'stable'].contains(branchName);
}
static const Set<String> officialChannels = <String>{
diff --git a/packages/flutter_tools/lib/src/web/workflow.dart b/packages/flutter_tools/lib/src/web/workflow.dart
index 3510d19..925ec3d 100644
--- a/packages/flutter_tools/lib/src/web/workflow.dart
+++ b/packages/flutter_tools/lib/src/web/workflow.dart
@@ -24,9 +24,9 @@
if (isRunningFromDaemon) {
final bool platformEnabled = platform
.environment['FLUTTER_WEB']?.toLowerCase() == 'true';
- return platformEnabled && !FlutterVersion.instance.isStable;
+ return platformEnabled && FlutterVersion.instance.isMaster;
}
- return !FlutterVersion.instance.isStable;
+ return FlutterVersion.instance.isMaster;
}
/// The web workflow instance.
diff --git a/packages/flutter_tools/test/commands/build_web_test.dart b/packages/flutter_tools/test/commands/build_web_test.dart
index 5f5df71..a33cddb 100644
--- a/packages/flutter_tools/test/commands/build_web_test.dart
+++ b/packages/flutter_tools/test/commands/build_web_test.dart
@@ -93,5 +93,5 @@
}
class MockFlutterVersion extends Mock implements FlutterVersion {
@override
- bool get isStable => false;
+ bool get isMaster => true;
}
diff --git a/packages/flutter_tools/test/commands/precache_test.dart b/packages/flutter_tools/test/commands/precache_test.dart
index 7bbaca0..02d7aba 100644
--- a/packages/flutter_tools/test/commands/precache_test.dart
+++ b/packages/flutter_tools/test/commands/precache_test.dart
@@ -44,7 +44,7 @@
});
final MockFlutterVersion flutterVersion = MockFlutterVersion();
- when(flutterVersion.isStable).thenReturn(true);
+ when(flutterVersion.isMaster).thenReturn(false);
testUsingContext('Adds artifact flags to requested artifacts on stable', () async {
// Release lock between test cases.
diff --git a/packages/flutter_tools/test/commands/run_test.dart b/packages/flutter_tools/test/commands/run_test.dart
index b425238..3e6cdf1 100644
--- a/packages/flutter_tools/test/commands/run_test.dart
+++ b/packages/flutter_tools/test/commands/run_test.dart
@@ -201,7 +201,7 @@
class MockStableFlutterVersion extends MockFlutterVersion {
@override
- bool get isStable => true;
+ bool get isMaster => false;
}
class FakeDevice extends Fake implements Device {
diff --git a/packages/flutter_tools/test/runner/flutter_command_test.dart b/packages/flutter_tools/test/runner/flutter_command_test.dart
index bc6582b..acfa7ae 100644
--- a/packages/flutter_tools/test/runner/flutter_command_test.dart
+++ b/packages/flutter_tools/test/runner/flutter_command_test.dart
@@ -276,8 +276,8 @@
final MockVersion stableVersion = MockVersion();
final MockVersion betaVersion = MockVersion();
final FakeCommand fakeCommand = FakeCommand();
- when(stableVersion.isStable).thenReturn(true);
- when(betaVersion.isStable).thenReturn(false);
+ when(stableVersion.isMaster).thenReturn(false);
+ when(betaVersion.isMaster).thenReturn(true);
testUsingContext('Can be disabled on stable branch', () async {
expect(() => fakeCommand.run(), throwsA(isA<ToolExit>()));
diff --git a/packages/flutter_tools/test/src/context.dart b/packages/flutter_tools/test/src/context.dart
index cc145f3..66a6e95 100644
--- a/packages/flutter_tools/test/src/context.dart
+++ b/packages/flutter_tools/test/src/context.dart
@@ -337,7 +337,7 @@
final bool _isStable;
@override
- bool get isStable => _isStable;
+ bool get isMaster => !_isStable;
}
class MockClock extends Mock implements SystemClock {}
diff --git a/packages/flutter_tools/test/web/workflow_test.dart b/packages/flutter_tools/test/web/workflow_test.dart
index 6551104..cd6854f 100644
--- a/packages/flutter_tools/test/web/workflow_test.dart
+++ b/packages/flutter_tools/test/web/workflow_test.dart
@@ -96,8 +96,10 @@
class MockFlutterVersion extends Mock implements FlutterVersion {
MockFlutterVersion(this.isStable);
- @override
final bool isStable;
+
+ @override
+ bool get isMaster => !isStable;
}
class MockProcessManager extends Mock implements ProcessManager {}