d2c63991ae
The goal of this change is to make it possible to start iterating on nnbd tests
for DDC. This keeps the current philosophy of keeping NNBD and non-NNBD build
configurations separate, except that NNBD builds are allowed to consume library
sources from the non-nnbd sdk.
This change addresses the first set of errors that are encountered when trying
to build a fully NNBD configuration:
* CFE has issues with type promotion, for that reason we remove
`--enable-experiment=non-nullable` in vm build rules, and we use a smaller
training data when creating the dartdevc app-jit snapshot.
* We'd hit compile-time errors with nnbd libraries with inconsistent
patchfiles. To avoid that, the libarries.json points to the non-nnbd SDK
sources for most dart:* libraries.
Change-Id: Ie6226b3bd8a92b4a1632dd84a5db2f04238fd4f8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/125080
Commit-Queue: Sigmund Cherem <sigmund@google.com>
Reviewed-by: Bob Nystrom <rnystrom@google.com>
33 lines
1.1 KiB
Dart
33 lines
1.1 KiB
Dart
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
|
|
// for details. All rights reserved. Use of this source code is governed by a
|
|
// BSD-style license that can be found in the LICENSE file.
|
|
|
|
import 'dart:io';
|
|
|
|
import 'package:expect/expect.dart';
|
|
import 'package:path/path.dart' as p;
|
|
import 'package:source_maps/source_maps.dart' as sm;
|
|
|
|
void main() async {
|
|
final binDir = p.dirname(Platform.resolvedExecutable);
|
|
final sdkDir = p.dirname(binDir);
|
|
// This test expects to run in a build SDK.
|
|
Expect.isTrue(binDir.endsWith('bin'));
|
|
|
|
final sdkJsMapDir =
|
|
p.joinAll([sdkDir, 'lib', 'dev_compiler', 'kernel', 'amd']);
|
|
final sdkJsMapFile = p.join(sdkJsMapDir, 'dart_sdk.js.map');
|
|
|
|
final sdkJsMapText = await File(sdkJsMapFile).readAsString();
|
|
var mapping = sm.parse(sdkJsMapText) as sm.SingleMapping;
|
|
|
|
var urls = mapping.urls;
|
|
Expect.isTrue(urls.isNotEmpty);
|
|
for (var url in urls) {
|
|
Expect.equals(p.extension(url), '.dart');
|
|
Expect.isFalse(p.isAbsolute(url));
|
|
var fullPath = p.canonicalize(p.join(sdkJsMapDir, url));
|
|
Expect.isTrue(await File(fullPath).exists(), "Missing file: $fullPath");
|
|
}
|
|
}
|