Merge pull request #173200 from NANASHI0X74/flutter-3-0-0
Flutter: 2.10.1->3.0.4
This commit is contained in:
commit
38dd05d2ec
@ -10,7 +10,7 @@ flutter.mkFlutterApp rec {
|
||||
pname = "fluffychat";
|
||||
version = "1.2.0";
|
||||
|
||||
vendorHash = "sha256-j5opwEFifa+DMG7Uziv4SWEPVokD6OSq8mSIr0AdDL0=";
|
||||
vendorHash = "sha256-co+bnsVIyg42JpM9FimfGEjrd6A99GlBeow1Dgv7NBI=";
|
||||
|
||||
src = fetchFromGitLab {
|
||||
owner = "famedly";
|
||||
|
@ -4,24 +4,25 @@ let
|
||||
getPatches = dir:
|
||||
let files = builtins.attrNames (builtins.readDir dir);
|
||||
in map (f: dir + ("/" + f)) files;
|
||||
version = "2.10.1";
|
||||
version = "3.0.4";
|
||||
channel = "stable";
|
||||
filename = "flutter_linux_${version}-${channel}.tar.xz";
|
||||
|
||||
# Decouples flutter derivation from dart derivation,
|
||||
# use specific dart version to not need to bump dart derivation when bumping flutter.
|
||||
dartVersion = "2.16.2";
|
||||
dartVersion = "2.17.5";
|
||||
dartSourceBase = "https://storage.googleapis.com/dart-archive/channels";
|
||||
dartForFlutter = dart.override {
|
||||
version = dartVersion;
|
||||
sources = {
|
||||
"${dartVersion}-x86_64-linux" = fetchurl {
|
||||
url = "${dartSourceBase}/stable/release/${dartVersion}/sdk/dartsdk-linux-x64-release.zip";
|
||||
sha256 = "sha256-egrYd7B4XhkBiHPIFE2zopxKtQ58GqlogAKA/UeiXnI=";
|
||||
sha256 = "sha256-AFJGeiPsjUZSO+DykmOIFETg2jIohg62tp3ghZrKJFk=";
|
||||
};
|
||||
};
|
||||
};
|
||||
in {
|
||||
in
|
||||
{
|
||||
inherit mkFlutter;
|
||||
stable = mkFlutter rec {
|
||||
inherit version;
|
||||
@ -29,7 +30,7 @@ in {
|
||||
pname = "flutter";
|
||||
src = fetchurl {
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/${channel}/linux/${filename}";
|
||||
sha256 = "sha256-rSfwcglDV2rvJl10j7FByAWmghd2FYxrlkgYnvRO54Y=";
|
||||
sha256 = "sha256-vh3QjLGFBN321DUET9XhYqSkILjEj+ZqAALu/mxY+go=";
|
||||
};
|
||||
patches = getPatches ./patches;
|
||||
};
|
||||
|
@ -61,7 +61,7 @@ let
|
||||
# path is relative otherwise it's replaced by /build/flutter
|
||||
|
||||
pushd "$FLUTTER_TOOLS_DIR"
|
||||
${dart}/bin/pub get --offline
|
||||
${dart}/bin/dart pub get --offline
|
||||
popd
|
||||
|
||||
local revision="$(cd "$FLUTTER_ROOT"; git rev-parse HEAD)"
|
||||
|
102
pkgs/development/compilers/flutter/patches/git-dir.patch
Normal file
102
pkgs/development/compilers/flutter/patches/git-dir.patch
Normal file
@ -0,0 +1,102 @@
|
||||
diff --git a/dev/bots/prepare_package.dart b/dev/bots/prepare_package.dart
|
||||
index 468a91a954..5def6897ce 100644
|
||||
--- a/dev/bots/prepare_package.dart
|
||||
+++ b/dev/bots/prepare_package.dart
|
||||
@@ -525,7 +525,7 @@ class ArchiveCreator {
|
||||
|
||||
Future<String> _runGit(List<String> args, {Directory? workingDirectory}) {
|
||||
return _processRunner.runProcess(
|
||||
- <String>['git', ...args],
|
||||
+ <String>['git', '--git-dir', '.git', ...args],
|
||||
workingDirectory: workingDirectory ?? flutterRoot,
|
||||
);
|
||||
}
|
||||
diff --git a/packages/flutter_tools/lib/src/commands/downgrade.dart b/packages/flutter_tools/lib/src/commands/downgrade.dart
|
||||
index bb0eb428a9..4a2a48bb5e 100644
|
||||
--- a/packages/flutter_tools/lib/src/commands/downgrade.dart
|
||||
+++ b/packages/flutter_tools/lib/src/commands/downgrade.dart
|
||||
@@ -118,7 +118,7 @@ class DowngradeCommand extends FlutterCommand {
|
||||
// Detect unknown versions.
|
||||
final ProcessUtils processUtils = _processUtils!;
|
||||
final RunResult parseResult = await processUtils.run(<String>[
|
||||
- 'git', 'describe', '--tags', lastFlutterVersion,
|
||||
+ 'git', '--git-dir', '.git', 'describe', '--tags', lastFlutterVersion,
|
||||
], workingDirectory: workingDirectory);
|
||||
if (parseResult.exitCode != 0) {
|
||||
throwToolExit('Failed to parse version for downgrade:\n${parseResult.stderr}');
|
||||
@@ -191,7 +191,7 @@ class DowngradeCommand extends FlutterCommand {
|
||||
continue;
|
||||
}
|
||||
final RunResult parseResult = await _processUtils!.run(<String>[
|
||||
- 'git', 'describe', '--tags', sha,
|
||||
+ 'git', '--git-dir', '.git', 'describe', '--tags', sha,
|
||||
], workingDirectory: workingDirectory);
|
||||
if (parseResult.exitCode == 0) {
|
||||
buffer.writeln('Channel "${getNameForChannel(channel)}" was previously on: ${parseResult.stdout}.');
|
||||
diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart
|
||||
index f2068a6ca2..99b161689e 100644
|
||||
--- a/packages/flutter_tools/lib/src/version.dart
|
||||
+++ b/packages/flutter_tools/lib/src/version.dart
|
||||
@@ -106,7 +106,7 @@ class FlutterVersion {
|
||||
String? channel = _channel;
|
||||
if (channel == null) {
|
||||
final String gitChannel = _runGit(
|
||||
- 'git rev-parse --abbrev-ref --symbolic @{u}',
|
||||
+ 'git --git-dir .git rev-parse --abbrev-ref --symbolic @{u}',
|
||||
globals.processUtils,
|
||||
_workingDirectory,
|
||||
);
|
||||
@@ -114,7 +114,7 @@ class FlutterVersion {
|
||||
if (slash != -1) {
|
||||
final String remote = gitChannel.substring(0, slash);
|
||||
_repositoryUrl = _runGit(
|
||||
- 'git ls-remote --get-url $remote',
|
||||
+ 'git --git-dir .git ls-remote --get-url $remote',
|
||||
globals.processUtils,
|
||||
_workingDirectory,
|
||||
);
|
||||
@@ -326,7 +326,7 @@ class FlutterVersion {
|
||||
/// the branch name will be returned as `'[user-branch]'`.
|
||||
String getBranchName({ bool redactUnknownBranches = false }) {
|
||||
_branch ??= () {
|
||||
- final String branch = _runGit('git rev-parse --abbrev-ref HEAD', globals.processUtils);
|
||||
+ final String branch = _runGit('git --git-dir .git rev-parse --abbrev-ref HEAD', globals.processUtils);
|
||||
return branch == 'HEAD' ? channel : branch;
|
||||
}();
|
||||
if (redactUnknownBranches || _branch!.isEmpty) {
|
||||
@@ -359,7 +359,7 @@ class FlutterVersion {
|
||||
/// wrapper that does that.
|
||||
@visibleForTesting
|
||||
static List<String> gitLog(List<String> args) {
|
||||
- return <String>['git', '-c', 'log.showSignature=false', 'log'] + args;
|
||||
+ return <String>['git', '-c', 'log.showSignature=false', '--git-dir', '.git', 'log'] + args;
|
||||
}
|
||||
|
||||
/// Gets the release date of the latest available Flutter version.
|
||||
@@ -730,7 +730,7 @@ class GitTagVersion {
|
||||
|
||||
static GitTagVersion determine(ProcessUtils processUtils, {String? workingDirectory, bool fetchTags = false, String gitRef = 'HEAD'}) {
|
||||
if (fetchTags) {
|
||||
- final String channel = _runGit('git rev-parse --abbrev-ref HEAD', processUtils, workingDirectory);
|
||||
+ final String channel = _runGit('git --git-dir .git rev-parse --abbrev-ref HEAD', processUtils, workingDirectory);
|
||||
if (channel == 'dev' || channel == 'beta' || channel == 'stable') {
|
||||
globals.printTrace('Skipping request to fetchTags - on well known channel $channel.');
|
||||
} else {
|
||||
@@ -739,7 +739,7 @@ class GitTagVersion {
|
||||
}
|
||||
// find all tags attached to the given [gitRef]
|
||||
final List<String> tags = _runGit(
|
||||
- 'git tag --points-at $gitRef', processUtils, workingDirectory).trim().split('\n');
|
||||
+ 'git --git-dir .git tag --points-at $gitRef', processUtils, workingDirectory).trim().split('\n');
|
||||
|
||||
// Check first for a stable tag
|
||||
final RegExp stableTagPattern = RegExp(r'^\d+\.\d+\.\d+$');
|
||||
@@ -760,7 +760,7 @@ class GitTagVersion {
|
||||
// recent tag and number of commits past.
|
||||
return parse(
|
||||
_runGit(
|
||||
- 'git describe --match *.*.* --long --tags $gitRef',
|
||||
+ 'git --git-dir .git describe --match *.*.* --long --tags $gitRef',
|
||||
processUtils,
|
||||
workingDirectory,
|
||||
)
|
@ -70,3 +70,133 @@ index defc86cc20..7fdf14d112 100644
|
||||
}
|
||||
}
|
||||
|
||||
diff --git a/packages/flutter_tools/lib/src/artifacts.dart b/packages/flutter_tools/lib/src/artifacts.dart
|
||||
index 2aac9686e8..32c4b98b88 100644
|
||||
--- a/packages/flutter_tools/lib/src/artifacts.dart
|
||||
+++ b/packages/flutter_tools/lib/src/artifacts.dart
|
||||
@@ -346,10 +346,10 @@ class CachedArtifacts implements Artifacts {
|
||||
) {
|
||||
switch (artifact) {
|
||||
case HostArtifact.engineDartSdkPath:
|
||||
- final String path = _dartSdkPath(_cache);
|
||||
+ final String path = _dartSdkPath(_fileSystem);
|
||||
return _fileSystem.directory(path);
|
||||
case HostArtifact.engineDartBinary:
|
||||
- final String path = _fileSystem.path.join(_dartSdkPath(_cache), 'bin', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
+ final String path = _fileSystem.path.join(_dartSdkPath(_fileSystem), 'bin', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
return _fileSystem.file(path);
|
||||
case HostArtifact.flutterWebSdk:
|
||||
final String path = _getFlutterWebSdkPath();
|
||||
@@ -398,7 +398,7 @@ class CachedArtifacts implements Artifacts {
|
||||
case HostArtifact.dart2jsSnapshot:
|
||||
case HostArtifact.dartdevcSnapshot:
|
||||
case HostArtifact.kernelWorkerSnapshot:
|
||||
- final String path = _fileSystem.path.join(_dartSdkPath(_cache), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
+ final String path = _fileSystem.path.join(_dartSdkPath(_fileSystem), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
return _fileSystem.file(path);
|
||||
case HostArtifact.iosDeploy:
|
||||
final String artifactFileName = _hostArtifactToFileName(artifact, _platform.isWindows);
|
||||
@@ -461,11 +461,13 @@ class CachedArtifacts implements Artifacts {
|
||||
String _getAndroidArtifactPath(Artifact artifact, TargetPlatform platform, BuildMode mode) {
|
||||
final String engineDir = _getEngineArtifactsPath(platform, mode)!;
|
||||
switch (artifact) {
|
||||
+ case Artifact.frontendServerSnapshotForEngineDartSdk:
|
||||
+ assert(mode != BuildMode.debug, 'Artifact $artifact only available in non-debug mode.');
|
||||
+ return _fileSystem.path.join(engineDir, _artifactToFileName(artifact));
|
||||
case Artifact.genSnapshot:
|
||||
assert(mode != BuildMode.debug, 'Artifact $artifact only available in non-debug mode.');
|
||||
final String hostPlatform = getNameForHostPlatform(getCurrentHostPlatform());
|
||||
return _fileSystem.path.join(engineDir, hostPlatform, _artifactToFileName(artifact));
|
||||
- case Artifact.frontendServerSnapshotForEngineDartSdk:
|
||||
case Artifact.constFinder:
|
||||
case Artifact.flutterFramework:
|
||||
case Artifact.flutterMacOSFramework:
|
||||
@@ -497,13 +499,13 @@ class CachedArtifacts implements Artifacts {
|
||||
switch (artifact) {
|
||||
case Artifact.genSnapshot:
|
||||
case Artifact.flutterXcframework:
|
||||
+ case Artifact.frontendServerSnapshotForEngineDartSdk:
|
||||
final String artifactFileName = _artifactToFileName(artifact)!;
|
||||
final String engineDir = _getEngineArtifactsPath(platform, mode)!;
|
||||
return _fileSystem.path.join(engineDir, artifactFileName);
|
||||
case Artifact.flutterFramework:
|
||||
final String engineDir = _getEngineArtifactsPath(platform, mode)!;
|
||||
return _getIosEngineArtifactPath(engineDir, environmentType, _fileSystem);
|
||||
- case Artifact.frontendServerSnapshotForEngineDartSdk:
|
||||
case Artifact.constFinder:
|
||||
case Artifact.flutterMacOSFramework:
|
||||
case Artifact.flutterMacOSPodspec:
|
||||
@@ -594,14 +596,10 @@ class CachedArtifacts implements Artifacts {
|
||||
// For script snapshots any gen_snapshot binary will do. Returning gen_snapshot for
|
||||
// android_arm in profile mode because it is available on all supported host platforms.
|
||||
return _getAndroidArtifactPath(artifact, TargetPlatform.android_arm, BuildMode.profile);
|
||||
- case Artifact.frontendServerSnapshotForEngineDartSdk:
|
||||
- return _fileSystem.path.join(
|
||||
- _dartSdkPath(_cache), 'bin', 'snapshots',
|
||||
- _artifactToFileName(artifact),
|
||||
- );
|
||||
case Artifact.flutterTester:
|
||||
case Artifact.vmSnapshotData:
|
||||
case Artifact.isolateSnapshotData:
|
||||
+ case Artifact.frontendServerSnapshotForEngineDartSdk:
|
||||
case Artifact.icuData:
|
||||
final String engineArtifactsPath = _cache.getArtifactDirectory('engine').path;
|
||||
final String platformDirName = _enginePlatformDirectoryName(platform);
|
||||
@@ -797,7 +795,7 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
|
||||
final String path = _fileSystem.path.join(_hostEngineOutPath, 'dart-sdk', 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
return _fileSystem.file(path);
|
||||
case HostArtifact.dartdevcSnapshot:
|
||||
- final String path = _fileSystem.path.join(_dartSdkPath(_cache), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
+ final String path = _fileSystem.path.join(_dartSdkPath(_fileSystem), 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
return _fileSystem.file(path);
|
||||
case HostArtifact.kernelWorkerSnapshot:
|
||||
final String path = _fileSystem.path.join(_hostEngineOutPath, 'dart-sdk', 'bin', 'snapshots', _hostArtifactToFileName(artifact, _platform.isWindows));
|
||||
@@ -922,9 +920,7 @@ class CachedLocalEngineArtifacts implements LocalEngineArtifacts {
|
||||
case Artifact.windowsUwpCppClientWrapper:
|
||||
return _fileSystem.path.join(_hostEngineOutPath, artifactFileName);
|
||||
case Artifact.frontendServerSnapshotForEngineDartSdk:
|
||||
- return _fileSystem.path.join(
|
||||
- _hostEngineOutPath, 'dart-sdk', 'bin', 'snapshots', artifactFileName,
|
||||
- );
|
||||
+ return _fileSystem.path.join(_hostEngineOutPath, 'gen', artifactFileName);
|
||||
case Artifact.uwptool:
|
||||
return _fileSystem.path.join(_hostEngineOutPath, artifactFileName);
|
||||
}
|
||||
@@ -1034,8 +1030,8 @@ class OverrideArtifacts implements Artifacts {
|
||||
}
|
||||
|
||||
/// Locate the Dart SDK.
|
||||
-String _dartSdkPath(Cache cache) {
|
||||
- return cache.getRoot().childDirectory('dart-sdk').path;
|
||||
+String _dartSdkPath(FileSystem fileSystem) {
|
||||
+ return fileSystem.path.join(Cache.flutterRoot!, 'bin', 'cache', 'dart-sdk');
|
||||
}
|
||||
|
||||
class _TestArtifacts implements Artifacts {
|
||||
diff --git a/packages/flutter_tools/test/general.shard/artifacts_test.dart b/packages/flutter_tools/test/general.shard/artifacts_test.dart
|
||||
index d906511a15..adfdd4bb42 100644
|
||||
--- a/packages/flutter_tools/test/general.shard/artifacts_test.dart
|
||||
+++ b/packages/flutter_tools/test/general.shard/artifacts_test.dart
|
||||
@@ -153,10 +153,6 @@ void main() {
|
||||
artifacts.getArtifactPath(Artifact.windowsUwpDesktopPath, platform: TargetPlatform.windows_uwp_x64, mode: BuildMode.release),
|
||||
fileSystem.path.join('root', 'bin', 'cache', 'artifacts', 'engine', 'windows-uwp-x64-release'),
|
||||
);
|
||||
- expect(
|
||||
- artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk),
|
||||
- fileSystem.path.join('root', 'bin', 'cache', 'dart-sdk', 'bin', 'snapshots', 'frontend_server.dart.snapshot')
|
||||
- );
|
||||
});
|
||||
|
||||
testWithoutContext('precompiled web artifact paths are correct', () {
|
||||
@@ -322,11 +318,6 @@ void main() {
|
||||
artifacts.getHostArtifact(HostArtifact.engineDartSdkPath).path,
|
||||
fileSystem.path.join('/out', 'host_debug_unopt', 'dart-sdk'),
|
||||
);
|
||||
- expect(
|
||||
- artifacts.getArtifactPath(Artifact.frontendServerSnapshotForEngineDartSdk),
|
||||
- fileSystem.path.join('/out', 'host_debug_unopt', 'dart-sdk', 'bin',
|
||||
- 'snapshots', 'frontend_server.dart.snapshot')
|
||||
- );
|
||||
});
|
||||
|
||||
testWithoutContext('getEngineType', () {
|
||||
|
@ -7,7 +7,7 @@ flutter.mkFlutterApp {
|
||||
pname = "firmware-updater";
|
||||
version = "unstable";
|
||||
|
||||
vendorHash = "sha256-L8am4vTx4KlMHUdIhrUsCxGc27vkolawS/9DyFCPOJQ=";
|
||||
vendorHash = "sha256-3wVA9BLCnMijC0gOmskz+Hv7NQIGu/jhBDbWjmoq1Tc=";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "canonical";
|
||||
|
Loading…
Reference in New Issue
Block a user