Commit graph

128 commits

Author SHA1 Message Date
Johnni Winther
5c96846d8e [dartdevc] Migrate DevCompilerTarget and dependencies to null safety
Change-Id: I75ebd85b745f55bc4ca4111e97a0ec2d787098a2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207135
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
2021-07-26 20:49:06 +00:00
Nicholas Shahan
5668791399 [ddc] Bump browser_launcher dep to v1.0.0
- Supports sound null safety.

Change-Id: I5778d1e0b47b97a24f7433509963f945d702d6b2
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/207920
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-07-23 19:24:20 +00:00
Nicholas Shahan
dbfbc7e373 [ddc] Bump minimum sdk version
Preparation to begin migrating dev_compiler libraries to null safety.
With this change any file we remove the old language version comment
from will be opted into null safety.

Change-Id: I567d139a6c6bfa0b8f820b16e3eb87a2f49228b3
Issue: https://github.com/dart-lang/sdk/issues/46617
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/206961
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-07-15 22:01:26 +00:00
Anna Gringauze
c32bc3c99f Make AssetFileSystem fault-tolerant
Recent flakes in webdev CI show failures to load dill files
due to broken sockets (most likely caused by connection timeouts).
This change adds retries and timeouts to the asset server file
system to make it tolerant to breaking connections.

- Add RetryTimeoutClient wrapper for HttpClient that performs
  retries with delays and connection/response timeouts, based
  on the idea in
  https://github.com/dart-lang/http/blob/master/lib/retry.dart
- Make AssetFileSystem use the RetryTimeoutClient.
- Add tests for reading multiple files concurrently.
- Add tests for ExpressionCompilerWorker reading assets using
  standard, multiroot, and asset file systems.
- Simplify uri that AssetFileSystem uses to query the asset
  server, since we no longer need to load package uris.
  This will eliminate a step in uri translation in dwds.

- Validated that changes do not break google3 manually.

Change-Id: I2ff163b8d99cd0b7551f3f33a71e6b306540e3c9
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/204880
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-07-07 23:27:13 +00:00
Anna Gringauze
387333c5bb Keep connection open until http response is read in HttpAwareFileSystem
We are seeing CI flakes in webdev when using expression_compiler_worker
in tests involving expression evaluation, for example, see linux tests
for dwds in the following PR:

https://github.com/dart-lang/webdev/pull/1343

The logs show that HttpFileSystemEntity.exists fails due to a broken
pipe, which we suspect is due to http client closed too early.

This change is an attempt to fix the problem by
- logging exceptions thrown in expression compiler worker
- awaiting for the request to be read before closing http client in
  HttpFileSystemEntity.

TEST=pkg/dev_compiler/test/expression_compiler/asset_file_system_test.dart

See investigation of the CI issue in:
https://github.com/dart-lang/webdev/issues/1345


Closes: https://github.com/dart-lang/sdk/issues/46388

Change-Id: Iaf98f08e8ebb618bf8365bd497f01ae685f0d3f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/203841
Commit-Queue: Anna Gringauze <annagrin@google.com>
Reviewed-by: Alexander Aprelev <aam@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2021-06-18 01:56:21 +00:00
Nicholas Shahan
38e5e9bc19 [ddc] Update pedantic version to 1.11.0
Apply new lints, cleanup violations, and ignore in `lib/src/js_ast` to
avoid adding additional diffs with the version it was forked from.

Change-Id: I1def25865bf195120c594223ebdc0f59139e75b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/192241
Reviewed-by: Mark Zhou <markzipan@google.com>
Commit-Queue: Nicholas Shahan <nshahan@google.com>
2021-03-24 17:35:32 +00:00
Mark Zhou
5eceb354e2 [dartdevc] Porting expression compiler tests.
This is part of a series of changes to add support for SDK expression eval tests.

