Files
sdk/pkg
Konstantin Shcheglov d2e5d475bc Fix for crash when annotation references synthtic constructor of a generic class alias.
FAILURE: mixi@:class<s=a(=m
[NoSuchMethodError: The getter 'enclosingElement' was called on null.
Receiver: null
Tried calling: enclosingElement, #0      Object.noSuchMethod (dart:core-patch/object_patch.dart:54:5)
#1      LinkedResolutionReader.nextElement (package:analyzer/src/summary2/bundle_reader.dart:602:22)
#2      ApplyResolutionVisitor._nextElement (package:analyzer/src/summary2/apply_resolution.dart:1106:24)
#3      ApplyResolutionVisitor.visitAnnotation (package:analyzer/src/summary2/apply_resolution.dart:83:20)
#4      AnnotationImpl.accept (package:analyzer/src/dart/ast/ast.dart:280:49)
#5      NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7611:20)
#6      ApplyResolutionVisitor.visitClassTypeAlias (package:analyzer/src/summary2/apply_resolution.dart:167:20)
#7      ClassTypeAliasImpl.accept (package:analyzer/src/dart/ast/ast.dart:1794:49)
#8      LinkedContext.applyResolution (package:analyzer/src/summary2/bundle_reader.dart:512:11)
#9      LinkedUnitContext.applyResolution (package:analyzer/src/summary2/linked_unit_context.dart:93:25)
#10     ElementImpl.metadata (package:analyzer/src/dart/element/element.dart:2893:21)
#11     ResolutionVisitor.visitClassTypeAlias (package:analyzer/src/dart/resolver/resolution_visitor.dart:256:51)
#12     ClassTypeAliasImpl.accept (package:analyzer/src/dart/ast/ast.dart:1794:49)
#13     NodeListImpl.accept (package:analyzer/src/dart/ast/ast.dart:7611:20)
#14     CompilationUnitImpl.visitChildren (package:analyzer/src/dart/ast/ast.dart:2141:21)
#15     RecursiveAstVisitor.visitCompilationUnit (package:analyzer/dart/ast/visitor.dart:731:10)
#16     CompilationUnitImpl.accept (package:analyzer/src/dart/ast/ast.dart:2134:49)
#17     LibraryAnalyzer._resolveFile (package:analyzer/src/dart/analysis/library_analyzer.dart:680:10)
#18     LibraryAnalyzer.analyzeSync.<anonymous closure> (package:analyzer/src/dart/analysis/library_analyzer.dart:139:7)
#19     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:387:8)
#20     LibraryAnalyzer.analyzeSync (package:analyzer/src/dart/analysis/library_analyzer.dart:138:11)
#21     LibraryAnalyzer.analyze (package:analyzer/src/dart/analysis/library_analyzer.dart:107:12)
#22     AnalysisDriver._computeResolvedLibrary2.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1414:65)
#23     PerformanceLog.run (package:analyzer/src/dart/analysis/performance_logger.dart:32:15)
#24     AnalysisDriver._computeResolvedLibrary2 (package:analyzer/src/dart/analysis/driver.dart:1400:20)
#25     AnalysisDriver._computeResolvedLibrary.<anonymous closure> (package:analyzer/src/dart/analysis/driver.dart:1393:15)


Change-Id: I6f04a325b30d9dc61e7eb1a4bba91ed8b9bcd1d3
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/176060
Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
Commit-Queue: Konstantin Shcheglov <scheglov@google.com>
2020-12-14 05:37:37 +00:00
..
2020-12-10 01:38:26 +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