aports/testing/flutter/no-cache.patch
2025-10-06 07:26:39 +02:00

71 lines
2.1 KiB
Diff

--- ./packages/flutter_tools/lib/src/cache.dart.orig
+++ ./packages/flutter_tools/lib/src/cache.dart
@@ -8,6 +8,7 @@
library;
import 'dart:async';
+import 'dart:io' as io show Platform;
import 'package:crypto/crypto.dart';
import 'package:file/memory.dart';
@@ -318,7 +319,7 @@
var fatalStorageWarning = true;
static RandomAccessFile? _lock;
- static var _lockEnabled = true;
+ static var _lockEnabled = false;
/// Turn off the [lock]/[releaseLock] mechanism.
///
@@ -420,8 +421,8 @@
String get devToolsVersion {
if (_devToolsVersion == null) {
- const devToolsDirPath = 'dart-sdk/bin/resources/devtools';
- final Directory devToolsDir = getCacheDir(devToolsDirPath, shouldCreate: false);
+ final dartSdkRoot = io.Platform.environment['DART_ROOT'] ?? '/usr/lib/dart';
+ final Directory devToolsDir = _fileSystem.directory(dartSdkRoot + '/bin/resources/devtools');
if (!devToolsDir.existsSync()) {
throw Exception('Could not find directory at ${devToolsDir.path}');
}
@@ -721,7 +722,6 @@
}
void setStampFor(String artifactName, String version) {
- getStampFileFor(artifactName).writeAsStringSync(version);
}
File getStampFileFor(String artifactName) {
@@ -1010,31 +1010,6 @@
}
Future<bool> checkForArtifacts(String? engineVersion) async {
- engineVersion ??= version;
- final url = '${cache.storageBaseUrl}/flutter_infra_release/flutter/$engineVersion/';
-
- var exists = false;
- for (final String pkgName in getPackageDirs()) {
- exists = await cache.doesRemoteExist(
- 'Checking package $pkgName is available...',
- Uri.parse('$url$pkgName.zip'),
- );
- if (!exists) {
- return false;
- }
- }
-
- for (final List<String> toolsDir in getBinaryDirs()) {
- final String cacheDir = toolsDir[0];
- final String urlPath = toolsDir[1];
- exists = await cache.doesRemoteExist(
- 'Checking $cacheDir tools are available...',
- Uri.parse(url + urlPath),
- );
- if (!exists) {
- return false;
- }
- }
return true;
}