aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev
diff options
context:
space:
mode:
Diffstat (limited to 'infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev')
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch31
-rw-r--r--infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/move-cache.patch64
2 files changed, 95 insertions, 0 deletions
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch b/infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch
new file mode 100644
index 000000000000..f9ac00d1d323
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/disable-auto-update.patch
@@ -0,0 +1,31 @@
+diff --git a/bin/internal/shared.sh b/bin/internal/shared.sh
+index 22efe87443..c6954575c5 100644
+--- a/bin/internal/shared.sh
++++ b/bin/internal/shared.sh
+@@ -212,8 +212,6 @@ function shared::execute() {
+ # FLUTTER_TOOL_ARGS="--enable-asserts $FLUTTER_TOOL_ARGS"
+ # FLUTTER_TOOL_ARGS="$FLUTTER_TOOL_ARGS --observe=65432"
+
+- upgrade_flutter 7< "$PROG_NAME"
+-
+ BIN_NAME="$(basename "$PROG_NAME")"
+ case "$BIN_NAME" in
+ flutter*)
+diff --git a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
+index fb1616ba96..b973b3fd58 100644
+--- a/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
++++ b/packages/flutter_tools/lib/src/runner/flutter_command_runner.dart
+@@ -291,13 +291,6 @@ class FlutterCommandRunner extends CommandRunner<void> {
+ globals.flutterUsage.suppressAnalytics = true;
+ }
+
+- try {
+- await globals.flutterVersion.ensureVersionFile();
+- } on FileSystemException catch (e) {
+- globals.printError('Failed to write the version file to the artifact cache: "$e".');
+- globals.printError('Please ensure you have permissions in the artifact cache directory.');
+- throwToolExit('Failed to write the version file');
+- }
+ final bool machineFlag = topLevelResults['machine'] as bool;
+ if (topLevelResults.command?.name != 'upgrade' && topLevelResults['version-check'] as bool && !machineFlag) {
+ await globals.flutterVersion.checkFlutterVersionFreshness();
diff --git a/infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/move-cache.patch b/infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/move-cache.patch
new file mode 100644
index 000000000000..eb6ff5cf582e
--- /dev/null
+++ b/infra/libkookie/nixpkgs/pkgs/development/compilers/flutter/patches/dev/move-cache.patch
@@ -0,0 +1,64 @@
+diff --git a/dev/devicelab/lib/framework/runner.dart b/dev/devicelab/lib/framework/runner.dart
+index a059a8e992..b664a7070c 100644
+--- a/dev/devicelab/lib/framework/runner.dart
++++ b/dev/devicelab/lib/framework/runner.dart
+@@ -137,7 +137,7 @@ Future<void> cleanupSystem() async {
+ print('\nTelling Gradle to shut down (JAVA_HOME=$javaHome)');
+ final String gradlewBinaryName = Platform.isWindows ? 'gradlew.bat' : 'gradlew';
+ final Directory tempDir = Directory.systemTemp.createTempSync('flutter_devicelab_shutdown_gradle.');
+- recursiveCopy(Directory(path.join(flutterDirectory.path, 'bin', 'cache', 'artifacts', 'gradle_wrapper')), tempDir);
++ recursiveCopy(Directory(path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'gradle_wrapper')), tempDir);
+ copy(File(path.join(path.join(flutterDirectory.path, 'packages', 'flutter_tools'), 'templates', 'app', 'android.tmpl', 'gradle', 'wrapper', 'gradle-wrapper.properties')), Directory(path.join(tempDir.path, 'gradle', 'wrapper')));
+ if (!Platform.isWindows) {
+ await exec(
+diff --git a/packages/flutter_tools/lib/src/asset.dart b/packages/flutter_tools/lib/src/asset.dart
+index 36714c5fb4..c0cc049ee1 100644
+--- a/packages/flutter_tools/lib/src/asset.dart
++++ b/packages/flutter_tools/lib/src/asset.dart
+@@ -6,6 +6,7 @@ import 'package:meta/meta.dart';
+ import 'package:package_config/package_config.dart';
+ import 'package:yaml/yaml.dart';
+
++import 'base/common.dart';
+ import 'base/context.dart';
+ import 'base/file_system.dart';
+ import 'base/utils.dart';
+@@ -397,7 +398,7 @@ List<_Asset> _getMaterialAssets(String fontSet) {
+ for (final Map<dynamic, dynamic> font in (family['fonts'] as List<dynamic>).cast<Map<dynamic, dynamic>>()) {
+ final Uri entryUri = globals.fs.path.toUri(font['asset'] as String);
+ result.add(_Asset(
+- baseDir: globals.fs.path.join(Cache.flutterRoot, 'bin', 'cache', 'artifacts', 'material_fonts'),
++ baseDir: globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'),
+ relativeUri: Uri(path: entryUri.pathSegments.last),
+ entryUri: entryUri,
+ package: null,
+diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart
+index aaca036d78..43ff428f8d 100644
+--- a/packages/flutter_tools/lib/src/cache.dart
++++ b/packages/flutter_tools/lib/src/cache.dart
+@@ -226,8 +226,15 @@ class Cache {
+ return;
+ }
+ assert(_lock == null);
++
++ final Directory dir = globals.fs.directory(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter'));
++ if (!dir.existsSync()) {
++ dir.createSync(recursive: true);
++ globals.os.chmod(dir, '755');
++ }
++
+ final File lockFile =
+- globals.fs.file(globals.fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile'));
++ globals.fs.file(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'lockfile'));
+ try {
+ _lock = lockFile.openSync(mode: FileMode.write);
+ } on FileSystemException catch (e) {
+@@ -330,7 +337,7 @@ class Cache {
+ if (_rootOverride != null) {
+ return _fileSystem.directory(_fileSystem.path.join(_rootOverride.path, 'bin', 'cache'));
+ } else {
+- return _fileSystem.directory(_fileSystem.path.join(flutterRoot, 'bin', 'cache'));
++ return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter'));
+ }
+ }
+