Skip to content

Refactor BuildMode into class, add jit_release configuration#42476

Merged
jonahwilliams merged 10 commits intoflutter:masterfrom
jonahwilliams:support_jit_release_bundle
Oct 28, 2019
Merged

Refactor BuildMode into class, add jit_release configuration#42476
jonahwilliams merged 10 commits intoflutter:masterfrom
jonahwilliams:support_jit_release_bundle

Conversation

@jonahwilliams
Copy link
Contributor

@jonahwilliams jonahwilliams commented Oct 10, 2019

Description

As documented in https://github.com/flutter/flutter/wiki/JIT-Release-Modes. A jit release build uses dill artifacts but with slightly different configuration. Begin support for it in the tool by refactoring build modes.

@fluttergithubbot fluttergithubbot added the tool Affects the "flutter" command-line tool. See also t: labels. label Oct 10, 2019
@codecov
Copy link

codecov bot commented Oct 10, 2019

Codecov Report

Merging #42476 into master will decrease coverage by 1.17%.
The diff coverage is 66.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #42476      +/-   ##
==========================================
- Coverage   60.85%   59.68%   -1.18%     
==========================================
  Files         195      194       -1     
  Lines       19029    18991      -38     
==========================================
- Hits        11580    11334     -246     
- Misses       7449     7657     +208
Flag Coverage Δ
#flutter_tool 59.68% <66.66%> (-1.18%) ⬇️
Impacted Files Coverage Δ
...kages/flutter_tools/lib/src/commands/assemble.dart 80% <0%> (ø) ⬆️
packages/flutter_tools/lib/src/build_info.dart 75.4% <100%> (-4.05%) ⬇️
...utter_tools/lib/src/build_system/targets/dart.dart 48.51% <66.66%> (+1.51%) ⬆️
...kages/flutter_tools/lib/src/commands/generate.dart 20% <0%> (-65.19%) ⬇️
packages/flutter_tools/lib/src/web/workflow.dart 33.33% <0%> (-55.56%) ⬇️
packages/flutter_tools/lib/src/run_cold.dart 9.75% <0%> (-33.78%) ⬇️
packages/flutter_tools/lib/src/web/web_device.dart 19.27% <0%> (-28.92%) ⬇️
...ages/flutter_tools/lib/src/linux/linux_device.dart 44.44% <0%> (-26.99%) ⬇️
...ackages/flutter_tools/lib/src/commands/unpack.dart 6.49% <0%> (-24.68%) ⬇️
packages/flutter_tools/lib/src/dart/sdk.dart 80% <0%> (-20%) ⬇️
... and 74 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41c02d7...243236b. Read the comment docs.

Copy link
Member

@zanderso zanderso left a comment

Choose a reason for hiding this comment

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

What is the failure mode if you specify a jit_release build targeting iOS?

Do the .dill files produced by the jit_release build use ASTs or bytecode?

@@ -139,6 +141,8 @@ BuildMode getBuildModeForName(String name) {
return BuildMode.profile;
Copy link
Member

Choose a reason for hiding this comment

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

BuildMode getBuildModeForName(String name) {
  return const <String, BuildMode>{
    'debug': BuildMode.debug,
    'profile': BuildMode.profile,
    'release': BuildMode.release,
    'jit_release': BuildMode.jitRelease,
  }[name];
}


// Only copy the prebuilt runtimes and kernel blob in debug mode.
if (buildMode == BuildMode.debug) {
if (buildMode == BuildMode.debug || buildMode == BuildMode.jitRelease) {
Copy link
Member

Choose a reason for hiding this comment

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

Consider elevating BuildMode from an enum to a class (or adding a class that has the enum as a field), and moving the logic here and below to that class.

@jonahwilliams
Copy link
Contributor Author

What is the failure mode if you specify a jit_release build targeting iOS?

You won't be able to compile a local engine on iOS, so I didn't add any failure mode here

Do the .dill files produced by the jit_release build use ASTs or bytecode?

These dill files use AST, but could probably use bytecode - I haven't tested it.

@jonahwilliams jonahwilliams changed the title Basic support for JIT release builds [WIP] Basic support for JIT release builds Oct 11, 2019
@jonahwilliams jonahwilliams changed the title [WIP] Basic support for JIT release builds Refactor BuildMode into class, add jit_release configuration Oct 25, 2019
@jonahwilliams jonahwilliams merged commit ab260ba into flutter:master Oct 28, 2019
@jonahwilliams jonahwilliams deleted the support_jit_release_bundle branch October 28, 2019 16:37
Inconnu08 pushed a commit to Inconnu08/flutter that referenced this pull request Nov 26, 2019
@amreniouinnovent
Copy link

@jonahwilliams I wonder building the whole engine is the only way for Android x86 or there will be a simple solution in the future?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants