)]}'
{
  "commit": "295e9f1e553f2e946d6e24f3bf28ca33fc78a83d",
  "tree": "479f7e65a2514eaf72bc6af143f6cb19db2c8873",
  "parents": [
    "e11a3423eb7ccd7e4ed0782929152c75cdc1736c"
  ],
  "author": {
    "name": "William Yang",
    "email": "77467499+wilyan09007@users.noreply.github.com",
    "time": "Tue Aug 18 07:06:06 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Tue Aug 18 07:06:06 2026 +0000"
  },
  "message": "[native_assets] Record bundled code assets under their install name (#190819)\n\nOn macOS and iOS, `flutter_tools` stamps a bundled code asset\u0027s\nframework with the install name\n`@rpath/\u003cname\u003e.framework/\u003cname\u003e`, but records that asset in\n`NativeAssetsManifest.json` as\n`\u003cname\u003e.framework/\u003cname\u003e`. The manifest entry is the string the Dart VM\nhands to `dlopen`, so the two\nnever match. dyld cannot recognize the library under a name it has no\ninstall name for, so it falls\nback on identifying the file on disk, and that identity only holds until\nthe file is replaced.\nRebuilding an app while a debug instance is still running replaces it,\nso the next lazily resolved\n`@Native` binding maps a second copy of the asset into the process. Two\ncopies of a C library do not\nshare its global state, and a handle produced by the first copy is not\nvalid in the second. For\n`package:sqlite3` that is a segfault on the first write after a rebuild,\nand the operation is lost.\n\nBoth strings now come from one `frameworkInstallName` helper, so the\nname stamped into the framework\nand the name recorded in the manifest cannot drift apart again. The\nframework is still bundled at the\nunprefixed path, and\n`DarwinAddToAppNativeAssets.parseNativeAssetsManifest` drops the prefix\nfor the\nadd-to-app and Swift Package callers that use the manifest to find the\nframework on disk.\n\nThe `flutter test` path is unchanged. The tester loads the dylib from\nwhere it was built and its\ninstall name is already the absolute path that the manifest records,\nwhich is why `dart run` and\n`flutter test` never showed this.\n\nFixes https://github.com/flutter/flutter/issues/190799\n\nThe reporter of that issue measured the dyld behaviour on macOS,\nincluding that a manifest entry of\n`@rpath/\u003cname\u003e.framework/\u003cname\u003e` resolves through `dlopen` and leaves a\nsingle mapping across a\nrebuild. iOS goes through the same helper and had the same mismatch, so\nit is fixed here too. I do\nnot have a Mac, so beyond the unit tests added here I am relying on the\nexisting macOS native assets\nintegration tests (`flutter run` with a bundled code asset, in all three\nbuild modes) on CI.\n\n## Pre-launch Checklist\n\n- [x] I read the [Contributor Guide] and followed the process outlined\nthere for submitting PRs.\n- [x] I read the [AI contribution guidelines] and understand my\nresponsibilities, or I am not using AI tools.\n- [x] I read the [Tree Hygiene] wiki page, which explains my\nresponsibilities.\n- [x] I read and followed the [Flutter Style Guide], including [Features\nwe expect every widget to implement].\n- [x] I signed the [CLA].\n- [x] I listed at least one issue that this PR fixes in the description\nabove.\n- [x] I updated/added relevant documentation (doc comments with `///`).\n- [x] I added new tests to check the change I am making, or this PR is\n[test-exempt].\n- [x] I followed the [breaking change policy] and added [Data Driven\nFixes] where supported.\n- [x] All existing and new tests are passing.\n\n\u003c!-- Links --\u003e\n[Contributor Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview\n[AI contribution guidelines]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#ai-contribution-guidelines\n[Tree Hygiene]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md\n[test-exempt]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests\n[Flutter Style Guide]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md\n[Features we expect every widget to implement]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement\n[CLA]: https://cla.developers.google.com/\n[breaking change policy]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes\n[Data Driven Fixes]:\nhttps://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "a34017975d889259b22da16829e4caaa72379e7e",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/lib/src/commands/darwin_add_to_app.dart",
      "new_id": "330faf1fa331a56e66fca0dda978b9f48e86e9d1",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/lib/src/commands/darwin_add_to_app.dart"
    },
    {
      "type": "modify",
      "old_id": "68680a9209599ed890a5b1acd20c3495954f1afe",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart",
      "new_id": "f32e59443e79a1a0054871f570bbab2b659d9c86",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/lib/src/isolated/native_assets/ios/native_assets.dart"
    },
    {
      "type": "modify",
      "old_id": "4a1d0640a2280e15b9de47e159ed4392adca1c8b",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart",
      "new_id": "c3d4f996023422a717881375eddbaafb3469e571",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets.dart"
    },
    {
      "type": "modify",
      "old_id": "d307818d4774281852645f6a3824b35d74b7ddbd",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart",
      "new_id": "48a05f2bd771ccdb640adca0d8a8d0400dd2945e",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/lib/src/isolated/native_assets/macos/native_assets_host.dart"
    },
    {
      "type": "modify",
      "old_id": "84ae4fca7785ce19461bf8dc1fb4e7ba90bd3565",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/commands.shard/hermetic/build_darwin_framework_test.dart",
      "new_id": "55d54344f1e7c10236cfe5308a0e31901def89bb",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/commands.shard/hermetic/build_darwin_framework_test.dart"
    },
    {
      "type": "modify",
      "old_id": "d52b1456a5495c24aada4df9995c6949b339b198",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/commands.shard/hermetic/build_swift_package_test.dart",
      "new_id": "9a139a806fd4378e005831cc4c249e4adab14dbf",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/commands.shard/hermetic/build_swift_package_test.dart"
    },
    {
      "type": "modify",
      "old_id": "90ae6c12be930bb3eec75f69b9a7aa3d10acadc9",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart",
      "new_id": "731aa841bf85b8861717dba78aff158478554abe",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/general.shard/isolated/macos/native_assets_host_test.dart"
    },
    {
      "type": "modify",
      "old_id": "13a6c109b53017970089578609f8f98a48155a25",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart",
      "new_id": "ba0fdc9124361b532b8a100d27882371ec70352a",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/general.shard/isolated/macos/native_assets_test.dart"
    },
    {
      "type": "modify",
      "old_id": "26e47d943d041b4e0820d7ccff6318d389c5c2f6",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/integration.shard/isolated/native_assets_flutter_run_test.dart",
      "new_id": "ea6c8023a1eef860c8b12c03a9e80387ca0990ae",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/integration.shard/isolated/native_assets_flutter_run_test.dart"
    },
    {
      "type": "modify",
      "old_id": "c14f73940275bdbe7fcf38342bc42867ae8c11c0",
      "old_mode": 33188,
      "old_path": "packages/flutter_tools/test/integration.shard/isolated/native_assets_test_utils.dart",
      "new_id": "f22d6be4270984c6fe1cc257afaa522b70ca5f7f",
      "new_mode": 33188,
      "new_path": "packages/flutter_tools/test/integration.shard/isolated/native_assets_test_utils.dart"
    }
  ]
}