Change-Id: Ia96931fdf81324fa131014b49ec2067507c451f2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/191022
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Commit-Queue: Mark Zhou <markzipan@google.com>
2021-03-22 23:17:55 +00:00
Mark Zhou
ce473df469 [dartdevc] Adapting expression evaluation test suite for end-to-end evaluation.
The full workflow for an end-to-end test:
  1) Perform test/compiler options pre-initialization.
  2) Start an instance of Chrome (with 1 tab) and save a persisted debug connection for use in all tests.
  3) For each separate Dart program to be tested:
    1) Create inside a temp directory the HTML bootstrapper, DDC-compiled JS sources, and auxiliary JS files (dart_library.js or require.js).
    2) Initialize a DDC ProgramCompiler/IncrementalCompiler and perform a full compile of the program, saving the compiler's state for subsequent incremental compiles.
    3) Enable the debugger and set a URL breakpoint at the program's main JS entrypoint.
    4) For each test for this Dart program:
      1) Navigate to the HTML bootstrapper, pausing when the target module is loaded (at the breakpoint set above).
      2) Set a breakpoint at a JS location translated from a Dart breakpoint ID via source maps.
      3) Resume the debugger, pausing at that breakpoint. Remove the breakpoint.
      4) Reconstruct the local JS scope, then evaluate the Dart expression.
      5) Evaluate the JS expression inline, then compare results with expectations.
    5) Disable the debugger to clear its state.
  4) Shut down Chrome and clean up any temporary directories.

Other notes:
  * Supports bootstrapping/compilation on AMD and DDC module systems only (though expression eval is only supported on AMD)
  * Requires that Dart breakpoint IDs be set declaratively (no support for columns)

The test structure/flow is subject to change. While I port existing tests, Dart programs will consist of inline source file strings with simple breakpoints. In the future, we want to allow more complicated Dart programs to be specified (like in the modular test framework) and more complicated expression evaluation test patterns (rather than allowing only a single evaluation per test).

Change-Id: I5de7cfa66991fd14b24fa16edd1615f55c041ae3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/190962
Commit-Queue: Mark Zhou <markzipan@google.com>
Reviewed-by: Anna Gringauze <annagrin@google.com>
Reviewed-by: Nicholas Shahan <nshahan@google.com>
2021-03-18 17:41:23 +00:00
Sigmund Cherem
06a4b109bc [web] Delete check_nnbd_sdk test
Change-Id: Ia55f76a57adbe2e133ad9e049e1201bec5094b53
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/186660
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Sigmund Cherem <sigmund@google.com>
2021-02-24 00:04:29 +00:00
Devon Carew
8cba879f46 Add additional validations to the pkg/ package pubspecs.
TEST=these are additional validations that we run on the bots

Redux of https://dart-review.googlesource.com/c/sdk/+/161040

Change-Id: Ia32ced5d48fbfeafacfa9e51dc4774d2e9425091
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174601
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-12-02 17:27:18 +00:00
Anna Gringauze
34052bf2bb Add expression evaluation to ddc for google3
- Move expression evaluation to ddc in preparation for google3
- Added server to ddc to handle update and compileExpression requests
- Added tests
- Added 'experimental-output-compiled-kernel' option to ddc to generate
  full kernel files only for compiled libraries, and store with
  '.full.dill' extension
- Added AssetFileSystem to communicate to the asset server in the
  debugger
- Made expression_compiler_worker work with full kernel files,
  so removed invalidation of current file to improve performance
- Made expression_compiler_worker reuse already loaded imports
  to avoid reading them from source in the incremental compiler
- Updated tests to work with DDC (for simulating webdev)
- Disabled tests that work with bazel kernel worker for now
  as it does not generate full dill files yet
- Addressed code review comments from the prototype version:
  https://dart-review.googlesource.com/c/sdk/+/157005

Details:

Currently, in flutter tools, expression evaluation is supported via
expression compilation, which is done by the incremental compiler in
the frontend server. The same incremental compiler is used for initial
application compilation, incremental code compilation for hot reload,
and any number of expression compilation requests.

In google3, the apps are typically too large to be compiled as a whole
in memory by the frontend server. Build in google3 is currently done by
blaze, as a distributed build using a task dependency graph. Build tasks
output kernel outline files as an interface between components produced
by individual tasks.

We are proposing an implementation of the expression compilation in
google3 that is taking advantage of full kernel files produced by the
build (supporting build changes to follow). This change introduces a
small server based on dev_compiler, which can handle following requests:

- update: load full kernel for given modules (done on app start)
- compileExpression: compile expression in a given library and module
  (done when paused on a breakpoint)

