SIGN IN SIGN UP

[native_assets] Roll native packages (#191253)

Rolls Dart native asset packages (`code_assets`, `hooks`,
`hooks_runner`, `native_toolchain_c`, `record_use`) to their latest
published releases.

### Package Rolls
| Package | Old Version | New Version |
| :--- | :--- | :--- |
| `package:code_assets` | `1.2.1` | `2.0.0` |
| `package:hooks` | `2.1.0` | `2.2.0` |
| `package:hooks_runner` | `1.6.1` | `1.6.2` |
| `package:native_toolchain_c` | `0.19.3` | `0.19.4` |
| `package:record_use` | `1.1.0` | `1.1.1` |
| `package:objective_c` (transitively) | `9.4.1` | `9.6.0` |

Migration changes:

* **`package:code_assets` v2.0.0**: Overrides `==` and `hashCode` in
`OS`, `Architecture`, and `Sanitizer` to support custom targets. Because
these objects no longer have primitive equality, they cannot be used as
keys or elements in `const` collections. Migrated `const _osTargets` in
[`native_assets.dart`](file:///Users/dacoharkes/src/flutter/flutter/packages/flutter_tools/lib/src/isolated/native_assets/native_assets.dart#L1009)
to a `final Map` with runtime set literals.
* **`package:hooks` v2.2.0 (`HookInput` eager directory creation & test
context updates)**: In `package:hooks` v2.2.0, reading
`HookInput.outputDirectory` eagerly calls `.createSync(recursive: true)`
on the target directory. When `FakeFlutterNativeAssetsBuildRunner`
instantiates `BuildInput` in isolated unit tests, this now touches disk
during hook checks:
* **Filesystem Safety Guard Symlink Resolution (`fs_safety.dart`)**: On
macOS, creating subdirectories under `/var/folders/...` triggered
false-positive filesystem guard violations (`FileSystemException`).
Flutter's `fs_safety.dart` failed to recognize allowed temp paths
because calling `.resolveSymbolicLinksSync()` on paths whose leaf
directories did not exist yet threw `PathNotFoundException`, leaving
`/var` unresolved to `/private/var`. Added `_canonicalizeWithSymlinks`
in
[`fs_safety.dart`](file:///Users/dacoharkes/src/flutter/flutter/packages/flutter_tools/test/src/fs_safety.dart#L40-L55)
to walk up parent directories and resolve symlinks for non-existent
target paths.
* **Test Context Overrides**: Added missing `FeatureFlags: () =>
TestFeatureFlags(...)` context overrides and `fakes.dart` imports to
isolated native asset unit tests (`android`, `ios`, `macos`, `windows`).
Without in-memory feature flag mocks, checking `featureFlags` in
`_hookRunRequired` initializes `globals.config`, which attempts to
create `.flutter_settings` folders on disk and collides with
`testUsingContext`'s filesystem guard.
D
Daco Harkes committed
bb5b1dc85f5b8c15888996eb795775ffd9d585d8
Parent: 57e47bd
Committed by GitHub <noreply@github.com> on 8/24/2026, 5:22:07 PM