Commit Graph

448 Commits

Author SHA1 Message Date
Konstantin Shcheglov 1074d44c65 Serve DART_ERRORS from incremental cache.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2045793003 .
2016-06-06 20:25:33 -07:00
Konstantin Shcheglov a42317f2de Serve INCLUDED_PARTS from incremental cache.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2044513003 .
2016-06-06 16:00:37 -07:00
Konstantin Shcheglov e87a9c955c Start adding experimental incremental analysis mode into CLI analyzer.
At the moment it is not very useful, because it does not use or store
errors from incremental cache yet. But I hope to implement this soon.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/2039773004 .
2016-06-06 11:35:55 -07:00
pq fba5cbc425 Analyzer 0.27.4-alpha.9 (API fixes) (#26562).
Restores `EmbedderUriResolver` API.

Addresses breakages in `dartdoc` and any other downstream dependencies.

See: https://github.com/dart-lang/sdk/issues/26562.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2021453003 .
2016-05-29 06:57:42 -07:00
pq 53fe39137f Embedder support refactoring (phase 1).
A bunch of changes to pave the way for emebdder SDK summary creation.

* Moves _embedder.yaml processing into the embedder SDK (out of the resolver).
* Changes EmbedderUriResolver to compose rather than extend a DartUriResolver.
* Fixes the wierd handling (dropping to add back) of `dart:` URIs.
* Fixes the incorrect overriding docs for `SDKLibraryImpl.shortName`.
* Updates embedder test to include a definition of `dart:core` in anticipation of adding some embedder SDK tests.

Some API work TODO in a follow-up CL (notably the way we check for the presence of embedders by querying the resolver is odd).

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/2009303002 .
2016-05-25 10:52:53 -07:00
pq ff857f1b71 CLI cleanup.
A little linting.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1986943002 .
2016-05-18 10:30:09 -07:00
pq 43bbf11dd8 SDK ext test fix (add missing packages file).
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1988603003 .
2016-05-17 13:49:04 -07:00
pq fb99a26b21 Test exit code handling fix [TBR].
TBR in a quest for build greenness...

BUG=

Review URL: https://codereview.chromium.org/1984323004 .
2016-05-17 12:37:39 -07:00
Konstantin Shcheglov 34d5d4f55c When in strong mode, analyze with dart2js paths.
This would correspond to the code in build_sdk_summaries.dart, which
creates strong mode summaries.

R=brianwilkerson@google.com, paulberry@google.com
BUG= https://github.com/dart-lang/sdk/issues/26466

Review URL: https://codereview.chromium.org/1988853002 .
2016-05-17 12:20:39 -07:00
pq 31a03ec31b Skip SDK summaries in the presence of SDK extenders (#26448).
Works around crash provoked by mojo: https://github.com/dart-lang/sdk/issues/26448.

The rub is that using SDK summaries in the presence of SDK extenders (and embedders) is unsafe.

Greater context: https://github.com/dart-lang/sdk/issues/26467.

BUG=
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1990463002 .
2016-05-17 11:10:43 -07:00
Konstantin Shcheglov 048d396f1b Fix for analyzer-cli and the new SummaryBasedDartSdk 'strongMode' parameter.
I broke the build :-(

R=brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1979193010 .
2016-05-16 15:03:35 -07:00
pq 7937623063 Don't use SDK summaries with embedders (#26448).
Addresses the issue seen in https://github.com/dart-lang/sdk/issues/26448.

Ultimately we want a better story for summaries in the presence of embedded SDKs; in the short-term this simply disables them.

The trick (and reason for all of the changes here) is that there is *a lot* of temporal coupling in the initiailization of contexts, sdks, resolvers, etc.  With this change, embedder processing is pulled out to where it can be done before the SDK is configured.  Hopefully this even makes this a bit more clear as resolver setup is less complex.

Open question: I think the logic that calls `pub list-dirs` is dead and can safely be removed.  Comments there welcome.

Thanks!

BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1984733003 .
2016-05-16 14:13:40 -07:00
Konstantin Shcheglov a4862dd22a Add '--dart-sdk-summary' option to analyzer-cli and use SummaryBasedDartSdk.
R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1974323003 .
2016-05-13 12:56:09 -07:00
Brian Wilkerson 44836f8538 Support the name analysis_options.yaml for analysis options files
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1975963002 .
2016-05-13 07:33:06 -07:00
Jacob MacDonald 6b7139d896 Dont search for the sdk on startup in worker mode
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1974993002 .
2016-05-12 15:07:01 -07:00
pq 40b03d2261 Server and CLI pubspec updates [TBR].
Should address version constraint issues introduced by dep on new plugin API.

BUG=

Review URL: https://codereview.chromium.org/1972193002 .
2016-05-12 06:21:46 -07:00
Brian Wilkerson d87f9c09de Update to use the latest version of the plugin package
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1965083002 .
2016-05-11 09:54:29 -07:00
Paul Berry 92f5fc8836 Handle missing sources properly when building AST-based summaries.
R=scheglov@google.com

Review URL: https://codereview.chromium.org/1966443002 .
2016-05-10 14:15:14 -07:00
pq 7913968725 Fix CLI SDK option config timing (#26129).
Fixes: https://github.com/dart-lang/sdk/issues/26129

The issue was that we were creating the SDK and populating its options (notably `strong-mode`) *before* options processors were called.  The result was that client code analysis contexts and SDK contexts were getting configured differently causing confusion when client code was getting analyzed with a non-strong-mode SDK.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1962403002 .
2016-05-10 13:35:40 -07:00
Konstantin Shcheglov e7b51f7bd1 Issue 26426. Don't use SDK summarie when analyzing SDK itself.
R=brianwilkerson@google.com
BUG= https://github.com/dart-lang/sdk/issues/26426

Review URL: https://codereview.chromium.org/1963023002 .
2016-05-10 09:54:24 -07:00
Paul Berry baa7dac310 Allow zero analyzer args in build mode.
This simplifies the integration with build systems such as Bazel, in
which it is sometimes convenient to have a build unit which depends on
other build units but doesn't introduce any additional source files of
its own.

R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1960263003 .
2016-05-09 12:39:06 -07:00
Konstantin Shcheglov d7f14a639d Turn on using SDK summaries in the command line analyzer.
We pass all of the shared tests now.
We used to pass too, but there was a couple small regressions.
The regressions have been fixed, so if you don't see a reason not to
turn using summaries on, I think we could do this.

R=brianwilkerson@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1945013002 .
2016-05-03 15:15:52 -07:00
Paul Berry a8e665eaf5 Don't compute hashes in "--build-summary-exclude-informative" mode.
The hashes were being thrown away anyway; computing them just wastes
time.

Cuts the runtime of generating an AST-based summary of the analyzer
package (with a warm VM) by about 19%.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1910553002 .
2016-04-20 11:04:58 -07:00
Paul Berry 2d1dbd4d5b Sort build_mode.dart.
No functional change; just code motion.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1903053003 .
2016-04-20 10:55:24 -07:00
Paul Berry 48c8d84357 Clear analyzer caches after each persistent worker build step.
Without this, a persistent worker that runs too long will eventually
overflow memory.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1897973005 .
2016-04-19 13:41:53 -07:00
Brian Wilkerson 21a1b757c1 Clean up hints after a new hint was introduced
R=jwren@google.com

Review URL: https://codereview.chromium.org/1890973002 .
2016-04-14 13:15:34 -07:00
Brian Wilkerson 3084ceae83 Clean up flags for conditional directives
R=pquitslund@google.com

Review URL: https://codereview.chromium.org/1892523002 .
2016-04-14 11:47:28 -07:00
Jacob MacDonald d4197b759d close the input stream in build_mode tests so they dont hang
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1892483003 .
2016-04-14 10:54:18 -07:00
Jacob MacDonald d2e2241fc1 update to use bazel_worker package
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1885073002 .
2016-04-14 07:46:33 -07:00
Jacob MacDonald 09c6fcebc0 Use the provided dart sdk path in worker mode
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1882373003 .
2016-04-14 07:24:53 -07:00
Paul Berry 2a5db6841b Turn off summaries in context when building summary from AST.
When building summaries from ASTs, we only use the context to read
source files; we don't need it to provide an element model.  Therefore,
we can save some time by turning off the context's use of summaries,
because this prevents it from trying to eagerly deserialize the
summaries of dart:async and dart:core.

Saves a significant amount of time when building a summary of a small
package using ASTs.  For example, saves ~37% of time when building a
strong mode summary of the "yaml" package.

R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1882263002 .
2016-04-14 05:59:01 -07:00
Konstantin Shcheglov bc54ea8c23 Disable computing errors for .pub-cache sources.
R=brianwilkerson@google.com, pquitslund@google.com
BUG=

Review URL: https://codereview.chromium.org/1888583002 .
2016-04-13 17:01:38 -07:00
Paul Berry 3b65dacd6c Modify build mode to use the linker when building summaries from ASTs.
R=brianwilkerson@google.com

Review URL: https://codereview.chromium.org/1877133002 .
2016-04-11 17:04:10 -07:00
pq 082edc9fa3 Suppress TODOs (#26215).
BUG=
R=brianwilkerson@google.com, scheglov@google.com

Review URL: https://codereview.chromium.org/1870123002 .
2016-04-08 08:54:59 -07:00
Jacob MacDonald 63efb288a7 allow --dart-sdk with --persisent_worker
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1859363003 .
2016-04-07 07:08:48 -07:00
Jacob MacDonald 92419d092b Update worker mode to use the bazel protos directly instead of json
BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1868663002 .
2016-04-06 13:49:32 -07:00
Brian Wilkerson f819f9fb07 Add hooks for changing priorities of warnings to errors in strong mode
R=leafp@google.com

Review URL: https://codereview.chromium.org/1861363002 .
2016-04-06 13:06:29 -07:00
P.Y. Laligand f2a8ee1ebc Added option to dartanalyzer to treat lints as errors.
Fixes #25977
2016-03-31 11:24:51 -07:00
Konstantin Shcheglov 6347b4cca7 Support --persistent_worker flag in --build-mode.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1848543002 .
2016-03-30 12:31:09 -07:00
Konstantin Shcheglov 2895d7501e Fix for analyzer_cli/test/package_prefix_test on Windows.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1844613002 .
2016-03-29 12:18:50 -07:00
Konstantin Shcheglov daab52a191 Add the '--build-summary-only-ast' flag for generating summaries using only ASTs.
R=paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1838883002 .
2016-03-28 13:36:12 -07:00
Paul Berry ea189bd6dc Add a fallback mode for building summaries.
When summaries are built in fallback mode, the only information stored
in the package bundle is (a) which libraries appear in the bundle, and
(b) where the source files can be found on disk.  This is enough
information so that DDC will still be able to tell how libraries are
grouped into build units, but otherwise summary functionality is
disabled.

This is intended to be availadle as a temporary workaround so that if
a bug is found in the summary infrastructure, it won't prevent DDC
compilation from working (it will just make it slower).

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1826353002 .
2016-03-24 13:47:37 -07:00
Konstantin Shcheglov 58bde1b3b4 Add the --build-summary-exclude-informative flag.
It (in combination with --build-summary-only-diet) makes the
package:path summary is almost 3 times smaller, partially because of
skipping bodies, patially because of excluding documentation comments,
and partially because of making 'codeRange' fields informative.

We also remove MD5 hashes.

As I can see after changes in method bodies we generate the exactly
same file (or at least 'cmp -l' thinks so). Adding a new field results
in a file of different length.

R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1828973002 .
2016-03-24 08:20:56 -07:00
Konstantin Shcheglov d067c70ce9 Add --build-summary-only-diet option.
R=paulberry@google.com, brianwilkerson@google.com
BUG=

Review URL: https://codereview.chromium.org/1830733004 .
2016-03-23 20:37:26 -07:00
Konstantin Shcheglov f00f0168b6 Fix for build mode SDK options.
R=skybrian@google.com, paulberry@google.com
BUG=

Review URL: https://codereview.chromium.org/1830773004 .
2016-03-23 18:36:05 -07:00
Konstantin Shcheglov ef04426f17 Fix for analyze-cli and Dart SDK options.
Fix for one more problem with my analysisOptions change.
We should set it early and don't attempt to change it later.

Not sure how well it will work with Flutter and other non-standard SDKs.

R=brianwilkerson@google.com, pquitslund@google.com
BUG=

Review URL: https://codereview.chromium.org/1828903002 .
2016-03-23 14:53:07 -07:00
Paul Berry 014cfddea0 Clean up analyzer_cli build mode tests.
- Properly convert relative to absolute paths when the command-line
  arguments are of the form "$uri|$path".

- Test the behavior of "--build-suppress-exit-code".

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1825283006 .
2016-03-22 21:25:24 -07:00
Paul Berry c7e1de177a Change analyzer_cli's "package mode" into a "build mode".
Build mode differs from package mode in the following ways:

- The analyzer no longer guesses the relationship between paths and
  URIs based on directory structure.  Instead, each input file is
  specified in the form "$uri|$path".

- The analyzer does not read any files from disk that are not
  specified on the command line.

- There are no restrictions on the relationship between summaries and
  packages.  In particular: (a) multiple input summaries may summarize
  parts of the same package, and (b) part of a package may be
  specified with an input summary while an output summary is being
  generated for other parts of the same package.

- Output may be redirected to a file.

- The analyzer may be told to exit with success even in the event that
  an error is found during analysis.

This should ease the integration with Bazel, and provide a starting
point for integrating with other build systems.

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1830463002 .
2016-03-22 20:38:30 -07:00
Paul Berry c39a890dd1 Respect machineFormat in package-mode.
Ensures that stats printing in package-mode respects the `machineFormat`
flag.  (That is, only displays stats if not in machine mode.)

R=scheglov@google.com

Review URL: https://codereview.chromium.org/1820233003 .
2016-03-22 13:23:06 -07:00
Brian Slesinsky 9e21594c2a add --x-package-warnings-prefix option to dartanalyzer
This is similar to --package-warnings, except that diagnostics will
only be reported for Dart packages matching the given prefix.

Also added the number of source files analyzed and the number of
errors generated to performance report.

Cleanup: simplified code for triggering diet parsing.

BUG=
R=paulberry@google.com

Review URL: https://codereview.chromium.org/1806263004 .
2016-03-21 11:37:49 -07:00