Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop support for unsound null safety in Dart 3 #3424

Merged
merged 15 commits into from
Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 29 additions & 27 deletions .github/workflows/community.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,31 @@
name: Community tests
on:
pull_request:
env:
PUB_ENVIRONMENT: bot.github
# name: Community tests
# on:
# pull_request:
# env:
# PUB_ENVIRONMENT: bot.github

jobs:
drift:
# Tests maintained by oss@simonbinder.eu
name: "Tests for pkg:drift"
runs-on: ubuntu-latest
steps:
- uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
- run: dart pub get
working-directory: tool
# jobs:
# drift:
# # Tests maintained by oss@simonbinder.eu
# name: "Tests for pkg:drift"
# runs-on: ubuntu-latest
# steps:
# - uses: dart-lang/setup-dart@6a218f2413a3e78e9087f638a238f6b40893203d
# with:
# sdk: dev
# - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
# - run: dart pub get
# working-directory: tool

- uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
with:
repository: simolus3/moor
ref: latest-release
path: client_tests/drift
- run: |-
dart run tool/bin/patch_build_dependencies.dart client_tests/drift/drift
cd client_tests/drift/drift
git add pubspec.yaml
- run: dart test --preset build_community_tests
name: Drift community tests
working-directory: client_tests/drift/drift
# - uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8
# with:
# repository: simolus3/moor
# ref: latest-release
# path: client_tests/drift
# - run: |-
# dart run tool/bin/patch_build_dependencies.dart client_tests/drift/drift
# cd client_tests/drift/drift
# git add pubspec.yaml
# - run: dart test --preset build_community_tests
# name: Drift community tests
# working-directory: client_tests/drift/drift
2,111 changes: 570 additions & 1,541 deletions .github/workflows/dart.yml

Large diffs are not rendered by default.

4 changes: 0 additions & 4 deletions _test/build.dart2js.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,3 @@ targets:
- test/other_test.dart.browser_test.dart
- test/sub-dir/subdir_test.dart
- test/sub-dir/subdir_test.dart.browser_test.dart
build_vm_compilers:entrypoint:
generate_for:
- test/configurable_uri_test.dart.vm_test.dart
- test/help_test.dart.vm_test.dart
3 changes: 0 additions & 3 deletions _test/build.post_process.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ targets:
- test/other_test.dart.browser_test.dart
- test/sub-dir/subdir_test.dart
- test/sub-dir/subdir_test.dart.browser_test.dart
build_vm_compilers:entrypoint:
generate_for:
- test/help_test.dart.vm_test.dart
3 changes: 0 additions & 3 deletions _test/build.throws.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,3 @@ targets:
- test/other_test.dart.browser_test.dart
- test/sub-dir/subdir_test.dart
- test/sub-dir/subdir_test.dart.browser_test.dart
build_vm_compilers:entrypoint:
generate_for:
- test/help_test.dart.vm_test.dart
4 changes: 0 additions & 4 deletions _test/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,3 @@ targets:
- test/hello_world_custom_html_test.dart.browser_test.dart
- test/other_test.dart.browser_test.dart
- test/sub-dir/subdir_test.dart.browser_test.dart
build_vm_compilers:entrypoint:
generate_for:
- test/configurable_uri_test.dart.vm_test.dart
- test/help_test.dart.vm_test.dart
2 changes: 1 addition & 1 deletion _test/mono_pkg.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sdk:
- dev
- main

os:
- linux
Expand Down
3 changes: 0 additions & 3 deletions _test/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ dev_dependencies:
build: any
build_config: any
build_modules: any
build_vm_compilers: any
build_web_compilers: any
build_runner: any
build_runner_core: any
Expand Down Expand Up @@ -39,8 +38,6 @@ dependency_overrides:
path: ../build_runner_core
build_test:
path: ../build_test
build_vm_compilers:
path: ../build_vm_compilers
build_web_compilers:
path: ../build_web_compilers
scratch_space:
Expand Down
89 changes: 26 additions & 63 deletions _test/test/goldens/generated_build_script.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import 'package:build_test/builder.dart' as _i2;
import 'package:build_config/build_config.dart' as _i3;
import 'package:provides_builder/builders.dart' as _i4;
import 'package:build_modules/builders.dart' as _i5;
import 'package:build_vm_compilers/builders.dart' as _i6;
import 'package:build_web_compilers/builders.dart' as _i7;
import 'package:build/build.dart' as _i8;
import 'dart:isolate' as _i9;
import 'package:build_runner/build_runner.dart' as _i10;
import 'dart:io' as _i11;
import 'package:build_web_compilers/builders.dart' as _i6;
import 'package:build/build.dart' as _i7;
import 'dart:isolate' as _i8;
import 'package:build_runner/build_runner.dart' as _i9;
import 'dart:io' as _i10;

