Skip to content

Commit ebe99e8

Browse files
authored
Fix missing resolved import handling. (#4065)
1 parent 85646c8 commit ebe99e8

File tree

10 files changed

+56
-14
lines changed

10 files changed

+56
-14
lines changed

build/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.5.4
2+
3+
- Use `build_runner_core` 9.1.2.
4+
15
## 2.5.3
26

37
- Use `build_runner_core` 9.1.1.

build/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build
2-
version: 2.5.3
2+
version: 2.5.4
33
description: A package for authoring build_runner compatible code generators.
44
repository: https://github.com/dart-lang/build/tree/master/build
55
resolution: workspace
@@ -10,7 +10,7 @@ environment:
1010
dependencies:
1111
analyzer: '>=6.9.0 <8.0.0'
1212
async: ^2.5.0
13-
build_runner_core: '9.1.1'
13+
build_runner_core: '9.1.2'
1414
built_collection: ^5.1.1
1515
built_value: ^8.9.5
1616
convert: ^3.0.0
@@ -24,7 +24,7 @@ dependencies:
2424
pool: ^1.5.0
2525

2626
dev_dependencies:
27-
build_resolvers: '2.5.3'
27+
build_resolvers: '2.5.4'
2828
build_test: ^3.1.0
2929
built_value_generator: ^8.9.5
3030
dart_flutter_team_lints: ^3.1.0

build_resolvers/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.5.4
2+
3+
- Use `build_runner_core` 9.1.2.
4+
15
## 2.5.3
26

37
- Use `build_runner_core` 9.1.1.

build_resolvers/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_resolvers
2-
version: 2.5.3
2+
version: 2.5.4
33
description: Resolve Dart code in a Builder
44
repository: https://github.com/dart-lang/build/tree/master/build_resolvers
55
resolution: workspace
@@ -10,8 +10,8 @@ environment:
1010
dependencies:
1111
analyzer: '>=6.9.0 <8.0.0'
1212
async: ^2.5.0
13-
build: '2.5.3'
14-
build_runner_core: '9.1.1'
13+
build: '2.5.4'
14+
build_runner_core: '9.1.2'
1515
collection: ^1.17.0
1616
convert: ^3.1.1
1717
crypto: ^3.0.0

build_runner/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 2.5.4
2+
3+
- Bug fix: fix incremental build when previous build had `package:` import of
4+
a missing dep or a missing file.
5+
16
## 2.5.3
27

38
- Bug fix: fix corner case with checked in generated output that could cause

build_runner/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_runner
2-
version: 2.5.3
2+
version: 2.5.4
33
description: A build system for Dart code generation and modular compilation.
44
repository: https://github.com/dart-lang/build/tree/master/build_runner
55
resolution: workspace
@@ -16,11 +16,11 @@ dependencies:
1616
analyzer: '>=4.4.0 <8.0.0'
1717
args: ^2.0.0
1818
async: ^2.5.0
19-
build: '2.5.3'
19+
build: '2.5.4'
2020
build_config: ">=1.1.0 <1.2.0"
2121
build_daemon: ^4.0.0
22-
build_resolvers: '2.5.3'
23-
build_runner_core: '9.1.1'
22+
build_resolvers: '2.5.4'
23+
build_runner_core: '9.1.2'
2424
code_builder: ^4.2.0
2525
collection: ^1.15.0
2626
crypto: ^3.0.0

build_runner_core/CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 9.1.2
2+
3+
- Bug fix: fix incremental build when previous build had `package:` import of
4+
a missing dep or a missing file.
5+
16
## 9.1.1
27

38
- Bug fix: fix corner case with checked in generated output that could cause

build_runner_core/lib/src/generate/single_step_reader_writer.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,8 @@ class SingleStepReaderWriter extends AssetReader
451451

452452
var node = _runningBuild.assetGraph.get(id);
453453
if (node == null) {
454+
// Add to the graph for input tracking.
455+
_runningBuild.assetGraph.add(AssetNode.missingSource(id));
454456
return PhasedValue.fixed('');
455457
}
456458

build_runner_core/pubspec.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: build_runner_core
2-
version: 9.1.1
2+
version: 9.1.2
33
description: Core tools to organize the structure of a build and run Builders.
44
repository: https://github.com/dart-lang/build/tree/master/build_runner_core
55
resolution: workspace
@@ -15,10 +15,10 @@ platforms:
1515
dependencies:
1616
analyzer: '>=6.9.0 <8.0.0'
1717
async: ^2.5.0
18-
build: '2.5.3'
18+
build: '2.5.4'
1919
build_config: ^1.0.0
20-
build_resolvers: '2.5.3'
21-
build_runner: '2.5.3'
20+
build_resolvers: '2.5.4'
21+
build_runner: '2.5.4'
2222
built_collection: ^5.1.1
2323
built_value: ^8.10.1
2424
collection: ^1.15.0

build_runner_core/test/invalidation/resolved_input_invalidation_test.dart

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,4 +557,26 @@ void main() {
557557
);
558558
});
559559
});
560+
561+
group('a.1 <== a.2, a.2 resolves: a.1 -> missing', () {
562+
setUp(() {
563+
tester.sources(['a.1', 'b']);
564+
tester.importGraph({
565+
'a.1': ['package:missing/missing'],
566+
});
567+
tester.builder(from: '.1', to: '.2')
568+
..reads('.1')
569+
..resolvesOther('a.1')
570+
..writes('.2');
571+
});
572+
573+
test('a.2 is built', () async {
574+
expect(await tester.build(), Result(written: ['a.2']));
575+
});
576+
577+
test('no-op rebuild succeeds', () async {
578+
await tester.build();
579+
expect(await tester.build(), Result());
580+
});
581+
});
560582
}

0 commit comments

Comments
 (0)