Expression compilation uses previously loaded kernel files for the
application component and its dependencies to compile an expression.


Change-Id: Icf73868069faf3a2eb6d43ba78e459f8457e9e35
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/160944
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Gary Roumanis <grouma@google.com>
Reviewed-by: Jens Johansen <jensj@google.com>
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Anna Gringauze <annagrin@google.com>
2020-09-03 03:05:13 +00:00
Devon Carew
4c97369a71 [package_deps] improve package deps validation
Change-Id: I8ad92243dece86cf6255eb463672c53066da31df
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159601
Reviewed-by: Sigmund Cherem <sigmund@google.com>
Commit-Queue: Devon Carew <devoncarew@google.com>
2020-08-21 19:22:20 +00:00
Devon Carew
d26469f715 update the pubspec.yaml files to reflect actual package usage
Change-Id: I7a46c42dff3506cd5d09d3d793c072258e09a6e6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/159143
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Sigmund Cherem <sigmund@google.com>
2020-08-20 16:08:59 +00:00
Michael Thomsen
f0c87e9f21 Clean up no-publish comments in pubspecs
Change-Id: I6cc1ab404de75cd02183b862842198c85b6d9256
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/152005
Reviewed-by: Alexander Thomas <athom@google.com>
2020-06-23 10:34:09 +00:00
Nicholas Shahan
ac30ab12ab [dartdevc] Bump pedantic to v1.8.0 and apply new lints
Cleanup violations of:
* `prefer_iterable_whereType`
* `unnecessary_const`
* `unnecessary_new`

Ignore violations in lib/src/js_ast to avoid additional diffs when un-forking.

Change-Id: I7333903422bbf635cd0dea82116372f305f679d8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/108182
Auto-Submit: Nicholas Shahan <nshahan@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-07-03 23:51:51 +00:00
Nicholas Shahan
ffb044e4f0 [dartdevc] Apply all lints from pkg:pedantic
Ignore slash_for_doc_comments in lib/src/js_ast to avoid additional diffs when
potentially un-forking in the future.

Fixes: #37218
Change-Id: If5c5bacf2d77fbae432217ba6031a6a8fa5dfcd8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/106580
Commit-Queue: Nate Bosch <nbosch@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
2019-06-21 22:13:59 +00:00
Nate Bosch
e15a98c4f2 Tighten types for runtimeStatement and runtimeCall
Only ~29/100 calls for runtimeCall and ~2/31 calls for runtimeStatement
were using the single value option. Change to take a `List<Object>`
always and add list literals to those calls which were previously only
passing one value.

Update pubspec SDk constraint so that the analyzer will allow the `..?`
syntax.

Change-Id: Ib8eb8eb854a8aa04e36dc5cc713016a43b8e9325
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/103361
Reviewed-by: Nicholas Shahan <nshahan@google.com>
Commit-Queue: Nate Bosch <nbosch@google.com>
2019-05-22 17:38:15 +00:00
Kevin Moore
b53dceadaa Update pubspec for dev_compiler and sourcemap_testing
Useful for tracking pkg usage across the SDK

Change-Id: I16fe0e62922afd76270b03e9423632cd900d4c61
Reviewed-on: https://dart-review.googlesource.com/c/91844
Auto-Submit: Kevin Moore <kevmoo@google.com>
Commit-Queue: Jenny Messerly <jmesserly@google.com>
Reviewed-by: Jenny Messerly <jmesserly@google.com>
2019-02-04 20:34:59 +00:00
Devon Carew
3e33c3d0fc Eliminate analysis warnings in pkg/ code.
Change-Id: I571581bf16502c1698932c03313777aa8a9ee081
Reviewed-on: https://dart-review.googlesource.com/63983
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2018-07-06 21:28:07 +00:00
Vijay Menon
499a6633c6 Remove pubspec
This is breaking travis - maybe travis auto-runs pub get?

See:

https://travis-ci.org/dart-lang/sdk/jobs/210756646

TBR=devoncarew@google.com

Review-Url: https://codereview.chromium.org/2750673003 .
2017-03-13 16:23:36 -07:00
Devon Carew
b80390d0f5 Have dartdevc support --version.
BUG=
R=vsm@google.com

