Refactor BuildMode into class, add jit_release configuration#42476
Refactor BuildMode into class, add jit_release configuration#42476jonahwilliams merged 10 commits intoflutter:masterfrom
Conversation
Codecov Report
@@ 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
Continue to review full report at Codecov.
|
zanderso
left a comment
There was a problem hiding this comment.
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; | |||
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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.
You won't be able to compile a local engine on iOS, so I didn't add any failure mode here
These dill files use AST, but could probably use bytecode - I haven't tested it. |
|
@jonahwilliams I wonder building the whole engine is the only way for Android x86 or there will be a simple solution in the future? |
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.