final _builders = <_i1.BuilderApplication>[
_i1.apply(
Expand Down Expand Up @@ -48,45 +47,12 @@ final _builders = <_i1.BuilderApplication>[
hideOutput: true,
appliesBuilders: const [r'build_modules:module_cleanup'],
),
_i1.apply(
r'build_vm_compilers:modules',
[
_i6.metaModuleBuilder,
_i6.metaModuleCleanBuilder,
_i6.moduleBuilder,
],
_i1.toNoneByDefault(),
isOptional: true,
hideOutput: true,
appliesBuilders: const [r'build_modules:module_cleanup'],
),
_i1.apply(
r'build_vm_compilers:vm',
[_i6.vmKernelModuleBuilder],
_i1.toAllPackages(),
isOptional: true,
hideOutput: true,
appliesBuilders: const [r'build_vm_compilers:modules'],
),
_i1.apply(
r'build_vm_compilers:entrypoint',
[_i6.vmKernelEntrypointBuilder],
_i1.toRoot(),
hideOutput: true,
defaultGenerateFor: const _i3.InputSet(include: [
r'bin/**',
r'tool/**',
r'test/**.dart.vm_test.dart',
r'example/**',
r'benchmark/**',
]),
),
_i1.apply(
r'build_web_compilers:dart2js_modules',
[
_i7.dart2jsMetaModuleBuilder,
_i7.dart2jsMetaModuleCleanBuilder,
_i7.dart2jsModuleBuilder,
_i6.dart2jsMetaModuleBuilder,
_i6.dart2jsMetaModuleCleanBuilder,
_i6.dart2jsModuleBuilder,
],
_i1.toNoneByDefault(),
isOptional: true,
Expand All @@ -96,9 +62,9 @@ final _builders = <_i1.BuilderApplication>[
_i1.apply(
r'build_web_compilers:ddc_modules',
[
_i7.ddcMetaModuleBuilder,
_i7.ddcMetaModuleCleanBuilder,
_i7.ddcModuleBuilder,
_i6.ddcMetaModuleBuilder,
_i6.ddcMetaModuleCleanBuilder,
_i6.ddcModuleBuilder,
],
_i1.toNoneByDefault(),
isOptional: true,
Expand All @@ -108,10 +74,8 @@ final _builders = <_i1.BuilderApplication>[
_i1.apply(
r'build_web_compilers:ddc',
[
_i7.ddcKernelBuilderUnsound,
_i7.ddcBuilderUnsound,
_i7.ddcKernelBuilderSound,
_i7.ddcBuilderSound,
_i6.ddcKernelBuilder,
_i6.ddcBuilder,
],
_i1.toAllPackages(),
isOptional: true,
Expand All @@ -125,17 +89,16 @@ final _builders = <_i1.BuilderApplication>[
_i1.apply(
r'build_web_compilers:sdk_js',
[
_i7.sdkJsCompileUnsound,
_i7.sdkJsCompileSound,
_i7.sdkJsCopyRequirejs,
_i6.sdkJsCompile,
_i6.sdkJsCopyRequirejs,
],
_i1.toNoneByDefault(),
isOptional: true,
hideOutput: true,
),
_i1.apply(
r'build_web_compilers:entrypoint',
[_i7.webEntrypointBuilder],
[_i6.webEntrypointBuilder],
_i1.toRoot(),
hideOutput: true,
defaultGenerateFor: const _i3.InputSet(
Expand All @@ -150,14 +113,14 @@ final _builders = <_i1.BuilderApplication>[
r'test/**.vm_test.dart',
],
),
defaultOptions: const _i8.BuilderOptions(<String, dynamic>{
defaultOptions: const _i7.BuilderOptions(<String, dynamic>{
r'dart2js_args': <dynamic>[r'--minify']
}),
defaultDevOptions: const _i8.BuilderOptions(<String, dynamic>{
defaultDevOptions: const _i7.BuilderOptions(<String, dynamic>{
r'dart2js_args': <dynamic>[r'--enable-asserts']
}),
defaultReleaseOptions:
const _i8.BuilderOptions(<String, dynamic>{r'compiler': r'dart2js'}),
const _i7.BuilderOptions(<String, dynamic>{r'compiler': r'dart2js'}),
appliesBuilders: const [r'build_web_compilers:dart2js_archive_extractor'],
),
_i1.apply(
Expand All @@ -172,15 +135,15 @@ final _builders = <_i1.BuilderApplication>[
),
_i1.applyPostProcess(
r'build_web_compilers:dart2js_archive_extractor',
_i7.dart2jsArchiveExtractor,
_i6.dart2jsArchiveExtractor,
defaultReleaseOptions:
const _i8.BuilderOptions(<String, dynamic>{r'filter_outputs': true}),
const _i7.BuilderOptions(<String, dynamic>{r'filter_outputs': true}),
),
_i1.applyPostProcess(
r'build_web_compilers:dart_source_cleanup',
_i7.dartSourceCleanup,
_i6.dartSourceCleanup,
defaultReleaseOptions:
const _i8.BuilderOptions(<String, dynamic>{r'enabled': true}),
const _i7.BuilderOptions(<String, dynamic>{r'enabled': true}),
),
_i1.applyPostProcess(
r'provides_builder:some_post_process_builder',
Expand All @@ -189,12 +152,12 @@ final _builders = <_i1.BuilderApplication>[
];
void main(
List<String> args, [
_i9.SendPort? sendPort,
_i8.SendPort? sendPort,
]) async {
var result = await _i10.run(
var result = await _i9.run(
args,
_builders,
);
sendPort?.send(result);
_i11.exitCode = result;
_i10.exitCode = result;
}
24 changes: 11 additions & 13 deletions _test/test/serve_integration_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ void main() {
});

test('Doesn\'t compile submodules into the root module', () {
expect(
readGeneratedFileAsString('_test/test/hello_world_test.sound.ddc.js'),
expect(readGeneratedFileAsString('_test/test/hello_world_test.ddc.js'),
isNot(contains('Hello World!')));
});

Expand All @@ -72,7 +71,7 @@ void main() {
test('ddc errors can be fixed', () async {
var path = p.join('test', 'common', 'message.dart');
var error = nextStdOutLine('Error compiling dartdevc module:'
'_test|test/common/message.sound.ddc.js');
'_test|test/common/message.ddc.js');
var nextBuild = nextFailedBuild;
await replaceAllInFile(path, "'Hello World!';", '1;');
await error;
Expand Down Expand Up @@ -165,8 +164,7 @@ void main() {
expect(badResponse.statusCode, HttpStatus.notFound);

var ddcFileResponse =
await (await httpClient.get('localhost', 8080, 'main.sound.ddc.js'))
.close();
await (await httpClient.get('localhost', 8080, 'main.ddc.js')).close();
expect(await utf8.decodeStream(ddcFileResponse), contains('"goodbye"'));
});

Expand Down Expand Up @@ -205,14 +203,14 @@ void main() {

const n = 1000;
var futures = [
for (var i = 0; i < n; i++) read('main.sound.ddc.js'),
for (var i = 0; i < n; i++) read('main.sound.ddc.js.map'),
for (var i = 0; i < n; i++) read('main.sound.ddc.dill'),
for (var i = 0; i < n; i++) read('main.sound.ddc.full.dill'),
for (var i = 0; i < n; i++) read('sub/message.sound.ddc.js'),
for (var i = 0; i < n; i++) read('sub/message.sound.ddc.js.map'),
for (var i = 0; i < n; i++) read('sub/message.sound.ddc.dill'),
for (var i = 0; i < n; i++) read('sub/message.sound.ddc.full.dill'),
for (var i = 0; i < n; i++) read('main.ddc.js'),
for (var i = 0; i < n; i++) read('main.ddc.js.map'),
for (var i = 0; i < n; i++) read('main.ddc.dill'),
for (var i = 0; i < n; i++) read('main.ddc.full.dill'),
for (var i = 0; i < n; i++) read('sub/message.ddc.js'),
for (var i = 0; i < n; i++) read('sub/message.ddc.js.map'),
for (var i = 0; i < n; i++) read('sub/message.ddc.dill'),
for (var i = 0; i < n; i++) read('sub/message.ddc.full.dill'),
];
await Future.wait(futures);
});
Expand Down
27 changes: 0 additions & 27 deletions _test_null_safety/LICENSE

This file was deleted.

1 change: 0 additions & 1 deletion _test_null_safety/analysis_options.yaml

This file was deleted.

Loading