Files
sdk/pkg
Jens Johansen 923facf226 [CFE] Improve crash test minimizer
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>
2020-12-03 07:53:57 +00:00
..
2020-11-12 17:59:37 +00:00
2020-11-11 16:55:22 +00:00

Package validation

The packages in pkg/ are automatically validated on the LUCI CI bots. The validation is largely done by the tools/package_deps package; it can be tested locally via:

dart tools/package_deps/bin/package_deps.dart

Packages which are published

There are several packages developed in pkg/ which are published to pub. Validation of these packages is particularly important because the pub tools are not used for these packages during development; we get our dependency versions from the DEPS file. Its very easy for the dependencies specified in a package's pubspec file to get out of date wrt the packages and versions actually used.

In order to better ensure we're publishing correct packages, we validate some properties of the pubspec files on our CI system. These validations include:

  • that the dependencies listed in the pubspec are used in the package
  • that all the packages used by the source are listed in the pubspec
  • that we don't use relative path deps to pkg/ or third_party/ packages

Packages which are not published

For packages in pkg/ which we do not intend to be published, we put the following comment in the pubspec.yaml file:

# This package is not intended for consumption on pub.dev. DO NOT publish.
publish_to: none

These pubspecs are still validated by the package validation tool. The contents are more informational as the pubspecs for these packages are not consumed by the pub tool or ecosystem.

We validate:

  • that the dependencies listed in the pubspec are used in the package
  • that all the packages used by the source are listed in the pubspec
  • that a reference to a pkg/ package is done via a relative path dependency