45 Commits

Author SHA1 Message Date
Alexander Aprelev
eea6197a24
Perform exit from server, not starter as awaiting from starter causes hanging in incremental compilation scenario. (#4955) 2018-04-09 14:34:46 -07:00
Alexander Aprelev
894e1e4ac5
Return non-zero exit code when frontend reports errors. (#4952) 2018-04-09 13:06:59 -07:00
Alexander Aprelev
97b22348c8
Leave only widget creation tracker kernel pass in flutter frontend server. (#4727)
* Leave only widget creation tracker kernel pass in flutter frontend server.

This is follow-up to https://dart-review.googlesource.com/c/sdk/+/43888.

* Adapt to updated interface

* Tyop

* Fix imports. Compiler interface extension

* Add trivial test back. Rename library to flutter_frontend_server.
2018-03-02 07:52:19 -08:00
Alexander Markov
f7c5fea6fb
Move generated entry points JSON out of flutter_patched_sdk, add an option to pass entry points to frontend_server (#4734)
Flutter downloads only one version of flutter_patched_sdk, which was obtained from host_debug build on Linux. Generated entry points JSON files are different in profile and release builds (as release build omits observatory), so these files should be downloaded independently of flutter_patched_sdk.

This PR moves generated entry points JSON files from flutter_patched_sdk to a separate directory (out/*/dart_entry_points) and adds an option to specify entry points to frontend_server (as Flutter tools will need to pass custom locations of entry points files outside of flutter_patched_sdk).
2018-03-01 14:02:35 -08:00
jensjoha
5e2738f039 Specify sdkSummary when compiling via frontend server (#4733)
Without specifying sdkSummary it defaults to vm_outline.dill which is not what we want if using mixins from the sdk.
2018-03-01 11:32:08 +01:00
Alexander Markov
6607231638
Prepare to enable global type flow analysis in AOT (#4725)
* Generate Flutter-specific entry points JSON file while building engine.
* Add ''--tfa' option to front-end server.
* Rename _entryPoint field in front-end server to _mainSource to avoid disambiguation.
2018-02-28 15:31:52 -08:00
Alexander Aprelev
b076f1be5a
Fix analyzer warning. (#4715)
* Fix analyzer warning.

  warning • This function declares a return type of 'Future<void>', but doesn't end with a return statement at flutter/frontend_server/lib/server.dart:340:1 • missing_return

* Remove await

* Ignore warning.
2018-02-26 10:56:51 -08:00
Alexander Aprelev
86ec3db218
Add an option '--depfile' to produce ninja-style depfile for the generated kernel. (#4704)
* Add an option '--depfile' to produce ninja-style depfile for the generated kernel file.

* Use [program.uriToSource] as a source of dependencies.
2018-02-26 08:55:20 -08:00
Alexander Aprelev
3697845ac6
Add option for recompile request to switch to new main file(entrypoint). (#4703)
* Add option for recompile request to switch to new main file(entrypoint).

This is needed to reuse incremental compiler to compile unrelated programs. First use case is reuse single
incremental compiler for all tests run by 'flutter test'

* Remove left over print
2018-02-22 23:08:54 -08:00
Alexander Aprelev
802eec2d1a
Write artifacts produced during frontend_server training into temp folder. (#4687)
* Write artifacts produced during frontend_server training into temp folder.

* Write artifacts produced during frontend_server training into temp folder.

* Fix File/String mixup

* Remove temp directory. Use full prefix for package

* Delete in finally {}
2018-02-18 14:48:55 -08:00
Alexander Aprelev
5b6ce8d761
Remove workaround for handling of relative paths (#4673) 2018-02-13 18:46:00 -08:00
Alexander Aprelev
8fdcdf5ff6
Add output path option (#4663) 2018-02-13 14:00:34 -08:00
Jacob Richman
7c805c0a80
Track widget creation locations. (#4529)
* Track widget creation locations.
2018-02-13 12:33:23 -08:00
Alexander Aprelev
5529f893e2
Switch to accept/reject-friendly incremental compiler (#4601)
* Switch to accept/reject-friendly incremental compiler

* Merge
2018-02-13 06:58:04 -08:00
Alexander Aprelev
d5259d3af9
Use Uri.file expecting filepath (#4646) 2018-02-07 15:24:44 -08:00
jensjoha
9ced19ccc7 Let frontend_server bootstrap the incremental compiler from a previou… (#4642)
* Let frontend_server bootstrap the incremental compiler from a previously build dill file

* Wrap 'invalidateIfBootstrapping' in try and don't bootstrap if getting an exception
2018-02-07 14:03:05 -08:00
Alexander Aprelev
d28dfcd9d7
Fix default value for 'packages' option to be null (#4570) 2018-01-18 17:12:29 -08:00
Alexander Aprelev
e582928a49
Accommodate flutter test --preview-dart-2 on windows and linux (#4564)
* Support .packages option in frontend_server, bundle_path in main_mac.

This is needed to be able to run  in  mode.

* Remove byte store tests

* Remove unused import

* Fix formatting

* Enable flutter test argument passing on win and linux.

* Fix formatting
2018-01-18 16:05:19 -08:00
Siva Chandra
2b398ee227 Roll Dart to 93d8c9fe2a2c22dc95ec85866af108cfab71ad06. (#4558)
* Roll Dart to 93d8c9fe2a2c22dc95ec85866af108cfab71ad06.

* Fix analyzer nits

* Try to pin dependency for tools/licenses to convert 2.0.1. Add verbose flag to pub get

* Pin dart to dev.16 to overcome pub issue

* Revert "Try to pin dependency for tools/licenses to convert 2.0.1. Add verbose flag to pub get"

This reverts commit d525a83f4494a511996226d328a5208d4651d46e as it is no
longer needed, was added to diagnose the problem, which turned out to be
a problem with pub in latest dart dev release.

* Fix license hash

* Reintroduce api methods and tests
2018-01-18 12:35:09 -08:00
Ian Hickson
f3f005c457
Analysis cleanup of the Dart in the Engine repo (#4554)
* Analysis cleanup of the Dart in the Engine repo

* Update painting.dart

* Update painting.dart
2018-01-17 09:48:56 -08:00
jensjoha
6de9931c36 Train frontend_server snapshot (#4560)
Reland 86430be68a8294fa6ef3002ee5aba27a50ce3ca6 with a fix for Windows build

Cuts 30% from hot-reload benchmarks with `--preview-dart-2`
2018-01-17 10:33:10 +01:00
Alexander Aprelev
e3be1b3d4e
Revert "Train frontend_server snapshot (#4512)" (#4556)
This reverts commit 86430be68a8294fa6ef3002ee5aba27a50ce3ca6 as it
breaks Windows engine buildbot.
2018-01-16 10:05:00 -08:00
jensjoha
86430be68a Train frontend_server snapshot (#4512)
Cuts 30% from hot-reload benchmarks with `--preview-dart-2`
2018-01-15 15:59:57 +01:00
Siva
0f0b144b03
Add support for --strong option in the engine, create a strong mode version of the platform file (#4504)
* Add a --strong option to the front end server so we can use strong mode with preview-dart-2.

* Plumb the --strong option through the dart controller into the VM.

* - Build a strong version of platform.dill for use with the engine.
- Fix a strong mode static error in the assert statement

* Enable asserts when running debug version even in strong mode.

* Use the correct platform dill file for linking when doing the aot builds.

* Fix formatting issue.
2018-01-03 16:52:24 -08:00
Alexander Aprelev
e1162b1b9b
Revert "Revert "Fix filename handling for Windows. (#4482)" (#4484)" (#4506)
* Revert "Revert "Fix filename handling for Windows. (#4482)" (#4484)"

This reverts commit 929e5b3900e2aab0c0f05889fd44b3a9525e846a.

Reverting now since issue with
gen_snapshot(as described in https://github.com/flutter/flutter/issues/13708) was fixed.

* resolve->resolveUri, drop underscores

* Fix underscore
2018-01-03 09:43:35 -08:00
Alexander Aprelev
929e5b3900
Revert "Fix filename handling for Windows. (#4482)" (#4484)
This reverts commit 1fb585810faacccf81d4aa4e5392c31e1593e031.

This change is not sufficient as it exposes problem with kernel-based
gen_snapshot on Windows and results in Flutter test failures.
2017-12-20 22:55:27 -08:00
Alexander Aprelev
1fb585810f
Fix filename handling for Windows. (#4482)
* Fix filename handling for Windows.

Bug: https://github.com/flutter/flutter/issues/13708

* Fix tyop

* Add final to make analyzer happy
2017-12-20 16:40:18 -08:00
Vyacheslav Egorov
e0d19e2897 Fix frontend_server error reporting. (#4461)
* Do not use CompilerOptions.onError to report errors.

CompilerMessage does not carry correct SourceSpan
which makes errors unreadable: they all point to
line 1 column XYZ.

* Run dartfmt on frontend_server/lib/server.dart.

* Fix linting issues for frontend_server
2017-12-14 16:26:53 +01:00
Alexander Markov
3e84bf01c2
Front-end server: use VM-specific package:vm/kernel_front_end (#4412)
* Use the VM-specific wrapper for the kernel front-end to support VM-specific kernel transformations.
* Also, pass a flag to distinguish AOT mode from JIT mode to enable whole-program optimizations.
2017-12-02 17:37:32 -08:00
Alexander Aprelev
b62785f00d
Roll dart to 48a927acb2dc4178691b4ddfa817e87043e30b01 (#4409)
* Roll dart to f5fc335a4cdfcf96ae550044c64044ffe599e595

* Update license hash

* Roll a little further to pick up a revert

* Update hash
2017-12-01 11:13:31 -08:00
Alexander Aprelev
229e474517
Run frontend server from temp directory to force absolute URIs in Kernel file. (#4394)
* Run frontend server from temp directory to force absolute URIs in Kernel file.

* Create special directory to cwd into to avoid conflicts with app sources in temp folder

* Make variable final
2017-11-28 13:58:51 -08:00
Alexander Aprelev
fbd384329b
Turn off smart minimal IKG compilation (#4383) 2017-11-21 16:09:41 -08:00
Alexander Aprelev
974e68a1bf Make sure we await for the file writing to complete before reporting that compilation is done. (#4210) 2017-10-12 13:39:19 -07:00
Alexander Aprelev
11cac67ff9 Add an option to link platform.dill into app kernel file (#4204) 2017-10-12 10:11:47 -07:00
Alexander Aprelev
f737d49ca2 Add an option to specify file byte store location (#4201) 2017-10-11 17:33:22 -07:00
Alexander Aprelev
74e58f66d4 Add reset method to reset incremental compiler. (#4187)
* Add reset method to reset incremental compiler.

This is needed to support Flutter app restart request.

* Indent constructor calls
2017-10-09 14:58:27 -07:00
Alexander Markov
0dba2fe78d Roll Dart to 9ee73fe322ce3875a6b1f16ba16d64b11c680e90 (#4176)
* Switch from FlutterFastaTarget to FlutterTarget as FlutterFastaTarget was removed.
2017-10-04 16:28:30 -07:00
Alexander Aprelev
dd65308ce4 Switch from FlutterTarget to FlutterFastaTarget (#4169) 2017-10-03 13:57:18 -07:00
Alexander Aprelev
0f79a0cc1a Capture all aspects of messages from compiler (#4118)
* Capture all aspects of messages from compiler

* Make static
2017-09-15 16:04:58 -07:00
Alexander Aprelev
be87a63f2d Use MemoryByteStore for incremental compilation (#4077) 2017-09-08 13:06:34 -07:00
Alexander Aprelev
5aabbe131a Return generated kernel filename on incremental compilation results. (#4069) 2017-09-06 15:13:25 -07:00
Alexander Aprelev
c2f762606f Use BinaryPrinter instead of KernelSerializer to accommodate IKG (#4058)
* Use BinaryPrinter instead of KernelSerializer to accomodate IKG

* Close sink opened with openWrite
2017-09-05 10:14:59 -07:00
Alexander Aprelev
364bfa0e6a Fix frontend_server problem with _filename not being set in compile. (#3998)
* Fix problem with _filename not being set. Add tests for that(and add mockito to mock IKG).

* Initialize KernelSerializer, Fix indentation

* Style nits and reworded comment
2017-08-22 11:19:24 -07:00
Alexander Aprelev
c4ac5fe97a Missed one feedback item from https://github.com/flutter/engine/pull/3982 (#3996) 2017-08-21 17:41:16 -07:00
Alexander Aprelev
fe0e123b12 Introduce frontend_server that flutter tools will use for compilation. (#3982)
* Introduce frontend_server that allows for interactive and batch modes.

Example of batch mode:
```
$ dart $HOME/p/f/t11/flutter/engine/src/flutter/frontend_server/bin/server.dart --sdk-root=$HOME/p/f/t11/flutter/engine/src/out/android_debug/flutter_patched_sdk --platform-kernel-dill=$HOME/p/f/t11/flutter/engine/src/out/android_debug/flutter_patched_sdk/platform.dill $HOME/p/f/t11/flutter/flutter/examples/flutter_gallery/lib/main.dart

out: result 79256789-598c-4909-a9e4-0ef36d4c26ba
out: 'State&TickerProviderStateMixin^#U0^' is exported from both 'package:flutter/src/widgets/animated_cross_fade.dart' and 'package:flutter/src/widgets/animated_list.dart'.
...
out: Superclass has no method named 'hitTest'.
out: 79256789-598c-4909-a9e4-0ef36d4c26ba $HOME/p/f/t11/flutter/flutter/examples/flutter_gallery/lib/main.dart.dill
$
```

Example of interactive mode - communication via stdin/stdout:
```
$ dart $HOME/p/f/t11/flutter/engine/src/flutter/frontend_server/bin/server.dart --sdk-root=$HOME/p/f/t11/flutter/engine/src/out/android_debug/flutter_patched_sdk --platform-kernel-dill=$HOME/p/f/t11/flutter/engine/src/out/android_debug/flutter_patched_sdk/platform.dill --incremental

out: Frontend server is ready.
in: compile abc.dart
out: result fd99c0f9-12bb-4083-818e-2521d454fdc8
out: fd99c0f9-12bb-4083-818e-2521d454fdc8 abc.dart.dill
in: accept
in: recompile kuka
in: 123.dart
in: 456.dart
in: kuka
out: result d12f8d05-6c79-44f7-a775-1d3469e1be53
in: quit
$
```

* Add test. Cleanup dependencies.

* One more test with mocks

* Remove platform-kernel option. Refactored CompilerOptions. Clean up comments.

* Update license

* Use Uri.base.resolve consistently. Ensure folder path for sdk root. Fix test.

* Fix main_dart for frontend_server build target

* Reintroduce .packages file, add README.md, revert changes to licenses_flutter

* Run analyzer on frontend-server. Update .packages deps so tests can be run too.

* Add analyzer options file

* Clean up dependencies

* Add frontend_server files to license file back

* Fix comment in analysis_options.yaml

* Run frontend_server tests in travis

* Update licenses

* Change a+x permission on travis/test.sh

* pub get before pub run test

* Fix path to when

* Clarify accept/reject instructions

* Formatting, fixed docs, style

* Update license script to skip .travis.yml, when/example. Update license file.

* Update style nits

* Fix license

* Trim license extracted text. Fix licenses

* Update licenses_third_party signature

* Few more tests

* Update dart license

* Update dart license

* Style changes. Fix return value for Future<Null>
2017-08-21 12:55:17 -07:00