Skip to content

[native_assets] Use kernel concatenation instead of passing in asset-mapping into kernel compilation #146270

Description

@dcharkes

We'd like to support adding new assets in link hooks (#146263).

Use cases:

  • The build hook outputting a static library and then the link hook making a dynamic library of it.
  • Combining multiple assets into one.

Because the link hooks are run after kernel compilation, that will require using kernel concatenation instead of passing in the native asset mapping before kernel compilation.

Dart tracking issue:

Activity

  1. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    team-toolOwned by Flutter Tool team
    on Apr 4, 2024
  2. self-assigned this
    on Apr 4, 2024
  3. dcharkes commented on Apr 18, 2024

    @dcharkes
    ContributorAuthor

    The kernel kernel-file compilation currently uses the frontend_server with a single-shot invocation from the KernelSnapshot Target.

    Some implementation considerations:

    • We can either run the frontend_server twice as a process invocation, or keep the process running after the dart compilation and then shut it down after native assets compilation to kernel. Keeping the process running would require more coordination between different Targets.
    • We can either chose to only do separate kernel file compilation in release (AOT) builds, or do it both for JIT and AOT. Doing it differently in JIT/AOT means more conditionals in lib/src/build_system/targets/, doing it single-shot in JIT might be more performant though.
  4. github-actions commented on May 21, 2024

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

team-toolOwned by Flutter Tool teamtoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions