-
Notifications
You must be signed in to change notification settings - Fork 43
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ensure the NativeAssetsBuildRunner.link() produces a BuildResult with all assets #1633
Conversation
… all assets Before this change a bundling tool would * call `buildResult = nativeAssetsBuildRunner.build(...)` * call `linkResult = nativeAssetsBuildRunner.link(buildResult: buildResult, ...) * get all assets via `allAssets = [...buildResult.assets, ...linkResult.assets]` => This PR makes the `link()` command produce a `LinkResult` containing all assets of the final application. => One could view this as the assets from `build()` without a linker to go to a default linker that just emits all of it's inputs. => This allows the `link()` step to also perform the application-wide validation steps (not just over all linker outputs but across build & link outputs) Bundling tools now only have to deal with * `buildResult` in JIT mode (where linking is not enabled) * `linkResult` in AOT mode (where linking is enabled) Instead of dealing with both `buildResult` and `linkResult` in AOT mode.
PR HealthBreaking changes ✔️
Changelog Entry ✔️
Changes to files need to be accounted for in their respective changelogs. API leaks ✔️The following packages contain symbols visible in the public API, but not exported by the library. Export these symbols or remove them from your publicly visible API.
License Headers ✔️
All source files should start with a license header. Unrelated files missing license headers
Package publish validation ✔️
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
Will update the tests & changelog |
Now that we don't actually run the build step before kernel compilation of the Dart code in any of the embedders (after I made kernel concatenation work for both JIT/AOT), we could actually do that. 👍 |
Yes, we could make that changes. Though if we ever allowed For now I'll just keep like this to not get too much off-trail (of making the system more flexible). |
Thanks, @dcharkes ! |
Before this change a bundling tool would
buildResult = nativeAssetsBuildRunner.build(...)
allAssets = [...buildResult.assets, ...linkResult.assets]
=> This PR makes the
link()
command produce aLinkResult
containingall assets of the final application.
=> One could view this as the assets from
build()
without a linker to go toa default linker that just emits all of it's inputs.
=> This allows the
link()
step to also perform the application-widevalidation steps (not just over all linker outputs but across build &
link outputs)
Bundling tools now only have to deal with
buildResult
in JIT mode (where linking is not enabled)linkResult
in AOT mode (where linking is enabled)Instead of dealing with both
buildResult
andlinkResult
in AOT mode.(In some sense one actually would prefer a
NativeAssetsBuilder.build
andNativeAssetsBuilder.buildAndLink
instead of the current API that exposes theintermediary result from
build(linkingEnabled: true)
just to be explicitlypassed on to
link
later on)