Skip to content

Commit 0c55c7e

Browse files
fishythefishCommit Queue
authored andcommitted
Remove unsound web configurations from test matrix.
This CL also removes references to unsound .dill files from the test matrix and other build scripts and disables some of the option handling that would lead to requiring unsound .dill files. Change-Id: I89f701f8f5e1168bf974b5b44bfbafd5a39954fb Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/412401 Reviewed-by: Nate Biggs <[email protected]> Reviewed-by: Nicholas Shahan <[email protected]> Reviewed-by: Alexander Thomas <[email protected]> Commit-Queue: Mayank Patke <[email protected]>
1 parent 86f4b57 commit 0c55c7e

File tree

12 files changed

+41
-702
lines changed

12 files changed

+41
-702
lines changed

BUILD.gn

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ group("tools") {
206206
group("dart2js_bot") {
207207
deps = [
208208
":create_sdk",
209-
"utils/compiler:compile_dart2js_platform_unsound",
209+
"utils/compiler:compile_dart2js_platform",
210210
]
211211
}
212212

pkg/compiler/test/end_to_end/output_type_test.dart

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ Future<Null> test(
5757
}) async {
5858
List<String> options =
5959
List<String>.from(arguments)
60-
// TODO(nshahan) Should change to sdkPlatformBinariesPath when testing
61-
// with unsound null safety is no longer needed.
62-
..add('--platform-binaries=$buildPlatformBinariesPath')
60+
..add('--platform-binaries=$sdkPlatformBinariesPath')
6361
..add('--libraries-spec=$sdkLibrariesSpecificationUri');
6462
print('--------------------------------------------------------------------');
6563
print('dart2js ${options.join(' ')}');
@@ -112,7 +110,6 @@ main() {
112110
'pkg/compiler/test/deferred/data/deferred_helper.dart',
113111
'--out=custom.js',
114112
'--deferred-map=def/deferred.json',
115-
'--no-sound-null-safety',
116113
'--no-csp',
117114
'--stage=dump-info-all',
118115
],
@@ -140,7 +137,6 @@ main() {
140137

141138
await test([
142139
'pkg/compiler/test/deferred/data/deferred_helper.dart',
143-
'--no-sound-null-safety',
144140
'--csp',
145141
...additionOptionals,
146142
], expectedOutput);
@@ -150,7 +146,6 @@ main() {
150146
await test(
151147
[
152148
'pkg/compiler/test/deferred/data/deferred_helper.dart',
153-
'--no-sound-null-safety',
154149
'--csp',
155150
Flags.writeResources,
156151
...additionOptionals,

pkg/compiler/test/serialization/on_disk_split_test.dart

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ import 'package:expect/async_helper.dart';
77
import 'package:compiler/src/commandline_options.dart';
88
import 'package:compiler/src/dart2js.dart';
99
import 'package:compiler/src/util/memory_compiler.dart';
10-
import 'package:front_end/src/api_unstable/dart2js.dart'
11-
show computePlatformBinariesLocation;
1210

1311
main(List<String> args) {
1412
asyncTest(() async {
@@ -17,15 +15,9 @@ main(List<String> args) {
1715
Uri closedWorldUri = dir.uri.resolve('world.data');
1816
Uri globalInferenceUri = dir.uri.resolve('global.data');
1917
Uri outUri = dir.uri.resolve('out.js');
20-
String buildRoot =
21-
computePlatformBinariesLocation(forceBuildDir: true).toFilePath();
2218
var commonArgs = [
2319
Flags.verbose,
2420
'--libraries-spec=$sdkLibrariesSpecificationUri',
25-
'--no-sound-null-safety',
26-
// Unsound platform dill files are no longer packaged in the SDK and must
27-
// be read from the build directory during tests.
28-
'--platform-binaries=$buildRoot',
2921
'${Flags.closedWorldUri}=$closedWorldUri',
3022
'${Flags.globalInferenceUri}=$globalInferenceUri',
3123
];

pkg/dev_compiler/tool/ddb

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -138,12 +138,11 @@ void main(List<String> args) async {
138138
var compile = mode == 'compile' || mode == 'all';
139139
var run = mode == 'run' || mode == 'all';
140140
var verbose = options['verbose'] as bool;
141-
var soundNullSafety = options['sound-null-safety'] as bool;
142141
var emitDebugSymbols = options['emit-debug-symbols'] as bool;
143142
var nonNullAsserts = options['null-assertions'] as bool;
144143
var nativeNonNullAsserts = options.wasParsed('native-null-assertions')
145144
? options['native-null-assertions'] as bool
146-
: soundNullSafety;
145+
: true;
147146
var jsInteropNonNullAsserts = options['interop-null-assertions'] as bool;
148147
var weakNullSafetyErrors = options['weak-null-safety-errors'] as bool;
149148
var ddcModules = options['ddc-modules'] as bool;
@@ -260,12 +259,8 @@ void main(List<String> args) async {
260259
var sdkRoot = p.dirname(p.dirname(ddcPath));
261260
var buildDir = resolveBuildDir(sdkRoot, arch);
262261
var requirePath = p.join(sdkRoot, 'third_party', 'requirejs');
263-
var sdkOutlineDill = p.join(buildDir,
264-
soundNullSafety ? 'ddc_outline.dill' : 'ddc_outline_unsound.dill');
265-
var compileModeDir = [
266-
canaryFeatures ? 'canary' : 'stable',
267-
soundNullSafety ? '' : '_unsound',
268-
].join();
262+
var sdkOutlineDill = p.join(buildDir, 'ddc_outline.dill');
263+
var compileModeDir = canaryFeatures ? 'canary' : 'stable';
269264
var sdkJsPath =
270265
p.join(buildDir, 'gen', 'utils', 'ddc', compileModeDir, 'sdk', mod);
271266
var preamblesDir = p.join(
@@ -283,7 +278,7 @@ void main(List<String> args) async {
283278
'--dart-sdk-summary=$sdkOutlineDill',
284279
for (var summary in summaries) '--summary=$summary',
285280
for (var experiment in experiments) '--enable-experiment=$experiment',
286-
if (soundNullSafety) '--sound-null-safety' else '--no-sound-null-safety',
281+
'--sound-null-safety',
287282
if (options['packages'] != null) '--packages=${options['packages']}',
288283
if (emitDebugSymbols) '--emit-debug-symbols',
289284
if (canaryFeatures) '--canary',
@@ -314,15 +309,13 @@ void main(List<String> args) async {
314309
if (run) {
315310
var ddcModuleSdkOptions = canaryFeatures
316311
? '''let sdkOptions = {
317-
weakNullSafetyWarnings: !($weakNullSafetyErrors || $soundNullSafety),
318312
weakNullSafetyErrors: $weakNullSafetyErrors,
319313
nonNullAsserts: $nonNullAsserts,
320314
nativeNonNullAsserts: $nativeNonNullAsserts,
321315
jsInteropNonNullAsserts: $jsInteropNonNullAsserts,
322316
};'''
323317
: '''
324318
let sdk = dart_library.import("dart_sdk", "$appname");
325-
sdk.dart.weakNullSafetyWarnings(!($weakNullSafetyErrors || $soundNullSafety));
326319
sdk.dart.weakNullSafetyErrors($weakNullSafetyErrors);
327320
sdk.dart.nonNullAsserts($nonNullAsserts);
328321
sdk.dart.nativeNonNullAsserts($nativeNonNullAsserts);
@@ -368,8 +361,6 @@ sdk.dart.jsInteropNonNullAsserts($jsInteropNonNullAsserts);
368361
function(sdk, app) {
369362
'use strict';
370363
371-
sdk.dart.weakNullSafetyWarnings(
372-
!($weakNullSafetyErrors || $soundNullSafety));
373364
sdk.dart.weakNullSafetyErrors($weakNullSafetyErrors);
374365
sdk.dart.nonNullAsserts($nonNullAsserts);
375366
sdk.dart.nativeNonNullAsserts($nativeNonNullAsserts);
@@ -424,8 +415,6 @@ let sdk = require(\"dart_sdk\");
424415
sdk.dart.global.self = sdk.dart.global;
425416
let main = require(\"./$basename\").$libname.main;
426417
try {
427-
sdk.dart.weakNullSafetyWarnings(
428-
!($weakNullSafetyErrors || $soundNullSafety));
429418
sdk.dart.weakNullSafetyErrors($weakNullSafetyErrors);
430419
sdk.dart.nonNullAsserts($nonNullAsserts);
431420
sdk.dart.nativeNonNullAsserts($nativeNonNullAsserts);

pkg/frontend_server/test/frontend_server_test.dart

Lines changed: 1 addition & 210 deletions
Original file line numberDiff line numberDiff line change
@@ -567,8 +567,6 @@ Future<void> main() async {
567567
computePlatformBinariesLocation().resolve('vm_platform_strong.dill');
568568
final Uri ddcPlatformKernel =
569569
computePlatformBinariesLocation().resolve('ddc_outline.dill');
570-
final Uri ddcPlatformKernelWeak =
571-
computePlatformBinariesLocation().resolve('ddc_outline_unsound.dill');
572570
final Uri sdkRoot = computePlatformBinariesLocation();
573571

574572
late Directory tempDir;
@@ -2078,52 +2076,7 @@ void main(List<String> arguments, SendPort sendPort) {
20782076
final List<String> args = <String>[
20792077
'--sdk-root=${sdkRoot.toFilePath()}',
20802078
'--incremental',
2081-
'--platform=${ddcPlatformKernelWeak.path}',
2082-
'--output-dill=${dillFile.path}',
2083-
'--target=dartdevc',
2084-
'--dartdevc-module-format=$moduleFormat',
2085-
if (canary) '--dartdevc-canary',
2086-
'--packages=${packages.path}',
2087-
'package:hello/foo.dart'
2088-
];
2089-
2090-
expect(await starter(args), 0);
2091-
}
2092-
2093-
test('AMD module format', () async {
2094-
await runTests(moduleFormat: 'amd');
2095-
});
2096-
2097-
test('DDC module format and canary', () async {
2098-
await runTests(moduleFormat: 'ddc', canary: true);
2099-
});
2100-
}, skip: 'https://github.com/dart-lang/sdk/issues/43959');
2101-
2102-
group('compile to JavaScript weak null safety', () {
2103-
Future<void> runTests(
2104-
{required String moduleFormat, bool canary = false}) async {
2105-
File file = new File('${tempDir.path}/foo.dart')..createSync();
2106-
file.writeAsStringSync("main() {\n}\n");
2107-
File packages =
2108-
new File('${tempDir.path}/.dart_tool/package_config.json')
2109-
..createSync()
2110-
..writeAsStringSync(jsonEncode({
2111-
"configVersion": 2,
2112-
"packages": [
2113-
{
2114-
"name": "hello",
2115-
"rootUri": "${tempDir.uri}",
2116-
},
2117-
],
2118-
}));
2119-
File dillFile = new File('${tempDir.path}/app.dill');
2120-
2121-
expect(dillFile.existsSync(), false);
2122-
2123-
final List<String> args = <String>[
2124-
'--sdk-root=${sdkRoot.toFilePath()}',
2125-
'--incremental',
2126-
'--platform=${ddcPlatformKernelWeak.path}',
2079+
'--platform=${ddcPlatformKernel.path}',
21272080
'--output-dill=${dillFile.path}',
21282081
'--target=dartdevc',
21292082
'--dartdevc-module-format=$moduleFormat',
@@ -2144,77 +2097,6 @@ void main(List<String> arguments, SendPort sendPort) {
21442097
});
21452098
}, skip: 'https://github.com/dart-lang/sdk/issues/43959');
21462099

2147-
group('compile to JavaScript weak null safety then nonexistent file', () {
2148-
Future<void> runTests(
2149-
{required String moduleFormat, bool canary = false}) async {
2150-
File file = new File('${tempDir.path}/foo.dart')..createSync();
2151-
file.writeAsStringSync("main() {\n}\n");
2152-
File packages =
2153-
new File('${tempDir.path}/.dart_tool/package_config.json')
2154-
..createSync()
2155-
..writeAsStringSync(jsonEncode({
2156-
"configVersion": 2,
2157-
"packages": [
2158-
{
2159-
"name": "hello",
2160-
"rootUri": "${tempDir.uri}",
2161-
},
2162-
],
2163-
}));
2164-
File dillFile = new File('${tempDir.path}/app.dill');
2165-
2166-
expect(dillFile.existsSync(), false);
2167-
2168-
String library = 'package:hello/foo.dart';
2169-
2170-
final List<String> args = <String>[
2171-
'--sdk-root=${sdkRoot.toFilePath()}',
2172-
'--incremental',
2173-
'--platform=${ddcPlatformKernelWeak.path}',
2174-
'--output-dill=${dillFile.path}',
2175-
'--target=dartdevc',
2176-
'--dartdevc-module-format=$moduleFormat',
2177-
if (canary) '--dartdevc-canary',
2178-
'--packages=${packages.path}',
2179-
];
2180-
2181-
FrontendServer frontendServer = new FrontendServer();
2182-
Future<int> result = frontendServer.open(args);
2183-
frontendServer.compile(library);
2184-
int count = 0;
2185-
frontendServer.listen((Result compiledResult) {
2186-
CompilationResult result =
2187-
new CompilationResult.parse(compiledResult.status);
2188-
count++;
2189-
if (count == 1) {
2190-
// First request is to 'compile', which results in full JavaScript
2191-
expect(result.errorsCount, equals(0));
2192-
expect(result.filename, dillFile.path);
2193-
frontendServer.accept();
2194-
frontendServer.compile('foo.bar');
2195-
} else {
2196-
expect(count, 2);
2197-
// Second request is to 'compile' nonexistent file, that should
2198-
// fail.
2199-
expect(result.errorsCount, greaterThan(0));
2200-
frontendServer.quit();
2201-
}
2202-
});
2203-
2204-
expect(await result, 0);
2205-
expect(count, 2);
2206-
frontendServer.close();
2207-
}
2208-
2209-
test('AMD module format', () async {
2210-
await runTests(moduleFormat: 'amd');
2211-
});
2212-
2213-
test('DDC module format and canary', () async {
2214-
await runTests(moduleFormat: 'ddc', canary: true);
2215-
});
2216-
}, skip: 'https://github.com/dart-lang/sdk/issues/43959');
2217-
22182100
group('compile to JavaScript with no metadata', () {
22192101
Future<void> runTests(
22202102
{required String moduleFormat, bool canary = false}) async {
@@ -2719,97 +2601,6 @@ e() {
27192601
});
27202602
});
27212603

2722-
group('compile to JavaScript all library bundles with unsound null safety',
2723-
() {
2724-
Future<void> runTests(
2725-
{required String moduleFormat, bool canary = false}) async {
2726-
File file = new File('${tempDir.path}/foo.dart')..createSync();
2727-
file.writeAsStringSync("import 'bar.dart'; "
2728-
"typedef myType = void Function(int); main() { fn is myType; }\n");
2729-
file = new File('${tempDir.path}/bar.dart')..createSync();
2730-
file.writeAsStringSync("void Function(int) fn = (int i) => null;\n");
2731-
String library = 'package:hello/foo.dart';
2732-
2733-
File dillFile = new File('${tempDir.path}/app.dill');
2734-
File sourceFile = new File('${dillFile.path}.sources');
2735-
2736-
File packageConfig =
2737-
new File('${tempDir.path}/.dart_tool/package_config.json')
2738-
..createSync(recursive: true)
2739-
..writeAsStringSync('''
2740-
{
2741-
"configVersion": 2,
2742-
"packages": [
2743-
{
2744-
"name": "hello",
2745-
"rootUri": "../",
2746-
"packageUri": "./",
2747-
"languageVersion": "2.9"
2748-
}
2749-
]
2750-
}
2751-
''');
2752-
2753-
final List<String> args = <String>[
2754-
'--verbose',
2755-
'--no-sound-null-safety',
2756-
'--sdk-root=${sdkRoot.toFilePath()}',
2757-
'--incremental',
2758-
'--platform=${ddcPlatformKernelWeak.path}',
2759-
'--output-dill=${dillFile.path}',
2760-
'--target=dartdevc',
2761-
'--dartdevc-module-format=$moduleFormat',
2762-
if (canary) '--dartdevc-canary',
2763-
'--packages=${packageConfig.path}'
2764-
];
2765-
2766-
FrontendServer frontendServer = new FrontendServer();
2767-
Future<int> result = frontendServer.open(args);
2768-
frontendServer.compile(library);
2769-
int count = 0;
2770-
Completer<bool> expectationCompleter = new Completer<bool>();
2771-
frontendServer.listen((Result compiledResult) {
2772-
CompilationResult result =
2773-
new CompilationResult.parse(compiledResult.status);
2774-
count++;
2775-
// Request to 'compile', which results in full JavaScript and no
2776-
// metadata.
2777-
expect(result.errorsCount, equals(0));
2778-
expect(sourceFile.existsSync(), equals(true));
2779-
expect(result.filename, dillFile.path);
2780-
2781-
String source = sourceFile.readAsStringSync();
2782-
// Split on the comment at the end of each library bundle.
2783-
List<String> jsLibraryBundles =
2784-
source.split(new RegExp("//# sourceMappingURL=.*.map"));
2785-
2786-
// Both library bundles should include the unsound null safety check.
2787-
expect(jsLibraryBundles[0],
2788-
contains('dart._checkModuleNullSafetyMode(false);'));
2789-
expect(jsLibraryBundles[1],
2790-
contains('dart._checkModuleNullSafetyMode(false);'));
2791-
frontendServer.accept();
2792-
frontendServer.quit();
2793-
expectationCompleter.complete(true);
2794-
});
2795-
2796-
await expectationCompleter.future;
2797-
expect(await result, 0);
2798-
expect(count, 1);
2799-
frontendServer.close();
2800-
}
2801-
2802-
test('AMD module format', () async {
2803-
await runTests(moduleFormat: 'amd');
2804-
});
2805-
2806-
test('DDC module format and canary', () async {
2807-
await runTests(moduleFormat: 'ddc', canary: true);
2808-
});
2809-
},
2810-
timeout: Timeout.none,
2811-
skip: 'https://github.com/dart-lang/sdk/issues/52775');
2812-
28132604
group('compile to JavaScript, all library bundles with sound null safety',
28142605
() {
28152606
Future<void> runTests(

pkg/kernel/test/dart_scope_calculator_test.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ void main() {
1717
// Patching is bad on outlines, see
1818
// https://github.com/dart-lang/sdk/issues/54117.
1919
if (dill.path.endsWith("_outline.dill")) return false;
20-
if (dill.path.endsWith("_outline_unsound.dill")) return false;
2120
if (dill.path.contains("/vm_outline_")) return false;
2221
return true;
2322
}).toList();

0 commit comments

Comments
 (0)