From 3e199de1700bc75c78df431a8d8ac45c76b3b2e7 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Sun, 18 Oct 2026 00:23:08 +0200 Subject: [PATCH 1/2] Use custom git URL and standard remotes for version resolution. --- packages/flutter_tools/lib/src/version.dart | 26 +++--- .../test/general.shard/version_test.dart | 2 +- ...use-own-git-url-and-standard-remotes.patch | 82 +++++++++++++++++++ 3 files changed, 97 insertions(+), 13 deletions(-) create mode 100644 packages/flutter_tools_patches/0008-flutter_tools-use-own-git-url-and-standard-remotes.patch diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart index 5e7bd83..0a64377 100644 --- a/packages/flutter_tools/lib/src/version.dart +++ b/packages/flutter_tools/lib/src/version.dart @@ -20,6 +20,17 @@ import 'globals.dart' as globals; /// The default version when a version could not be determined. const kUnknownFrameworkVersion = '0.0.0-unknown'; +const String kFrameworkGitUrl = 'https://github.com/knopp/flutter_zero.git'; + +const List kStandardGitRemotes = [ + 'https://github.com/knopp/flutter_zero.git', + 'git@github.com:knopp/flutter_zero.git', + 'ssh://git@github.com/knopp/flutter_zero.git', + 'https://github.com/flutter/flutter.git', + 'git@github.com:flutter/flutter.git', + 'ssh://git@github.com/flutter/flutter.git', +]; + /// A git shortcut for the branch that is being tracked by the current one. /// /// See `man gitrevisions` for more information. @@ -873,11 +884,7 @@ class VersionUpstreamValidator { } // The predefined list of remotes that are considered to be standard. - static final _standardRemotes = [ - 'https://github.com/flutter/flutter.git', - 'git@github.com:flutter/flutter.git', - 'ssh://git@github.com/flutter/flutter.git', - ]; + static final _standardRemotes = kStandardGitRemotes; // Strips ".git" suffix from a given string, preferably an url. // For example, changes 'https://github.com/flutter/flutter.git' to 'https://github.com/flutter/flutter'. @@ -1112,8 +1119,7 @@ class GitTagVersion { } } } else { - final String flutterGit = - platform.environment['FLUTTER_GIT_URL'] ?? 'https://github.com/flutter/flutter.git'; + final String flutterGit = platform.environment['FLUTTER_GIT_URL'] ?? kFrameworkGitUrl; git.runSync(['fetch', flutterGit, '--tags', '-f'], workingDirectory: workingDirectory); } } @@ -1493,11 +1499,7 @@ bool _isStandardRemote(String remote) { if (customGitUrl != null && VersionUpstreamValidator.stripDotGit(customGitUrl) == sanitized) { return true; } - for (final standard in const [ - 'https://github.com/flutter/flutter.git', - 'git@github.com:flutter/flutter.git', - 'ssh://git@github.com/flutter/flutter.git', - ]) { + for (final standard in kStandardGitRemotes) { if (VersionUpstreamValidator.stripDotGit(standard) == sanitized) { return true; } diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart index 5e695e7..c130068 100644 --- a/packages/flutter_tools/test/general.shard/version_test.dart +++ b/packages/flutter_tools/test/general.shard/version_test.dart @@ -1647,7 +1647,7 @@ void main() { stdout: 'master', ), const FakeCommand( - command: ['git', 'fetch', 'https://github.com/flutter/flutter.git', '--tags', '-f'], + command: ['git', 'fetch', 'https://github.com/knopp/flutter_zero.git', '--tags', '-f'], ), const FakeCommand(command: ['git', 'tag', '--points-at', 'HEAD']), ...mockGitTagHistory( diff --git a/packages/flutter_tools_patches/0008-flutter_tools-use-own-git-url-and-standard-remotes.patch b/packages/flutter_tools_patches/0008-flutter_tools-use-own-git-url-and-standard-remotes.patch new file mode 100644 index 0000000..d927da0 --- /dev/null +++ b/packages/flutter_tools_patches/0008-flutter_tools-use-own-git-url-and-standard-remotes.patch @@ -0,0 +1,82 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Matej Knopp +Date: Sun, 18 Oct 2026 00:20:59 +0200 +Subject: [PATCH] Use our own git url and standard remotes for version resolution + +--- + packages/flutter_tools/lib/src/version.dart | 26 ++++++++++++---------- + .../test/general.shard/version_test.dart | 2 +- + 2 files changed, 15 insertions(+), 13 deletions(-) +diff --git a/packages/flutter_tools/lib/src/version.dart b/packages/flutter_tools/lib/src/version.dart +index 5e7bd837b84..0a64377653e 100644 +--- a/packages/flutter_tools/lib/src/version.dart ++++ b/packages/flutter_tools/lib/src/version.dart +@@ -20,6 +20,17 @@ import 'globals.dart' as globals; + /// The default version when a version could not be determined. + const kUnknownFrameworkVersion = '0.0.0-unknown'; + ++const String kFrameworkGitUrl = 'https://github.com/knopp/flutter_zero.git'; ++ ++const List kStandardGitRemotes = [ ++ 'https://github.com/knopp/flutter_zero.git', ++ 'git@github.com:knopp/flutter_zero.git', ++ 'ssh://git@github.com/knopp/flutter_zero.git', ++ 'https://github.com/flutter/flutter.git', ++ 'git@github.com:flutter/flutter.git', ++ 'ssh://git@github.com/flutter/flutter.git', ++]; ++ + /// A git shortcut for the branch that is being tracked by the current one. + /// + /// See `man gitrevisions` for more information. +@@ -873,11 +884,7 @@ class VersionUpstreamValidator { + } + + // The predefined list of remotes that are considered to be standard. +- static final _standardRemotes = [ +- 'https://github.com/flutter/flutter.git', +- 'git@github.com:flutter/flutter.git', +- 'ssh://git@github.com/flutter/flutter.git', +- ]; ++ static final _standardRemotes = kStandardGitRemotes; + + // Strips ".git" suffix from a given string, preferably an url. + // For example, changes 'https://github.com/flutter/flutter.git' to 'https://github.com/flutter/flutter'. +@@ -1112,8 +1119,7 @@ class GitTagVersion { + } + } + } else { +- final String flutterGit = +- platform.environment['FLUTTER_GIT_URL'] ?? 'https://github.com/flutter/flutter.git'; ++ final String flutterGit = platform.environment['FLUTTER_GIT_URL'] ?? kFrameworkGitUrl; + git.runSync(['fetch', flutterGit, '--tags', '-f'], workingDirectory: workingDirectory); + } + } +@@ -1493,11 +1499,7 @@ bool _isStandardRemote(String remote) { + if (customGitUrl != null && VersionUpstreamValidator.stripDotGit(customGitUrl) == sanitized) { + return true; + } +- for (final standard in const [ +- 'https://github.com/flutter/flutter.git', +- 'git@github.com:flutter/flutter.git', +- 'ssh://git@github.com/flutter/flutter.git', +- ]) { ++ for (final standard in kStandardGitRemotes) { + if (VersionUpstreamValidator.stripDotGit(standard) == sanitized) { + return true; + } +diff --git a/packages/flutter_tools/test/general.shard/version_test.dart b/packages/flutter_tools/test/general.shard/version_test.dart +index 5e695e7673e..c1300687e63 100644 +--- a/packages/flutter_tools/test/general.shard/version_test.dart ++++ b/packages/flutter_tools/test/general.shard/version_test.dart +@@ -1647,7 +1647,7 @@ void main() { + stdout: 'master', + ), + const FakeCommand( +- command: ['git', 'fetch', 'https://github.com/flutter/flutter.git', '--tags', '-f'], ++ command: ['git', 'fetch', 'https://github.com/knopp/flutter_zero.git', '--tags', '-f'], + ), + const FakeCommand(command: ['git', 'tag', '--points-at', 'HEAD']), + ...mockGitTagHistory( +-- +2.51.2 From b51645a952bf54519c0d05733e684f89ebbaebf3 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Sun, 18 Oct 2026 01:12:48 +0200 Subject: [PATCH 2/2] [win32] Remove the predicate from TimerThread condition variable. --- .../flutter/shell/platform/windows/task_runner_window.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/shell/platform/windows/task_runner_window.cc b/engine/src/flutter/shell/platform/windows/task_runner_window.cc index 08b69a6..1faa72c 100644 --- a/engine/src/flutter/shell/platform/windows/task_runner_window.cc +++ b/engine/src/flutter/shell/platform/windows/task_runner_window.cc @@ -59,10 +59,10 @@ void TimerThread::ScheduleAt( void TimerThread::TimerThreadMain() { std::unique_lock lock(mutex_); while (callback_ != nullptr) { - cv_.wait_until(lock, next_fire_time_, [this]() { - return std::chrono::high_resolution_clock::now() >= next_fire_time_ || - callback_ == nullptr; - }); + cv_.wait_until(lock, next_fire_time_); + if (next_fire_time_ > std::chrono::high_resolution_clock::now()) { + continue; + } auto scheduled_count = schedule_counter_; if (callback_) { lock.unlock();