For instance one could pass something like
```
--wantErrorOnReload="Error: The getter 'axis' isn't defined for the class 'Constraints'" --noTryToDeleteEmptyFilesUpFront
```
to reproduce https://dart-review.googlesource.com/c/sdk/+/180341
(the --noTryToDeleteEmptyFilesUpFront part might not be neccessary,
but was at one point doing the reproduction / development of this).
Change-Id: I943b715c56f3e1103c6287ed9529aa29c0e74f07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/180360
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Emphasize that the operation is going away,
and mark constructor as deprecated.
TEST= Refactoring+deprecation only, covered by existing tests.
Change-Id: I82aa044cd2cf7bf347b624371399f44bda8f4a07
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/173261
Commit-Queue: Lasse R.H. Nielsen <lrn@google.com>
Reviewed-by: Konstantin Shcheglov <scheglov@google.com>
Reviewed-by: Nate Bosch <nbosch@google.com>
This CL adds to/changes the crash test minimizer to:
* Make use of the direct-from-parser ast to try to delete entire
classes, procedures etc.
* Tries to inline small files into the importers/exporters of those
files to reduce the number of files.
* Can print info by pression 'i' while it's running.
* Can stop the process without throwing away anything by pression 'q'.
* Can save and load a partial minimization to a json file so one can
start from there again by passing '--fsJson=jsonFileHere'.
* Attempts to prints the reproduction as a "incremental yaml test file"
so one can quickly create an incremental test reproducing the crash.
For instance, recreating a bug recently fixed, I can find it using:
```
time out/ReleaseX64/dart pkg/front_end/test/crashing_test_case_minimizer.dart --platform=/path/to/flutter/bin/cache/artifacts/engine/common/flutter_patched_sdk/platform_strong.dill --invalidate=package:flutter/src/widgets/framework.dart --target=flutter --widgetTransformation --experimental-invalidation --serialize --stack-matches=5 /tmp/edited_flutter_gallery/lib/main.dart
[...]
DONE
Wrote json file system to file:///usr/local/google/home/jensj/code/dart-sdk/sdk/crash_minimizer_result_132
------ Reproduction as semi-done incremental yaml test file ------
type: newworld
trackWidgetCreation: true
target: DDC # basically needed for widget creation to be run
worlds:
- entry: file:///tmp/edited_flutter_gallery/lib/main.dart
experiments: alternative-invalidation-strategy
sources:
file:///tmp/edited_flutter_gallery/.dart_tool/package_config.json: |
{
"configVersion": 2,
"packages": [
{
"name": "flutter",
"rootUri": "file:///path/to/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.12"
}
],
"generated": "2020-11-20T08:58:21.614044Z",
"generator": "pub",
"generatorVersion": "2.12.0-50.0.dev"
}
file:///tmp/edited_flutter_gallery/lib/main.dart: |
import "package:flutter/src/widgets/framework.dart";
file:///path/to/flutter/packages/flutter/lib/src/widgets/framework.dart: |
import "package:flutter/src/widgets/widget_inspector.dart";
abstract class Widget {}
file:///path/to/flutter/packages/flutter/lib/src/widgets/widget_inspector.dart: |
abstract class _HasCreationLocation {}
class _Location {}
expectedLibraryCount: 3 # with parts this is not right
- entry: file:///tmp/edited_flutter_gallery/lib/main.dart
experiments: alternative-invalidation-strategy
worldType: updated
expectInitializeFromDill: false # or true?
invalidate:
- package:flutter/src/widgets/framework.dart
expectedLibraryCount: 3 # with parts this is not right
expectsRebuildBodiesOnly: true # or false?
------------------------------------------------------------------
[...]
real 31m16.886s
user 38m57.585s
sys 1m35.374s
```
Change-Id: I9b75a231841c13370f11879a10485ee2add8c3ad
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/174643
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
Even when non-nullable is enabled by default, enabling the experiment
explicitly should result in the experiment release version (and not
the experiment enabled version) to be used for opting in.
For this change, the semantics of parseExperimentalFlags was change
to _not_ normalize the flags to a full mapping including default values.
For this reason all uses of such maps are renamed to
'explicitExperimentalFlags'.
Closes#43879
Change-Id: I0d0262e68ec1403549abcfd305ae3a4404fe93e3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/168654
Reviewed-by: Jake Macdonald <jakemac@google.com>
Commit-Queue: Johnni Winther <johnniwinther@google.com>
Before this CL (and still as default) the crashing test minimizer would
operate by
1) Run and verify it crashed; record the first entry of the stacktrace
2) Delete stuff and rerun, verifying that the first entry of the new
stacktrace matched the old one (to verify we have a smaller example
of the same crash).
This doesn't work will with for instance assert errors though, as trying
to find a small reproduction for one assert error could result in a
small reproduction for another assert error.
This CL introduces the "--stack-matches=<n>" option, so you could for
instance add "--stack-matches=3" in an attempt to find the exact
assert error you wanted.
Change-Id: I1b523e9c3d391c63b3ffb5baa8ab673df7e051d6
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/156505
Reviewed-by: Johnni Winther <johnniwinther@google.com>
Commit-Queue: Jens Johansen <jensj@google.com>
* Refactor a test to make it easier to extend it later.
* Allow the crashing reproduction minimizer to search for a new target
if it finds another interesting crash.
* Fix update_expectations tool to include textual_outline
* Fix leakingDebugToString on Library
Change-Id: I9a59151f2ad5c2d91b4cbbe10d864fe9928221eb
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/146804
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>
E.g., reproducing #40707:
$ time out/ReleaseX64/dart pkg/front_end/test/crashing_test_case_minimizer.dart --platform=[...]/flutter_web_sdk/kernel/flutter_ddc_sdk.dill --invalidate=[...]/gallery/lib/main.dart --target=ddc --widgetTransformation [...]/gallery/lib/main.dart
[...]
DONE
Uri file://[...]/gallery/.dart_tool/package_config.json has this content:
{
"packages": [
{
"name": "flutter",
"rootUri": "file://[...]/flutter/packages/flutter",
"packageUri": "lib/",
"languageVersion": "2.2"
},
{
}
],
"generatorVersion": "2.9.0-3.0.dev.flutter-b0d35855d8"
}
====================
Uri file://[...]/gallery/lib/main.dart has this content:
import 'package:flutter/material.dart';
class RootPage extends StatelessWidget {
====================
Uri file://[...]/flutter/packages/flutter/lib/foundation.dart has this content:
export 'src/foundation/diagnostics.dart';
====================
Uri file://[...]/flutter/packages/flutter/lib/material.dart has this content:
export 'widgets.dart';
====================
Uri file://[...]/flutter/packages/flutter/lib/src/foundation/diagnostics.dart has this content:
abstract class DiagnosticableTree with Diagnosticable {
====================
Uri file://[...]/flutter/packages/flutter/lib/widgets.dart has this content:
export 'src/widgets/framework.dart';
export 'src/widgets/widget_inspector.dart';
====================
Uri file://[...]/flutter/packages/flutter/lib/src/widgets/framework.dart has this content:
import 'package:flutter/foundation.dart';
abstract class Widget extends DiagnosticableTree {
}
abstract class StatelessWidget extends Widget {
====================
Uri file://[...]/flutter/packages/flutter/lib/src/widgets/widget_inspector.dart has this content:
abstract class _HasCreationLocation {
}
class _Location {
====================
real 5m28.400s
user 7m24.233s
sys 0m9.895s
Change-Id: Ide66ad928699b781f3cfa8de11536cc8125983e2
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/145080
Commit-Queue: Jens Johansen <jensj@google.com>
Reviewed-by: Johnni Winther <johnniwinther@google.com>