Review-Url: https://codereview.chromium.org/2747743003 .
2017-03-13 16:10:21 -07:00
Vijay Menon
68d2121fd0 Use .packages instead of pubspec.yaml
This runs tests against sdk versions of packages instead of whatever
random version we have in pubspec.yaml.

Travis may be unhappy with the lack of a pubspec.yaml.  Here's the try:

https://travis-ci.org/dart-lang/sdk/builds/163270204

R=jmesserly@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org/2371113004 .
2016-09-28 09:49:31 -07:00
John Messerly
a4734d4b33 fix #27353, support @checked covariant parameters in DDC
Seems pretty straightforward. Just added a simple test for now.

R=leafp@google.com

Review URL: https://codereview.chromium.org/2340463009 .
2016-09-15 15:42:04 -07:00
Vijay Menon
ab47c33f3d Bump pub version
We seem to be hitting an error on travis:

https://travis-ci.org/dart-lang/sdk/jobs/159136296

  The pubspec for analyzer 0.28.2-alpha.0 from path has version 0.29.0-alpha.0.
  The command "pub get" failed and exited with 65 during .

Looks like the analyzer version bumped forward and was incompatible
with the pubspec.lock entry?  Is there a way to avoid this?

TBR=rnystrom@google.com,jmesserly@google.com

Review URL: https://codereview.chromium.org/2336443002 .
2016-09-11 20:06:36 -07:00
Vijay Menon
b220f63954 Travis config
See try-run here: https://travis-ci.org/dart-lang/sdk/builds/156699868

R=kevmoo@google.com

Review URL: https://codereview.chromium.org/2301833002 .
2016-09-01 08:33:50 -07:00
John Messerly
a076edad94 roll analyzer
R=vsm@google.com

Review URL: https://codereview.chromium.org/2254883002 .
2016-08-17 21:10:21 -07:00
Vijay Menon
8fec051a8e Mark recursive_inheritance_test as passing
This will get the dev and master bots green.

Will need to bump the pubspec on analyzer (once published) to make stable green after this.

R=leafp@google.com

Review URL: https://codereview.chromium.org/2214263005 .
2016-08-05 09:35:01 -07:00
Priscilla Lee
d2ec49d1f7 Working compiler in browser.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/2183603003 .
2016-07-29 09:18:13 -07:00
John Messerly
0f29ee9618 Remove DDC custom error list now that strong mode analyzer handles it
R=leafp@google.com

Review URL: https://codereview.chromium.org/2102053003 .
2016-07-27 13:10:57 -07:00
John Messerly
d41215cd54 upgrade analyzer version 2016-06-14 14:09:41 -07:00
John Messerly
caff16a49a merged 2016-06-14 13:36:18 -07:00
John Messerly
5c67ae3bcc Use trackCacheDependencies for performance speedup
R=scheglov@google.com

Review URL: https://codereview.chromium.org/2059253003 .
2016-06-13 11:27:03 -07:00
John Messerly
1c0759a60b DDC changes for Analyzer src/task/strong/info.dart refactor
Review CL: https://codereview.chromium.org/2057373003/
2016-06-13 10:37:12 -07:00
John Messerly
ec945eed6f enable compatiblity with 1.18 SDKs
fixes #584, works around analyzer message #583

R=leafp@google.com

Review URL: https://codereview.chromium.org/2048463002 .
2016-06-06 17:29:02 -07:00
John Messerly
17298f330d upgrade to Analyzer with speed improvements
Review URL: https://codereview.chromium.org/2003073002 .
2016-05-23 09:48:05 -07:00
Vijay Menon
d15a603538 Allow the SDK to be set via a summary file
The generated summary file matches the generated DDC sdk - i.e., it
does not include dart:io.  I modified the codegen_tests to the summary
and had to prune the parts of unittest that relied on dart:io.

Paul / Konstantin: can one of you please look at the summary part?

Bob: can you please look at the unittest changes?

R=rnystrom@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1982853002 .
2016-05-16 17:10:08 -07:00
Jacob Richman
9520e96340 Switch to actual unittest, stack trace, and path packages. Tag tests as failing that were ignored due to the incomplete unittest library. Make running of unittests a bit more robust by wrapping them inside a mocha test to avoid unpredictable behavior due to interleaving async mocha and unittests.
BUG=
R=jmesserly@google.com

