Change:
When trying to install , the build fails with: To reproduce, use the following and run it with : I think this happens because of the symlink of the , which seems to be resolved while running the build and in that case the symlink target does not exist. /cc btw: could you please also add support for the latest beta / dev / stable releases?
Hey it's fixed in the latest commit. Can you try it ?
Works fine, thank you very much for the fast fix!

Discussion:
stable = mkFlutter { pname = "flutter"; channel = "stable"; <del> version = "1.12.13+hotfix.8"; sha256Hash = "01ik4xckr3fp65sq4g0g6wy5b9i0r49l643xmbxa6z9k21sby46d"; </del> <ins> version = "1.12.13+hotfix.9"; sha256Hash = "1ql3zvmmk5zk47y30lajxaam04q6vr373dayq15jv4vpc0fzif1y"; </ins> patches = getPatches ./patches/stable; }; beta = mkFlutter { pname = "flutter-beta"; channel = "beta"; <del> version = "1.14.6"; sha256Hash = "1a79pr741zkr39p5gc3p9x59d70vm60hpz2crgc53ysglj4ycigy"; </del> <ins> version = "1.15.17"; sha256Hash = "0iil6y6y477dhjgzx54ab5m9nj0jg4xl8x4zzd9iwh8m756r7qsd"; </ins> patches = getPatches ./patches/beta; }; <del> dev = mkFlutter { </del> <ins> dev = mkFlutter rec { </ins> pname = "flutter-dev"; channel = "dev"; <del> version = "1.15.3"; sha256Hash = "06mawwqf7q7wdmzlyxlrlblhnnk4ckf3vp92lplippdh3d52r93i"; patches = getPatches ./patches/dev; </del> <ins> version = "1.17.0-dev.5.0"; filename = "flutter_linux_${version}-${channel}.tar.xz"; sha256Hash = "0ks2jf2bd42y2jsc91p33r57q7j3m94d8ihkmlxzwi53x1mwp0pk"; patches = getPatches ./patches/beta; </ins> }; }

<del> { channel, pname, version, sha256Hash, patches }: </del> <ins> { channel, pname, version, sha256Hash, patches , filename ? "flutter_linux_v${version}-${channel}.tar.xz" }: </ins> { bash, buildFHSUserEnv, cacert, coreutils, git, makeWrapper, runCommand, stdenv , fetchurl, alsaLib, dbus, expat, libpulseaudio, libuuid, libX11, libxcb

src = fetchurl { url = <del> "https://storage.googleapis.com/flutter_infra/releases/${channel}/linux/flutter_linux_v${version}-${channel}.tar.xz"; </del> <ins> "https://storage.googleapis.com/flutter_infra/releases/${channel}/linux/${filename}"; </ins> sha256 = sha256Hash; };

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); <del> +    recursiveCopy(Directory(path.join(homeDirPath, '.cache', 'flutter', 'artifacts', 'gradle_wrapper')), tempDir); </del> <ins> +    recursiveCopy(Directory(path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'gradle_wrapper')), tempDir); </ins> 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(

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'), <del> +        baseDir: globals.fs.path.join(homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'), </del> <ins> +        baseDir: globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'artifacts', 'material_fonts'), </ins> relativeUri: Uri(path: entryUri.pathSegments.last), entryUri: entryUri, ));

} assert(_lock == null); + <del> +    final Directory dir = globals.fs.directory(globals.fs.path.join(homeDirPath, '.cache', 'flutter')); </del> <ins> +    final Directory dir = globals.fs.directory(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter')); </ins> +    if (!dir.existsSync()) { +      dir.createSync(recursive: true); <del> +      os.chmod(dir, '755'); </del> <ins> +      globals.os.chmod(dir, '755'); </ins> +    } final File lockFile = -        globals.fs.file(globals.fs.path.join(flutterRoot, 'bin', 'cache', 'lockfile')); <del> +        globals.fs.file(globals.fs.path.join(homeDirPath, '.cache', 'flutter', 'lockfile')); </del> <ins> +        globals.fs.file(globals.fs.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter', 'lockfile')); </ins> try { _lock = lockFile.openSync(mode: FileMode.write); } on FileSystemException catch (e) {

return _fileSystem.directory(_fileSystem.path.join(_rootOverride.path, 'bin', 'cache')); } else { -      return _fileSystem.directory(_fileSystem.path.join(flutterRoot, 'bin', 'cache')); <del> +      return _fileSystem.directory(_fileSystem.path.join(homeDirPath, '.cache', 'flutter')); </del> <ins> +      return _fileSystem.directory(_fileSystem.path.join(globals.fsUtils.homeDirPath, '.cache', 'flutter')); </ins> } }

<del> ../beta/disable-auto-update.patch </del>  No newline at end of file

<del> diff --git a/dev/devicelab/lib/framework/runner.dart b/dev/devicelab/lib/framework/runner.dart index 8e511eefd..fbc7d6ac3 100644 --- a/dev/devicelab/lib/framework/runner.dart +++ b/dev/devicelab/lib/framework/runner.dart @@ -126,7 +126,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 79b06949f..9040ba0a8 100644 --- a/packages/flutter_tools/lib/src/asset.dart +++ b/packages/flutter_tools/lib/src/asset.dart @@ -6,6 +6,7 @@ import 'dart:async'; import 'package:yaml/yaml.dart'; +import 'base/common.dart'; import 'base/context.dart'; import 'base/file_system.dart'; import 'base/utils.dart'; @@ -325,7 +326,7 @@ List<_Asset> _getMaterialAssets(String fontSet) { for (final Map<dynamic, dynamic> font in family['fonts']) { 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, )); diff --git a/packages/flutter_tools/lib/src/cache.dart b/packages/flutter_tools/lib/src/cache.dart index 715189938..5afb2a0db 100644 --- a/packages/flutter_tools/lib/src/cache.dart +++ b/packages/flutter_tools/lib/src/cache.dart @@ -189,8 +189,14 @@ 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) { @@ -290,7 +296,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')); } } </del>