Commit Graph

27 Commits

Author SHA1 Message Date
Konstantin Shcheglov 9dd51c80bd Deprecated getFile() and getSourceKind(). Added getFile2() instead.
R=brianwilkerson@google.com

Change-Id: Ia52967472077abd73cdf4df1320dd71b5dee98b7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/196060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2021-04-19 23:57:19 +00:00
Konstantin Shcheglov 26d9fbbd04 Add getResolvedUnit2(), deprecate getResolvedUnit().
Change-Id: I0217fefb2747f2f9bd757bc041b53acaf3d1a8f1
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/195495
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2021-04-16 21:33:54 +00:00
Devon Carew b782d5815f [pkg/nnbd_migration] add types to public API
Change-Id: Ie4a7bbe75dd8045b20361c3fa1e08784b990e951
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176142
Commit-Queue: Devon Carew <devoncarew@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2020-12-15 01:34:29 +00:00
Sam Rawlins 475ffb96c0 Migrator: Use pedantic 1.9.0
Change-Id: Ia53e84ac6b2f3ab0679710c14453fd65c8f9c00d
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/163161
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-09-17 20:52:43 +00:00
Leaf Petersen d44457f79d [Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates
references in build files and elsewhere accordingly.

Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121
Commit-Queue: Leaf Petersen <leafp@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
2020-06-16 23:37:36 +00:00
Paul Berry 2e261f9386 Migration: add locations to trace entries that refer to elements.
Bug: https://github.com/dart-lang/sdk/issues/41402
Change-Id: I0dc59ae9d64c6e8ab470b2ddcb5fd42557ba5704
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/148742
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-05-27 21:52:14 +00:00
Mike Fairhurst 2693b80dfd [nnbd_migration] Do basic categorization of edit types to suppress noise.
We really should switch this, if possible, to use the edit kind APIs
that the preview tool uses, so that we can categorize this without
guesswork.

However this will keep it as a rough list, and I don't know if we need
anything fancier that currently -- and it will no longer produce noise
if new changes are added.

(currently produces "and 0 other changes" when running on flutter, so
it's probably mostly comprehensive currently).

Change-Id: I9cb2662995af340346a61d38eba3469927a0f4ef
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145160
Reviewed-by: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2020-04-29 17:22:44 +00:00
Sam Rawlins 654a31c9bc Improve trial_migration stats
Change-Id: Iff65ac375e15dc9077fea81fbc86bee264ccc4d0
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/138904
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Samuel Rawlins <srawlins@google.com>
2020-03-10 17:04:30 +00:00
Janice Collins 4ee5fd243f Move the parallelization restriction into SubprocessLauncher.
This eliminates a lot of really noisy boilerplate in the upcoming
FantasyRepo implementation.  The test only verifies that the pathway
works, we rely on MultiFutureTracker working to actually restrict
properly.

Change-Id: Ia88d0b24dd739ab1cd4a661325214395bf37eef3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133742
Reviewed-by: Paul Berry <paulberry@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2020-01-29 18:32:36 +00:00
Janice Collins f0038ad8aa Move MultiFutureTracker and SubprocessLauncher into utilities.
Also adds some basic tests for both, centering on the functionality
that is most important to use in SubprocessLauncher's case.

Change-Id: I90a79cd12f7b2222bae366907a6dc200591bb59c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133433
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-27 21:34:19 +00:00
Janice Collins a1a888ec92 Boilerplate and basic flow for buildFantasyLand.
Does not actually implement much of anything, just enough connecting
tissue so that it's possible to review the overall design.

Change-Id: I991f9a4f65d1d23494cefd80ba8c3b4efdb3e572
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/133324
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2020-01-27 20:29:49 +00:00
Paul Berry 31bfacfda4 Migration: change API to make use of FixBuilder's "changes" data structure.
The new FixBuilder component of the migration engine communicates the
changes it produces using a "changes" data structure of type Map<int,
List<AtomicEdit>>, and is not compatible with the old
SingleNullabilityFix class (which made the incorrect assumption that
each SourceEdit was associated with a single fix).  This CL changes
the migration engine's instrumentation API to use this data structure,
and changes its listener API to avoid reference to the
SingleNullabilityFix class.  This allows SingleNullabilityFix to be
deleted.

This required changing AtomicEditWithReason so that it can hold
multiple fix reasons, and a NullabilityFixDescription.  It does so
using a new object, AtomicEditInfo, and AtomicEditWithReason is
renamed to AtomicEditWithInfo.

In addition, the old FixInfo class is removed, since it carries the
same information as the new AtomicEditWithInfo class.

This required deleting the "incremental workflow" functionality from
UnitRenderer.  This functionality was disabled, and I believe it
wouldn't have worked anyway (since it, too, made the incorrect
assumption that each SourceEdit was associated with a single fix).

Change-Id: Id965cfd803b408c66f15436017b87fc3e46521c6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/132306
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2020-01-19 16:50:01 +00:00
Paul Berry 2199e94d37 Migration: begin integrating FixBuilder.
Since the FixBuilder-based implementation is not yet fully baked, we
only enable the integration in api_test.dart for now.  The remaining
failing test cases are marked with a `@FailingTest` annotation
pointing to https://github.com/dart-lang/sdk/issues/38472, which is
the tracking bug for the FixBuilder implementation.

Change-Id: I761350fff125cec8067a96fdfc593b381e5feb3b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130882
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2020-01-09 20:01:16 +00:00
Paul Berry 6ec16da54d Sort declarations in trial_migration.dart
Change-Id: I7f8c3db9bc414c6567547e163fd417bc602e4d4a
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/130880
Reviewed-by: Janice Collins <jcollins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2020-01-09 16:04:26 +00:00
Mike Fairhurst 84054e8641 [nnbd_migration] group trial exceptions by pkg, skip bad files
Change-Id: I43aebea6030726077cc8478a948e01e3c2989dc7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/129521
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-12-24 00:56:10 +00:00
Janice Collins 4e1a9afc4b Update trial_migration for P1/G1 packages.
The shell script now makes use of github fetching and `pub get` to deal with dev_dependencies
and other things missing from the SDK.  Also added the remaining packages not in the SDK, but
in group 1.

Change-Id: I6ae9b169eb8a419d73c66f08fb3973b49a96efb7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/128287
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-12-16 16:41:02 +00:00
Janice Collins 28b0f18397 Add basic git package management to trial_migration.
- New flag: --clean will throw away the local playground at the beginning of the run
- New flag: --exception_node_only prints only the exception node
- New flag: -g allows fetching git repositories into a local playground
- New flag: -u automatically updates Git repositories with git pull

Change-Id: If8472cb9bb97b42fe649d6ec168850c740f84d6b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127702
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
2019-12-10 17:51:55 +00:00
Janice Collins 42799b66b6 Add support for unmanaged packages to trial_migration.
Change-Id: I01fbfa251f8b7fdcaec90102b603641bf573c107
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127501
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Samuel Rawlins <srawlins@google.com>
2019-12-09 17:28:47 +00:00
Janice Collins dfa32032fd Add scaffolding to trial_migration for more package sources.
Imports a subprocess helper with JSON parsing borrowed from Dartdoc,
which will come in handy both for launching pub and for building the
trial migration script out for comparing output between versions.

Also puts some basic structure in to allow for fetching packages for
multiple sources.

Change-Id: I5262b93aa1d60005ee262b7ed00bf534b1c51447
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127446
Commit-Queue: Janice Collins <jcollins@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-12-06 18:01:51 +00:00
Janice Collins 7fcff7e87f Allow passing the sdk root for analysis to trial_migration.
Also redirects usage warnings to stderr, adds --help, and verifies that the sdk
you pass in actually supports NNBD.

Change-Id: Ia758f69648f88108b3c0df9de46ab246d3db0c9e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/127202
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Janice Collins <jcollins@google.com>
2019-12-05 18:43:19 +00:00
Mike Fairhurst b19436061d [migration] enable typed data in migration -- fatal exception is gone.
Change-Id: Ic32fb4cc194da01055286dcf6b02d56efb8501e7
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/126121
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Mike Fairhurst <mfairhurst@google.com>
2019-11-25 20:02:35 +00:00
Mike Fairhurst 335b85fea1 [nnbd_migration] for tool/trial_migration, accept interest argument.
Change-Id: I1a92d2afd0483bbb156b8b9d82817fde36b821c4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/124204
Commit-Queue: Paul Berry <paulberry@google.com>
Auto-Submit: Mike Fairhurst <mfairhurst@google.com>
Reviewed-by: Paul Berry <paulberry@google.com>
2019-11-06 19:25:19 +00:00
Paul Berry 5b33baded9 Migration: fix trial_migration.dart's handling of required
Now that the migration tool inserts `required` rather than `@required`
for required parameters, we need the trial_migration tool to
understand the new behavior.

Change-Id: I401310930120cf6e57af7ab633983b44415d404f
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/119081
Reviewed-by: Samuel Rawlins <srawlins@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-09-26 19:00:19 +00:00
Paul Berry 7e04e051cf Migration: add an option to print just exception nodes rather than full stack traces.
This makes it easier to find a short reproducible test case when
investigating a migration tool exception.

Change-Id: I13adf3e733d5cbbad58c9649420f7fdd072e4bdf
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/115840
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-09-06 16:09:04 +00:00
Paul Berry bbbd6cdbcb Migration: update trial_migration.dart to show exceptions per package.
This should make it easier to notice when we get to the point where a
new package can be migrated without exceptions.

At the moment we can migrate one package without exceptions: charcode.

Change-Id: Icef71ad3dca0e1a25bb5e42f4b2691e90c44ec2e
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/114583
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Commit-Queue: Paul Berry <paulberry@google.com>
2019-08-27 12:33:54 +00:00
Paul Berry c6e2497569 Migration: capture more exception information and make it easier to examine stack traces.
Change-Id: If509121fcf2b1f9b9e0a7bf722945241b90c647b
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/113840
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
2019-08-20 15:20:00 +00:00
Paul Berry 6839e0d9f8 Migration: create a simple client of the migration API for early testing.
Change-Id: I889f7b80fdbb8dbddd8174812ddaca013cf272e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/112361
Commit-Queue: Paul Berry <paulberry@google.com>
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
2019-08-09 03:43:40 +00:00