Skip to content

Commit

Permalink
don\'t require a local package config in watch mode
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 committed Jun 17, 2024
1 parent bd793f5 commit 4c3c7e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions _test/test/common/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ Future<void> startServer(
_startServer(
'dart',
[
'--packages=',
(await Isolate.packageConfig).toString(),
'--packages=${(await Isolate.packageConfig).toString()}',
p.join('..', 'build_runner', 'bin', 'build_runner.dart'),
'serve',
'--verbose',
Expand Down
10 changes: 8 additions & 2 deletions build_runner/lib/src/generate/watch_impl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -332,8 +332,14 @@ class WatchImpl implements BuildState {
() async {
await logTimedAsync(_logger, 'Waiting for all file watchers to be ready',
() => graphWatcher.ready);
originalRootPackageConfigDigest = md5.convert(
await watcherEnvironment.reader.readAsBytes(rootPackageConfigId));
if (await watcherEnvironment.reader.canRead(rootPackageConfigId)) {
originalRootPackageConfigDigest = md5.convert(
await watcherEnvironment.reader.readAsBytes(rootPackageConfigId));
} else {
_logger.warning(
'Root package config not readable, manual restarts will be needed '
'after running `pub upgrade`.');
}

BuildResult firstBuild;
BuildImpl? build;
Expand Down

0 comments on commit 4c3c7e9

Please sign in to comment.