keep the clide.dart barrel Flutter-free

`lib/kernel/src/toolchain.dart` is a `ChangeNotifier`, so it pulls in
`package:flutter/foundation.dart`. `GitClient` and `PqlClient` imported
it for the resolved binary paths, which leaked Flutter through the
`package:clide/clide.dart` barrel — breaking `dart test` on every core
subsystem suite (`ci/test_core.sh`), since pure Dart can't compile
Flutter packages.

Split the Flutter-free pieces into `toolchain_paths.dart`: `ResolvedPaths`,
`resolveToolchainPaths`, and a new read-only `ToolchainView` interface
with a `ToolchainView.resolved()` const factory. `Toolchain` now
implements `ToolchainView`; the clients depend on the interface. Core
test setups that built a `Toolchain` just to call `applyResolved`
switch to the factory.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-05-14 21:21:09 +02:00
co-authored by Claude
parent a3a10cddf3
commit 5cad98224f
10 changed files with 172 additions and 170 deletions
+3 -3
View File
@@ -1,4 +1,4 @@
/// Typed git client backed by [Toolchain].
/// Typed git client backed by a [ToolchainView].
///
/// Every subprocess call goes through [_run] which uses the resolved
/// absolute binary path from the toolchain. Parsing is delegated to
@@ -7,7 +7,7 @@ library;
import 'dart:io';
import '../../kernel/src/toolchain.dart';
import '../../kernel/src/toolchain_paths.dart';
import 'diff.dart' show GitDiff, parseDiffOutput;
import 'operations.dart' show GitException, GitLogEntry;
import 'status.dart';
@@ -15,7 +15,7 @@ import 'status.dart';
class GitClient {
GitClient({required this.toolchain, required this.workDir});
final Toolchain toolchain;
final ToolchainView toolchain;
final Directory workDir;
// -- queries --------------------------------------------------------------