$ the-wire · showcase
Flutter toolchain migrates to DI as clang roll unblocks Xcode 27 stubs
By RepoJournal · Filed · About Mobile platforms · Composed from the cited sources · methodology
Flutter's tool has begun requiring explicit ToolContext and AppleContext in a set of command classes, and a clang roll fixes linker failures against Xcode 27 Release Candidate 1's new arm64e.x1 stub architecture.
Flutter's modular dependency injection migration moved into the command layer. UpgradeCommand, DowngradeCommand, and UpdatePackagesCommand now take dependencies through constructors, with UpgradeCommand requiring a non-null ToolContext and verboseHelp [1]. PackagesCommand, its subcommands, and Pub were migrated onto ToolContext in the same stacked effort [2], and the Darwin framework build commands BuildIOSFrameworkCommand and BuildMacOSFrameworkCommand now require non-null AppleContext and ToolContext, eliminating the direct dependencies and fallbacks on globals.dart and AppContext [3]. These are breaking changes for anyone constructing these classes or their subclasses directly: the old implicit global resolution is gone, and callers must supply the context objects themselves.
The most consequential fix of the day is a clang roll to 07d67299a15ce03b053736e2d31a668ee0576987 [4]. Xcode 27 Release Candidate 1 ships a new target architecture in the MacOS SDK .tbd stub files, arm64e.x1, and the previous toolchain's linker rejected it as an unknown architecture, failing with "ld64.lld: error: could not load" and claiming the .tbd was malformed [4]. The rolled Fuchsia clang toolchain carries the upstream fix, so builds against Xcode 27 RC 1 stubs should link again.
Swift removed -disable-availability-checking from most tests, replacing it with appropriate deployment targets or availability annotations [5]. The PR description notes that a large number of tests disabled availability checking for no discernible reason, suggesting the flag was blindly copied between tests [5]. Follow-on work fixed one Sema test so it passes without the flag [6], and a separate Sema cleanup corrected a test whose RUN: line had been updated when a flag changed from crashing on salvage to diagnosing, leaving the #if SALVAGE blocks ignored [7]. On the compiler codegen side, MemoryLifetimeVerifier no longer assumes worst-case argument effects for callees without computed side effects: the guard used hasArgumentEffects(), which is also true for functions with only escape effects, and since a specialized function inherits escape effects via copyEffects, the guard did not fire as intended [8].
Kotlin's linker shed dead surface across several commits. KotlinIrLinker.currentModule was dropped as unused [9], and KotlinIrLinker.platformSpecificSymbol was dropped in favor of inlining its one custom JKlib implementation [10]. The linker also stopped producing SymbolKind.RECEIVER_PARAMETER_SYMBOL because it carries the same semantics as VALUE_PARAMETER_SYMBOL; the kind cannot be removed outright since old klibs still contain it [11]. Separately, the build dropped macos-x86_64 references from metadata verification, which had been failing update-verification-metadata.sh because kotlin-native-prebuilt-2.5.0-dev-7307-macos-x86_64.tar.gz could not be resolved [12], and Wasm tests in the callableReferences/contextual folder were unmuted after the underlying issue was resolved [13].
Action items
- → Roll to the Flutter clang 07d67299a15ce03b053736e2d31a668ee0576987 toolchain before building against Xcode 27 RC 1 MacOS SDK stubs flutter/flutter [immediate]
- → Audit any code constructing UpgradeCommand, DowngradeCommand, UpdatePackagesCommand, PackagesCommand, Pub, BuildIOSFrameworkCommand, or BuildMacOSFrameworkCommand, which now require explicit ToolContext or AppleContext flutter/flutter [plan]
- → Drop macos-x86_64 entries from metadata verification config so scripts/update-verification-metadata.sh resolves JetBrains/kotlin [plan]
References
- [1] [tool] Migrate Upgrade, Downgrade, and UpdatePackages commands to modular dependency injection (#190787) ↗ flutter/flutter
- [2] [tool] Migrate PackagesCommand and Pub to modular dependency injection (#192460) ↗ flutter/flutter
- [3] [tool] Migrate Darwin framework commands to modular dependency injection (#192252) ↗ flutter/flutter
- [4] Roll clang to 07d67299a15ce03b053736e2d31a668ee0576987 ↗ flutter/flutter
- [5] Remove `-disable-availability-checking` from most tests ↗ apple/swift
- [6] Sema: Fix a test to pass without -disable-availability-checking ↗ apple/swift
- [7] Sema: Some small cleanups ↗ apple/swift
- [8] MemoryLifetimeVerifier: don't assume worst-case argument effects for callees without computed side effects ↗ apple/swift
- [9] [Linker] Drop `KotlinIrLinker.currentModule` property ↗ JetBrains/kotlin
- [10] [Linker] Drop `KotlinIrLinker.platformSpecificSymbol` method ↗ JetBrains/kotlin
- [11] [Linker] Do not produce `SymbolKind.RECEIVER_PARAMETER_SYMBOL` ↗ JetBrains/kotlin
- [12] [Build] Drop references to `macos-x86_64` from metadata verification ↗ JetBrains/kotlin
- [13] [Wasm] remove unnecessary tests muting (callableReferences/contextual folder) ↗ JetBrains/kotlin