stablekernel / dart-isolate-executor

BSD 2-Clause "Simplified" License
11 stars 13 forks source link

[Nullsafety] Works when importing from local path but not git when importing to aqueduct #11

Open j4qfrost opened 3 years ago

j4qfrost commented 3 years ago

Since my nullsafety changes haven't been published I have been including the dependency into aqueduct via git. This caused an error in test/command/document_server_test.dart

Bad state: Unable to find the context to /Users/blah/.pub-cache/git/dart-isolate-executor-8b38833119195c4e854dd6e423c1ea2e47c0525f/lib/src/executable.dart
  **** Stacktrace
  * #0      AnalysisContextCollectionImpl.contextFor (package:analyzer/src/dart/analysis/analysis_context_collection.dart:85:5)
  * #1      SourceGenerator._getClass (package:isolate_executor/src/source_generator.dart:64:47)
  * <asynchronous suspension>
  * #2      StackZoneSpecification._registerUnaryCallback.<anonymous closure> (package:stack_trace/src/stack_zone_specification.dart)
  * <asynchronous suspension>
  ****

If I use an override to import the dependency like ../../dart-isolate-executor, the error goes away.

Needless to say I haven't set up a proper import via the package system, because my nullsafety changes haven't been merged, so I don't know if that will work or not.

j4qfrost commented 3 years ago

The culprit is that something is setting .pub-cache to be excluded from the context in the analyzer package. I haven't figured out a fix.