Repository navigation
Fix building Dart Fuchsia components and packages - #28413
fluttergithubbot merged 3 commits into
Conversation
|
@iskakaushik @arbreng - FYI, here are the updated build rules as promised. |
f7ae543 to
3e4808f
Compare
|
Oops, I somehow leaked my test code into yesterday's post of this PR. I fixed it this morning, so this commit ONLY has changes to I also added a separate commit, before the main commit, with the original versions of the GN SDK files I adapted, so anyone can see what changes I needed, to make this work for flutter/engine. This is ready for review, assuming it passes CI. |
|
@chaselatta - I should have cc'ed you initially! |
|
I will take a look a little later today. |
| # # launch the vm service in the runner. | ||
| # # This configuration is not compatible with a --release build since the | ||
| # # profile aot runner is built without asserts. | ||
| # dart_aot_debug_build_cfg = { |
There was a problem hiding this comment.
Do we still need all of these?
There was a problem hiding this comment.
Technically I don't need them for the current state of things, but I assume we want the option of both jit and aot builds?
If you disagree, I'm happy to delete all of the other commented out config options. Or if you know which ones we should keep or remove, I can delete the configs we know we're not going to need.
I figured we'd talk about and resolve the TODO items after the integration tests are working.
| rebase_path(_kernel_path, root_build_dir), | ||
| ] | ||
|
|
||
| # TODO(richkadel): Chase said these are not needed in flutter/engine tests, |
There was a problem hiding this comment.
They are not needed if you don't passs the --split-output-by-packages flag. If you don't pass that flag it will keep everything in a giant dill file which is how other platforms work. Fuchsia is special in that we split the packages to take advantage of the content addressed file system.
There was a problem hiding this comment.
Hmm... OK I'll try that, and make sure it still works. I've been trying to keep things as close as possible to how Fuchsia works so I can eliminate variables, and focus on debugging things that are different for a reason.
There was a problem hiding this comment.
I haven't tried to make this change yet, but the most recent commit (just uploaded) addresses what I think are all of the other changes.
I'll experiment with what you recommended, now that the other items are out of the way.
| args += [ "--embed-sources" ] | ||
|
|
||
| # } else { | ||
| # args += [ "--no-embed-sources" ] |
There was a problem hiding this comment.
As above, I assume we're going to want to support AOT mode testing as well as JIT. I wanted to keep the relevant code derived from Fuchsia build rules, but comment it out, to make sure I wasn't picking up non-debug-mode (non-jit) logic when I was focusing only on getting debug/jit to work.
We'll either uncomment or remove this, once things are working, based on the team's expectations.
| } | ||
| # # Builds the component in a non-product AOT build. This will | ||
| # # launch the vm service in the runner. | ||
| # # This configuration is not compatible with a --release build since the |
There was a problem hiding this comment.
Same question as above, do we still need these?
| # copy the snapshot as a resource | ||
| _snapshot_resource_target_name = "${target_name}_snapshot_resource" | ||
|
|
||
| # TODO(richkadel): It looks like this is the _ONLY_ place resource() is used |
There was a problem hiding this comment.
resource just writes to metadata and gets collected by the package
There was a problem hiding this comment.
Yes, I left it in for now (but with the TODO) so the structure of files derived from Fuchsia is as similar to the original as possible. (As mentioned in my earlier comment, this helps see what did and did not change. I figure it can be optimized in a subsequent PR once we're happy that everything else is working as expected.
| _convert_kernel_target_name = | ||
| "${_kernel_target_name}_convert_kernel_manifest" | ||
| _convert_kernel_manifest_file = | ||
| # TODO(richkadel): This is prefixed by "dartlang/", which is not found. |
There was a problem hiding this comment.
dartlang/ is specific to the fuchsia build
There was a problem hiding this comment.
Sorry, this was a bit of a hack here. I ran into some really frustrating issues debugging some GN rules, and for this one, I couldn't figure out why I was getting the toolchain prefix, or how to remove it. Eventually I just punted, and decided to strip it out for now.
This works, but is clearly not optimal. I have no immediate solution for it though, but if you or anyone has a recommendation on how to fix the rules, I'm happy to try.
(I can give it another go, but wasted hours on just this problem already. Some GN magic still eludes me.)
There was a problem hiding this comment.
Update: If/when we resolve the limitation in flutter_runner to allow loading packages that don't include a .dilplist file, I can remove all of the code related to generate_manifest, including this one. In the mean time, I'm planning to leave this as-is, if that's OK, and come back to it later, one way or the other, to resolve the TODO item.
| @@ -1,4 +1,4 @@ | |||
| # Copyright 2013 The Flutter Authors. All rights reserved. | |||
| # Copyright 2019 The Fuchsia Authors. All rights reserved. | |||
There was a problem hiding this comment.
The copyright needs to be 2013 for the copyright checker to work.
There was a problem hiding this comment.
Right. I'll fix those. Thanks!
|
@chaselatta - In addition to addressing "most" of your comments (so far), the commit I just uploaded also adds BUILD.gn rules to package up one Fuchsia-based Dart test, already present in $ flutter_build flutter/shell/platform/fuchsia/dart-pkg/zircon/testAnd produces: out/fuchsia_release_x64/gen/flutter/shell/platform/fuchsia/dart-pkg/zircon/test/channel_test/channel_test.far I expanded the The only thing I still need to address is to try removing I addressed the copyright headers, and responded to your questions on the other items. You'll have to tell me if the answers are satisfactory, or if you are looking for changes, but the general theme seems to be that, you're right, some things are not strictly needed, and/or are derived from Fuchsia, but I kept some build rule features so I could compare them more equally with the build rules and ninja execution of the same tests in Fuchsia (which has been helpful). I think once we're comfortable the rules are working as expected, we can strip out more of the rules that are never likely to be needed by flutter/engine. |
|
Oh, one more thing. I changed where I'm putting the This was short sighted. It adds unneeded complexity. Instead, I started (so far with a couple of additional libraries I needed for the build test I added in the latest commit) centralizing these Fuchsia-specific This saves me having to add If you don't object, I will move all of the other As it turns out, this should also allow me to remove |
3e8ae90 to
5fe010d
Compare
This commit includes only the files copied from the Fuchsia GN SDK, that had to be adapted to support flutter/engine integration tests. Most of these GN rule implementations were reusable as written (modulo some directory paths); however, some rules had to be adjusted to overcome current limitations. The required changes are implemented in the succeeding git commit, which also includes the additional flutter/engine build rules needed to build Dart-based Fuchsia packages, based on the Fuchsia SDK, to be published and tested in a compatible Fuchsia instance.
The previous PR did not build the Fuchsia packages correctly: > GN build rules for tests using Fuchsia SDK Dart libraries and bindings flutter-team-archive#27996 The new changes bring in more of the Fuchsia GN-SDK build rules. Some changes to these rules were required because the fuchsia.git-derived flutter/dart build rules depend on a different implementation of similar-sounding rules (fuchsia.git <> Fuchsia GN SDK, regarding build rule implementations). I renamed flutter/tools/fuchsia/sdk to flutter/tools/fuchsia/gn-sdk to be more clear that GN SDK was the original source. Also, I realized there were still some references to python3.8 and python3_action. Now that flutter is building with python3 by default, that action is no longer needed, so I've removed it. Fixes: flutter/flutter#87999 (because the original fix had deficiencies) Tested in Fuchsia and confirmed the dart package/component launches and runs.
5fe010d to
4e24e74
Compare
|
@iskakaushik - Just FYI, I added build rules to package up one of the existing tests as a flutter component. (I did not actually try running the component in Fuchsia, and I had to mock up a $ flutter_build flutter/shell/platform/fuchsia/dart-pkg/zircon/testSo I included this as a validation of the build rules, like we once discussed. (I think you had started something similar, using the same files (?), to at least test Any concerns? I can leave it in or remove it if required. @chaselatta - Let me know if you think this should stay or be removed. |
08d8083 to
5e9885d
Compare
|
Oh, I see Kaushik's change to use vpython3 (which also supplied |
5fff63c to
b3279b5
Compare
Confirmed the new test build rules generate a Dart Fuchsia package that appears to be structured correctly for testing on a Fuchsia platform.
b3279b5 to
183b377
Compare
|
The license check finally passed in CI... just waiting out the rest of the CI checks (which all passed earlier today) |
| # # launch the vm service in the runner. | ||
| # # This configuration is not compatible with a --release build since the | ||
| # # profile aot runner is built without asserts. | ||
| # dart_aot_debug_build_cfg = { |
|
Seems good to go. May I land this? |
|
yes, please! |
The previous PR did not build the Fuchsia packages correctly:
The new changes bring in more of the Fuchsia GN-SDK build rules. Some
changes to these rules were required because the fuchsia.git-derived
flutter/dart build rules depend on a different implementation of
similar-sounding rules (fuchsia.git <> Fuchsia GN SDK, regarding build
rule implementations).
I renamed
flutter/tools/fuchsia/sdktoflutter/tools/fuchsia/gn-sdkto be more clear that GN SDK was the original source.Also, I realized there were still some references to python3.8 and python3_action. Now that flutter is building with python3 by default, that action is no longer needed, so I've removed it.
Fixes: flutter/flutter#87999 (because the original fix had deficiencies)
Tested in Fuchsia and confirmed the dart package/component launches and runs.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.