Skip to content

Conversation

@chingjun
Copy link
Contributor

This is used when the native assets are built by a separate build system.

Context: b/286799303

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@github-actions github-actions bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Jan 22, 2024
This is used when the native assets are built by a separate build
system.
Copy link
Contributor

@christopherfujino christopherfujino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm, lmk if you need help with the failing tests

@chingjun chingjun added the autosubmit Merge PR when tree becomes green via auto submit App label Jan 23, 2024
@auto-submit auto-submit bot merged commit f52eaae into flutter:master Jan 23, 2024

expect(residentCompiler.recompileCalled, true);
expect(residentCompiler.receivedNativeAssetsYaml, Uri.parse('file:///build/native_assets/macos/native_assets.yaml'));
expect(residentCompiler.receivedNativeAssetsYaml.toString(), endsWith('native_assets/macos/native_assets.yaml'));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

big brain

engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Jan 24, 2024
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Jan 24, 2024
flutter/flutter@5b673c2...19b06f4

2024-01-24 [email protected] Roll Flutter Engine from 7c592dbfa032 to ba3a70ce7722 (2 revisions) (flutter/flutter#142130)
2024-01-24 [email protected] Roll Flutter Engine from 700235c85d4a to 7c592dbfa032 (2 revisions) (flutter/flutter#142108)
2024-01-24 [email protected] Roll Flutter Engine from da96f9de3f69 to 700235c85d4a (1 revision) (flutter/flutter#142100)
2024-01-24 [email protected] Roll Flutter Engine from 220416cfa6ca to da96f9de3f69 (5 revisions) (flutter/flutter#142098)
2024-01-24 [email protected] Don't change the height of the Textfield's labelStyle when it focused. (flutter/flutter#141943)
2024-01-24 [email protected] Ignore a leak. (flutter/flutter#141737)
2024-01-24 [email protected] [github actions] FINALLY fix the mysterious token error in github actions (flutter/flutter#142058)
2024-01-24 [email protected] Revert "Add abifilters to our gradle templates" (flutter/flutter#142089)
2024-01-23 [email protected] Roll Flutter Engine from 0b9b538bd458 to 220416cfa6ca (2 revisions) (flutter/flutter#142079)
2024-01-23 [email protected] Add abifilters to our gradle templates (flutter/flutter#135529)
2024-01-23 [email protected] Roll Flutter Engine from 11a16d83ab6c to 0b9b538bd458 (2 revisions) (flutter/flutter#142076)
2024-01-23 49699333+dependabot[bot]@users.noreply.github.com Bump actions/upload-artifact from 4.2.0 to 4.3.0 (flutter/flutter#142075)
2024-01-23 [email protected] consolidate AssetBundle::entries and AssetBundle::entryKinds into a new type, `AssetBundleEntry` (flutter/flutter#142029)
2024-01-23 [email protected] Roll Flutter Engine from 57d6b518f920 to 11a16d83ab6c (4 revisions) (flutter/flutter#142071)
2024-01-23 [email protected] Roll Flutter Engine from 994054143fc3 to 57d6b518f920 (3 revisions) (flutter/flutter#142067)
2024-01-23 [email protected] [flutter_tools] fix language_version_test and enable shuffle (flutter/flutter#142009)
2024-01-23 [email protected] Merge flutter_goldens_client into flutter_goldens (flutter/flutter#141900)
2024-01-23 [email protected] Allow overriding the native assets yaml file in the resident runner. (flutter/flutter#142016)
2024-01-23 [email protected] Roll Flutter Engine from b229878c57f5 to 994054143fc3 (1 revision) (flutter/flutter#142059)
2024-01-23 [email protected] Update material banner maxScaleFactor to meet GAR requirement  (flutter/flutter#142015)
2024-01-23 [email protected] Add tooltip for the clear button on `SearchAnchor`'s search view (flutter/flutter#141804)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
github-merge-queue bot pushed a commit that referenced this pull request Nov 27, 2024
…embedding (#159322)

This PR introduces a `NativeAssetsManifest.json` next to the
`AssetManifest.bin` and `FontManifest.json`. This removes the need for
embedding the native assets mapping inside the kernel file and enables
decoupling native assets building and bundling from the kernel
compilation in flutter tools. This means `flutter run` no longer does a
dry run of `hook/build.dart` hooks.

(It also means all isolate groups will have the same native assets.
However, since Flutter does not support `Isolate.spawnUri` from kernel
files, this is not a regression.)

Implementation details:

* g3 is still using kernel embedding.
#142016 introduced an argument to
embed a `native_assets.yaml` inside `flutter attach` and `flutter run`
(the outer flutter process), but it is not used in `flutter assemble`
(the inner process when doing `flutter run`). So, those arguments need
to still be respected. However, all other logic related to embedding a
yaml encoding in the kernel file has been removed.
* All dry-run logic has been removed. 🎉 
* The `KernelSnapshot` target no longer depends on the
`InstallCodeAssets` target. Instead, the various OS-specific
"BundleAsset" targets now depend on the `InstallCodeAssets` target. The
`InstallCodeAssets` invokes the build hooks and produces the
`NativeAssetsManifest.json`. The various "BundleAsset" commands
synchronize the `NativeAssetsManifest.json` to the app bundle.
* `InstallCodeAssets` produces a `native_assets.json`, which is renamed
to `NativeAssetsManifest.json` in the various "Bundle" targets. This
means that all unit tests of the "Bundle" targets now need to create
this file. (Similar to how `app.dill` is expected to exist because
`KernelSnapshot` is a dependency of the "Bundle" targets.)
* Because dynamic libraries need to be code signed (at least on iOS and
MacOS), the bundling of the dylibs is _not_ migrated to reuse
`_updateDevFS` (which is used for ordinary assets). Only the 2nd and 3rd
invocation of `flutter assemble` from `xcodebuild` has access to the
code signing identity.

Relevant tests:

* test/integration.shard/isolated/native_assets_test.dart - runs
`flutter run` with native assets including hot restart and hot reload.

TODO:

* Undo engine-roll in this PR after engine has rolled in.

Issue:

* #154425

Related PRs:

* https://dart-review.googlesource.com/c/sdk/+/388161
* flutter/engine#56727

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [x] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [x] All existing and new tests are passing.

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants