Archives for dart-sdk and flutter_patched_sdk.#30888
Archives for dart-sdk and flutter_patched_sdk.#30888fluttergithubbot merged 6 commits intoflutter:mainfrom godofredoc:gn_target_2
Conversation
build/archives/BUILD.gn
Outdated
| destination = "platform_strong.dill" | ||
| }, | ||
| ] | ||
| # This is the flutter_sdk from debug configuration. |
There was a problem hiding this comment.
Maybe:
zip_bundle("flutter_patched_sdk") {
file_suffix = ""
path_prefix = ""
if (flutter_runtime_mode == "release") {
file_suffix = "_product"
path_prefix = "flutter_patched_sdk_product/"
}
output = "flutter_patched_sdk${file_suffix}.zip"
deps = [ "//flutter/lib/snapshot:strong_platform" ]
files = [
{
source = "$root_out_dir/flutter_patched_sdk/vm_outline_strong.dill"
destination = "${path_prefix}vm_outline_strong.dill"
},
{
source = "$root_out_dir/flutter_patched_sdk/platform_strong.dill"
destination = "${path_prefix}platform_strong.dill"
},
]
}
build/archives/BUILD.gn
Outdated
| # Flutter consumes the dart sdk as a prebuilt. Rather than regenerating | ||
| # the zip file we are just copying the original file to the artifacts location. | ||
| copy("dart_sdk_archive") { | ||
| sources = [ "//flutter/prebuilts/dartsdk-$host_os-$target_cpu-release.zip" ] |
There was a problem hiding this comment.
This is a bit trickier. See the logic and comments in the top-level BUILD.gn.
We probably only want to expose this target when _build_engine_artifacts is true:
https://github.com/flutter/engine/blob/main/BUILD.gn#L59
And the SDK to copy is given by the logic here:
https://github.com/flutter/engine/blob/main/BUILD.gn#L38
I'd suggest hoisting _build_engine_artifacts and the result of the logic on line 38 to constants in https://github.com/flutter/engine/blob/main/common/config.gni at the bottom near the other Dart SDK constants that you can then import here.
build/archives/BUILD.gn
Outdated
| destination = "platform_strong.dill" | ||
| }, | ||
| ] | ||
| # This is the flutter_sdk from debug configuration. |
There was a problem hiding this comment.
Consider adding a comment about this being used for profile mode as well.
build/archives/BUILD.gn
Outdated
| if (build_engine_artifacts) { | ||
| copy("dart_sdk_archive") { | ||
| sources = [ prebuilt_dart_sdk ] | ||
| outputs = [ "$root_out_dir/zip_archives/dart-sdk-$host_os-$target_cpu.zip" ] |
There was a problem hiding this comment.
prebuilt_dart_sdk is a directory, so I'm not quite sure why GN isn't complaining about this. Maybe it's because the build isn't trying to build the target yet. Also $host_os-$target_cpu should probably be host-host or target-target. Here's a suggestion on how to make sure things stay consistent:
if (build_engine_artifacts && flutter_prebuilt_dart_sdk) {
copy("dart_sdk_archive") {
sources = [ prebuilt_dart_sdk_archive ]
outputs = [ "$root_out_dir/zip_archives/dart-sdk-$prebuilt_dart_sdk_config.zip" ]
}
}prebuilt_dart_sdk_archive and prebuilt_dart_sdk_config we can define in common/config.gni.
| "//flutter/prebuilts/$_target_os_name-$target_cpu/dart-sdk" | ||
| host_prebuilt_dart_sdk = | ||
| "//flutter/prebuilts/$_host_os_name-$host_cpu/dart-sdk" | ||
|
|
There was a problem hiding this comment.
_target_prebuilt_dart_sdk_config = "$_target_os_name-$target_cpu"
_host_prebuilt_dart_sdk_config = "$_host_os_name-$host_cpu"
_target_prebuilt_dart_sdk_archive =
"//flutter/prebuilts/dartsdk-$_target_prebuilt_dart_sdk_config-release.zip"
_host_prebuilt_dart_sdk_archive =
"//flutter/prebuilts/dartsdk-$_host_prebuilt_dart_sdk_config-release.zip"
target_prebuilt_dart_sdk = "//flutter/prebuilts/$_target_prebuilt_dart_sdk_config/dart-sdk"
host_prebuilt_dart_sdk = "//flutter/prebuilts/$_host_prebuilt_dart_sdk_config/dart-sdk"
# There is no prebuilt Dart SDK targeting Fuchsia, but we also don't need
# one, so even when the build is targeting Fuchsia, use the prebuilt
# Dart SDK for the host.
if (current_toolchain == host_toolchain || is_fuchsia) {
prebuilt_dart_sdk = host_prebuilt_dart_sdk
prebuilt_dart_sdk_config = _host_prebuilt_dart_sdk_config
prebuilt_dart_sdk_archive = _host_prebuilt_dart_sdk_archive
} else {
prebuilt_dart_sdk = target_prebuilt_dart_sdk
prebuilt_dart_sdk_config = _target_prebuilt_dart_sdk_config
prebuilt_dart_sdk_archive = _target_prebuilt_dart_sdk_archive
}|
Is there work ongoing on this front? |
Actually the work is done, but I haven't rebased yet. Let me do it. |
These new targets will be used to archive the artifacts from directly from GN simplifying the recipes and validating the artifacts are generated and archived correctly on presubmit. Bug: flutter/flutter#81855
|
This is ready for another round of reviews. |
These new targets will be used to archive the artifacts directly
from GN simplifying the recipes and validating artifacts are
generated and archived correctly on presubmit.
Bug: flutter/flutter#81855
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.