Review URL: https://codereview.chromium.org/1956513004 .
2016-05-06 12:28:44 -07:00
Vijay Menon
7d32105a82 Pickup latest analyzer fixes
Note the new errors in sdk.  Did we change something wrt overrides?

R=leafp@google.com

Review URL: https://codereview.chromium.org/1951263004 .
2016-05-05 16:30:39 -07:00
Jacob MacDonald
308fa5ccb4 Add bazel worker support to the dev compiler.
BUG=
R=jmesserly@google.com, vsm@google.com

Review URL: https://codereview.chromium.org/1884073003 .
2016-04-15 06:51:40 -07:00
John Messerly
0c148ecef4 Implement modular compilation
Highlights
* compile one module at a time
* use summaries to speed up compiles
* use command runner so we can add more commands later
* some long needed renames and file organization
* various other technical debt has been addressed

Lowlights
* lost node.js runner/tests (node output format still supported)
* possibly lost some closure support/workarounds (format still supported)
* needs more end-to-end tests of the new system

R=vsm@google.com

Review URL: https://codereview.chromium.org/1879373004 .
2016-04-14 11:28:12 -07:00
vsmenon
778c63755d Update pubspec.yaml 2016-04-01 09:10:02 -07:00
vsmenon
4f17bacd8a Update pubspec.yaml 2016-03-31 15:32:52 -07:00
John Messerly
e8bee43919 More analyzer updates, and handle negative_tests
Also fixes node_test to not overwrite main SDK log

R=vsm@google.com

Review URL: https://codereview.chromium.org/1840203002 .
2016-03-29 15:16:44 -07:00
John Messerly
63a119bd86 fix to run against latest analyzer
hard part was dealing with the new for-each changes
the good news is the new for-each logic simplifes our await-for checking

R=leafp@google.com, rnystrom@google.com

Review URL: https://codereview.chromium.org/1840713003 .
2016-03-28 14:22:36 -07:00
John Messerly
73159b6c1e Remove code that requires whole-program compile
This change removes functionality that is not part of the core Dart Dev
Compiler, in particular those features that were not designed for
incremental/modular compilation.

For a while, the primary way to use DDC will be as a compiler invoked by
a build system, e.g. make or bazel or some node.js based-build system.

We'd love to see the user functionality provided by these return.
In particular, a well designed server+watcher system would be a huge
boost to productivity!

I'll see about moving over HTML reporting to Analyzer CLI. It has a lovely UI.
Thanks to everyone who contributed these features.

The following features were removed:

* DDC transformer. Transformers require whole world, in memory files.
* DDC server. The server has its own mini-build system.
* Various kinds of reporting. These should be moved to Analyzer CLI.

Note: batch compiler and the node runner are left for now.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1788973002 .
2016-03-15 11:30:50 -07:00
vsmenon
2cb31f7219 Update pubspec.yaml 2016-03-15 10:33:58 -07:00
John Messerly
93251ee241 upgrade to latest analyzer
fixes https://github.com/dart-lang/dev_compiler/issues/471

Changes here are:
* Analyzer now infers list/map literals
* Analyzer changed how isPotentiallyMutated* APIs work, so we need to track current function
* Another fix to arrow functions. We shouldn't skip generating covariant arg checks. If there were any, we use `=> { block }` form rather than `=> expr` form.

R=vsm@google.com

Review URL: https://codereview.chromium.org/1757343002 .
2016-03-03 11:32:54 -08:00
John Messerly
67b24939cd refactor/simplify nullable inference code
Some of the high level changes are:
* visit catch body, fixes #463
* handle temps created by the compiler. These were in some cases treated incorrectly as non-null (see tests diff)
* compute nullable in the same pass as visiting assignments
* simplify visiting += and ++, fix ++ (it was dead code, #463)
* simplify _isNullable
* if we fail to see a variable declaration, treat it as nullable
* stack trace in catch is treated as non-null

R=vsm@google.com

Review URL: https://codereview.chromium.org/1751963002 .
2016-03-01 16:44:05 -08:00
vsmenon
c54b468584 Update pubspec.yaml 2016-02-22 15:07:47 -08:00
vsmenon
a2841d780f Update pubspec.yaml 2016-02-19 15:03:47 -08:00