analyzer 0.38.3 is breaking build_runner builders on stable sdks

Original issue dart-lang/build#2451

We are now reproing this on our build bots as well that run on older sdks.

Example stack trace below, it looks like we are calling getSourceKind with a dart: uri and that is failing when it didn’t previously? I don’t understand how the SDK version makes a difference here, but I can repro this error in versions 2.3 through 2.5 of the sdk, but not the latest dev.

Invalid argument(s): Path must be absolute : dart:core
#0      MemoryResourceProvider._ensureAbsoluteAndNormalized (package:analyzer/file_system/memory_file_system.dart:244:7)
#1      MemoryResourceProvider.getFile (package:analyzer/file_system/memory_file_system.dart:94:5)
#2      FileSystemState.getFileForUri (package:analyzer/src/dart/analysis/file_state.dart:999:41)
#3      FileState._fileForRelativeUri (package:analyzer/src/dart/analysis/file_state.dart:564:21)
#4      FileState._refresh2 (package:analyzer/src/dart/analysis/file_state.dart:705:18)
#5      FileState.refresh (package:analyzer/src/dart/analysis/file_state.dart:401:14)
#6      FileSystemState.getFileForPath (package:analyzer/src/dart/analysis/file_state.dart:964:12)
#7      AnalysisDriver.getSourceKind (package:analyzer/src/dart/analysis/driver.dart:818:33)
<asynchronous suspension>
#8      AnalyzerResolver.isLibrary (package:build_resolvers/src/resolver.dart:83:24)
<asynchronous suspension>
#9      PerActionResolver.isLibrary (package:build_resolvers/src/resolver.dart:59:56)
#10     _DelayedResolver.isLibrary (package:build/src/builder/build_step_impl.dart:192:25)
<asynchronous suspension>
#11     ListClassesAndHierarchyBuilder.build (file:///usr/local/google/home/jakemac/build/build_runner_core/test/generate/resolution_test.dart:47:35)
#12     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
#13     ListClassesAndHierarchyBuilder.build (file:///usr/local/google/home/jakemac/build/build_runner_core/test/generate/resolution_test.dart:45:21)
#14     runBuilder.buildForInput (package:build/src/generate/run_builder.dart:55:21)
#15     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
#16     runBuilder.buildForInput (package:build/src/generate/run_builder.dart:45:29)
#17     MappedListIterable.elementAt (dart:_internal/iterable.dart:414:29)
#18     ListIterator.moveNext (dart:_internal/iterable.dart:343:26)
#19     Future.wait (dart:async/future.dart:393:26)
#20     runBuilder.<anonymous closure> (package:build/src/generate/run_builder.dart:61:36)
#21     _rootRun (dart:async/zone.dart:1124:13)
#22     _CustomZone.run (dart:async/zone.dart:1021:19)
#23     _runZoned (dart:async/zone.dart:1516:10)
#24     runZoned (dart:async/zone.dart:1500:12)
#25     scopeLogAsync (package:build/src/builder/logging.dart:22:3)
#26     runBuilder (package:build/src/generate/run_builder.dart:61:9)
#27     _AsyncAwaitCompleter.start (dart:async-patch/async_patch.dart:49:6)
#28     runBuilder (package:build/src/generate/run_builder.dart:33:24)
#29     _SingleBuild._runForInput.<anonymous closure>.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:478:19)
#30     _NoOpBuilderActionTracker.trackStage (package:build_runner_core/src/generate/performance_tracker.dart:300:15)
#31     _SingleBuild._runForInput.<anonymous closure>.<anonymous closure> (package:build_runner_core/src/generate/build_impl.dart:476:23)
#32     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
#33     StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#34     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#35     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#36     _rootRunUnary (dart:async/zone.dart:1132:38)
#37     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#38     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#39     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#40     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#41     Future._complete (dart:async/future_impl.dart:473:7)
#42     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#43     _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
#44     _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
#45     FailureReporter.clean (package:build_runner_core/src/logging/failure_reporter.dart)
#46     _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
#47     StackZoneSpecification._registerUnaryCallback.<anonymous closure>.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:26)
#48     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#49     StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:129:14)
#50     _rootRunUnary (dart:async/zone.dart:1132:38)
#51     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#52     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#53     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#54     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#55     Future._completeWithValue (dart:async/future_impl.dart:483:5)
#56     Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:513:7)
#57     StackZoneSpecification._run (package:stack_trace/src/stack_zone_specification.dart:209:15)
#58     StackZoneSpecification._registerCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart:119:48)
#59     _rootRun (dart:async/zone.dart:1124:13)
#60     _CustomZone.run (dart:async/zone.dart:1021:19)
#61     _CustomZone.runGuarded (dart:async/zone.dart:923:7)
#62     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:963:23)
#63     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#64     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#65     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#66     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)

Author: Fantashit

1 thought on “analyzer 0.38.3 is breaking build_runner builders on stable sdks

  1. downgrade analyzer version from 0.38.3 to 0.38.2

    dependencies:
      //analyzer: ^0.38.2
      analyzer: 0.38.2
    

Comments are closed.