Skip to content

Allow build_runner to continue compiling when modifying a source file #4268

@tomyeh

Description

@tomyeh
  • The Dart SDK Version (dart --version)
    • Dart 3.9.4
  • What package(s) from this repo you are using, and the version (i.e. build_runner 0.7.12)
    • build_runner 2.9.0 ~ 2.10.1
  • Whether you are using Windows, MacOSX, or Linux (if applicable)
    • MacOS

Since 2.9.0, the following exception is thrown if I modifies a dart file when DDC is compiling. It is annoying, since I have to restart DDC for fixing it, or I have to make sure DDC is done before saving any file.

Note: There is no such issue with build_runner 2.8.0.

[SEVERE] Unhandled exception:
[SEVERE] Bad state: Can't invalidate while there are pending writes.
[SEVERE] #0      InMemoryFilesystemCache.invalidate (package:build_runner/src/io/filesystem_cache.dart:147:7)
[SEVERE] #1      BuildSeries.filterChanges (package:build_runner/src/build/build_series.dart:165:29)
[SEVERE] #2      BuildRunnerDaemonBuilder.create.graphEvents.<anonymous closure> (package:build_runner/src/commands/daemon/daemon_builder.dart:242:36)
[SEVERE] #3      Stream.asyncMap.<anonymous closure>.<anonymous closure> (dart:async/stream.dart:831:29)
[SEVERE] #4      _rootRunUnary (dart:async/zone.dart:1538:47)
[SEVERE] #5      _CustomZone.runUnary (dart:async/zone.dart:1429:19)
[SEVERE] #6      _CustomZone.runUnaryGuarded (dart:async/zone.dart:1329:7)
[SEVERE] #7      _BufferingStreamSubscription._sendData (dart:async/stream_impl.dart:381:11)
[SEVERE] #8      _BufferingStreamSubscription._add (dart:async/stream_impl.dart:312:7)
[SEVERE] #9      _SyncStreamControllerDispatch._sendData (dart:async/stream_controller.dart:798:19)
[SEVERE] #10     _StreamController._add (dart:async/stream_controller.dart:663:7)
[SEVERE] #11     _StreamController.add (dart:async/stream_controller.dart:618:5)
[SEVERE] #12     RateLimit._debounceAggregate.<anonymous closure>.emit (package:stream_transform/src/rate_limit.dart:324:14)
[SEVERE] #13     RateLimit._debounceAggregate.<anonymous closure>.<anonymous closure> (package:stream_transform/src/rate_limit.dart:339:50)
[SEVERE] #14     _rootRun (dart:async/zone.dart:1517:47)
[SEVERE] #15     _CustomZone.run (dart:async/zone.dart:1422:19)
[SEVERE] #16     _CustomZone.runGuarded (dart:async/zone.dart:1321:7)
[SEVERE] #17     _CustomZone.bindCallbackGuarded.<anonymous closure> (dart:async/zone.dart:1362:23)
[SEVERE] #18     _rootRun (dart:async/zone.dart:1525:13)
[SEVERE] #19     _CustomZone.run (dart:async/zone.dart:1422:19)
[SEVERE] #20     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:1345:23)
[SEVERE] #21     Timer._createTimer.<anonymous closure> (dart:async-patch/timer_patch.dart:18:15)
[SEVERE] #22     _Timer._runTimers (dart:isolate-patch/timer_impl.dart:423:19)
[SEVERE] #23     _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:454:5)
[SEVERE] #24     _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:193:12)

Metadata

Metadata

Assignees

Labels

type-bugIncorrect behavior (everything from a crash to more subtle misbehavior)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions