Skip to content

Commit c9a64a4

Browse files
authored
Fix CI jobs (#3763)
This is an absolute mess now, our workspace is super fragmented at this point, but in general this: - Fixes new analyzer deprecations - Requires the new analyzer - Which requires a new SDK - Which requires moving more packages out of the workspace - Fixes the jobs that run against `main` by allowing 3.7.0 dev SDKs. These versions will be broken at some point because the DDC binary is going to move, so we are not allowing 3.7.0 stable.
1 parent 387401f commit c9a64a4

File tree

19 files changed

+372
-249
lines changed

19 files changed

+372
-249
lines changed

.github/workflows/dart.yml

Lines changed: 286 additions & 210 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

_test/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ publish_to: none
66
#resolution: workspace
77

88
environment:
9-
sdk: ^3.6.0-165.0.dev
9+
sdk: ^3.6.0-228.0.dev
1010

1111
dependencies:
1212
web: ^1.0.0

build/CHANGELOG.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
## 2.4.2-wip
22

3-
- Bump the min sdk to 3.5.0.
3+
- Bump the min sdk to 3.6.0-228.0.dev.
44
- Remove some unnecessary casts and non-null assertions now that we have private
55
field promotion.
6+
- Require analyzer ^6.9.0.
7+
- Fix analyzer deprecations.
68

79
## 2.4.1
810

build/pubspec.yaml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@ name: build
22
version: 2.4.2-wip
33
description: A package for authoring build_runner compatible code generators.
44
repository: https://github.com/dart-lang/build/tree/master/build
5-
resolution: workspace
5+
6+
# This package can't be part of the workspace because it requires a very recent
7+
# Dart SDK - see the top-level pubspec for details.
8+
#resolution: workspace
69

710
environment:
8-
sdk: ^3.5.0
11+
sdk: ^3.6.0-228.0.dev
912

1013
dependencies:
11-
analyzer: ">=1.5.0 <7.0.0"
14+
analyzer: ^6.9.0
1215
async: ^2.5.0
1316
convert: ^3.0.0
1417
crypto: ^3.0.0
@@ -21,6 +24,7 @@ dependencies:
2124
dev_dependencies:
2225
build_resolvers: ^2.4.0
2326
build_test: ^2.0.0
27+
dart_flutter_team_lints: ^3.1.0
2428
test: ^1.16.0
2529

2630
topics:

build/test/builder/build_step_impl_test.dart

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,15 @@ void main() {
128128

129129
var aLib = await resolver.libraryFor(primary);
130130
expect(aLib.name, 'a');
131-
expect(aLib.importedLibraries.length, 2);
132-
expect(aLib.importedLibraries.any((library) => library.name == 'b'),
131+
expect(aLib.definingCompilationUnit.libraryImports.length, 2);
132+
expect(
133+
aLib.definingCompilationUnit.libraryImports
134+
.any((import) => import.importedLibrary!.name == 'b'),
133135
isTrue);
134136

135137
var bLib = await resolver.findLibraryByName('b');
136138
expect(bLib!.name, 'b');
137-
expect(bLib.importedLibraries.length, 1);
139+
expect(bLib.definingCompilationUnit.libraryImports.length, 1);
138140

139141
await buildStep.complete();
140142
});

build/test/generate/run_builder_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ void main() {
8282
config.packages.singleWhere((p) => p.name == 'build');
8383
expect(buildPackage.root, Uri.parse('asset:build/'));
8484
expect(buildPackage.packageUriRoot, Uri.parse('asset:build/lib/'));
85-
expect(buildPackage.languageVersion, LanguageVersion(3, 5));
85+
expect(buildPackage.languageVersion, LanguageVersion(3, 6));
8686

8787
final resolvedBuildUri =
8888
config.resolve(Uri.parse('package:build/foo.txt'))!;
@@ -106,7 +106,7 @@ void main() {
106106
Package(
107107
'build',
108108
Uri.file('/foo/bar/'),
109-
languageVersion: LanguageVersion(3, 5),
109+
languageVersion: LanguageVersion(3, 6),
110110
),
111111
]),
112112
);

build_modules/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## 5.0.10-wip
22

33
- Bump the min sdk to 3.5.0.
4+
- Support 3.7.0 pre-release sdks.
45

56
## 5.0.9
67

build_modules/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository: https://github.com/dart-lang/build/tree/master/build_modules
77
resolution: workspace
88

99
environment:
10-
sdk: '>=3.5.0 <3.7.0'
10+
sdk: '>=3.5.0 <3.7.0-z'
1111

1212
dependencies:
1313
analyzer: '>=5.1.0 <7.0.0'

build_resolvers/CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
- Require the latest analyzer, and stop passing the `withNullability`
44
parameter which was previously required and is now deprecated.
5-
- Bump the min sdk to 3.5.0.
5+
- Bump the min sdk to 3.6.0-228.0.dev.
66
- Fix SDK summary reads when multiple isolates are using build resolvers (not
77
recommended).
8+
- Fix analyzer deprecations.
89

910
## 2.4.2
1011

build_resolvers/lib/src/resolver.dart

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,12 @@ class PerActionResolver implements ReleasableResolver {
6464
// `BuildStep.canRead`. They'd still be reachable by crawling the element
6565
// model manually.
6666
yield current;
67-
final toCrawl = current.importedLibraries
68-
.followedBy(current.exportedLibraries)
69-
.where((l) => !seen.contains(l))
67+
final toCrawl = current.definingCompilationUnit.libraryImports
68+
.map((import) => import.importedLibrary)
69+
.followedBy(current.definingCompilationUnit.libraryExports
70+
.map((export) => export.exportedLibrary))
71+
.nonNulls
72+
.where((library) => !seen.contains(library))
7073
.toSet();
7174
toVisit.addAll(toCrawl);
7275
seen.addAll(toCrawl);
@@ -279,7 +282,7 @@ class AnalyzerResolver implements ReleasableResolver {
279282
Future<List<ErrorsResult>> _syntacticErrorsFor(LibraryElement element) async {
280283
final existingSources = [element.source];
281284

282-
for (final part in element.parts) {
285+
for (final part in element.definingCompilationUnit.parts) {
283286
var uri = part.uri;
284287
// There may be no source if the part doesn't exist. That's not important
285288
// for us since we only care about existing file syntax.

0 commit comments

Comments
 (0)