Skip to content

Commit d44457f

Browse files
committed
[Core Libraries] Eliminate the fork in the core libraries.
Move the nnbd core libraries from sdk_nnbd to sdk, and updates references in build files and elsewhere accordingly. Change-Id: I09760fe1e006657aacdfe80f3b22fdf6f7e30a9f Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/151121 Commit-Queue: Leaf Petersen <[email protected]> Reviewed-by: Bob Nystrom <[email protected]>
1 parent 29e93bc commit d44457f

File tree

785 files changed

+12350
-209620
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

785 files changed

+12350
-209620
lines changed

BUILD.gn

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,24 +80,12 @@ group("runtime_precompiled") {
8080
]
8181
}
8282

83-
if (dont_use_nnbd) {
84-
group("create_sdk") {
85-
public_deps = [ "sdk:create_sdk" ]
86-
}
87-
} else {
88-
group("create_sdk") {
89-
public_deps = [ "sdk_nnbd:create_sdk" ]
90-
}
83+
group("create_sdk") {
84+
public_deps = [ "sdk:create_sdk" ]
9185
}
9286

93-
if (dont_use_nnbd) {
94-
group("create_platform_sdk") {
95-
public_deps = [ "sdk:create_platform_sdk" ]
96-
}
97-
} else {
98-
group("create_platform_sdk") {
99-
public_deps = [ "sdk_nnbd:create_platform_sdk" ]
100-
}
87+
group("create_platform_sdk") {
88+
public_deps = [ "sdk:create_platform_sdk" ]
10189
}
10290

10391
group("dart2js") {

PRESUBMIT.py

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -19,49 +19,6 @@ def is_cpp_file(path):
1919
return path.endswith('.cc') or path.endswith('.h')
2020

2121

22-
def _CheckNnbdSdkSync(input_api, output_api):
23-
files = [git_file.LocalPath() for git_file in input_api.AffectedTextFiles()]
24-
unsynchronized_files = []
25-
for file in files:
26-
if file.startswith('sdk/'):
27-
nnbd_file = 'sdk_nnbd/' + file[4:]
28-
if not nnbd_file in files:
29-
unsynchronized_files.append(nnbd_file)
30-
if unsynchronized_files:
31-
return [
32-
output_api.PresubmitPromptWarning(
33-
'Changes were made to sdk/ that were not made to sdk_nnbd/\n'
34-
'Please update these files as well:\n'
35-
'\n'
36-
'%s' % ('\n'.join(unsynchronized_files)))
37-
]
38-
return []
39-
40-
41-
def _CheckSdkDdcRuntimeSync(input_api, output_api):
42-
files = [git_file.LocalPath() for git_file in input_api.AffectedTextFiles()]
43-
unsynchronized_files = []
44-
runtime_lib = 'lib/_internal/js_dev_runtime/private/ddc_runtime/'
45-
for nnbd_file in files:
46-
if nnbd_file.startswith('sdk_nnbd/' + runtime_lib):
47-
file = 'sdk/' + nnbd_file[9:]
48-
if not file in files:
49-
unsynchronized_files.append(file)
50-
if unsynchronized_files:
51-
return [
52-
output_api.PresubmitPromptWarning(
53-
'Changes were made to '
54-
'sdk_nnbd/lib/_internal/js_dev_runtime/private/ddc_runtime/ '
55-
'that were not made to '
56-
'sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/ '
57-
'Please copy those changes (without Null Safety syntax) to '
58-
'these files as well:\n'
59-
'\n'
60-
'%s' % ('\n'.join(unsynchronized_files)))
61-
]
62-
return []
63-
64-
6522
def _CheckNnbdTestSync(input_api, output_api):
6623
"""Make sure that any forked SDK tests are kept in sync. If a CL touches
6724
a test, the test's counterpart (if it exists at all) should be in the CL
@@ -369,8 +326,6 @@ def test_matrix_filter(affected_file):
369326

370327
def _CommonChecks(input_api, output_api):
371328
results = []
372-
results.extend(_CheckNnbdSdkSync(input_api, output_api))
373-
results.extend(_CheckSdkDdcRuntimeSync(input_api, output_api))
374329
results.extend(_CheckNnbdTestSync(input_api, output_api))
375330
results.extend(_CheckValidHostsInDEPS(input_api, output_api))
376331
results.extend(_CheckDartFormat(input_api, output_api))

WATCHLISTS

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828
'filepath': (
2929
'^pkg/compiler|'
3030
'^sdk/lib/_internal/js_runtime|'
31-
'^sdk_nnbd/lib/_internal/js_runtime|'
3231
'^tests/compiler/dart2js'
3332
)
3433
},
3534
'dartdevc': {
3635
'filepath': (
3736
'^pkg/dev_compiler|'
3837
'^sdk/lib/_internal/js_dev_runtime|'
39-
'^sdk_nnbd/lib/_internal/js_dev_runtime|'
4038
'^tests/compiler/dartdevc_native'
4139
)
4240
},

pkg/compiler/test/helpers/memory_compiler.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export 'diagnostic_helper.dart';
2929
bool isDart2jsNnbd =
3030
!Platform.environment['DART_CONFIGURATION'].endsWith('Legacy');
3131

32-
String sdkPath = isDart2jsNnbd ? 'sdk_nnbd/lib' : 'sdk/lib';
32+
String sdkPath = 'sdk/lib';
3333

3434
String sdkLibrariesSpecificationPath = '$sdkPath/libraries.json';
3535

pkg/compiler/tool/modular_test_suite.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,7 @@ class SourceToDillStep implements IOModularStep {
132132
return;
133133
}
134134
sources = ['dart:core'];
135-
extraArgs = [
136-
'--libraries-file',
137-
'$rootScheme:///sdk_nnbd/lib/libraries.json'
138-
];
135+
extraArgs = ['--libraries-file', '$rootScheme:///sdk/lib/libraries.json'];
139136
assert(transitiveDependencies.isEmpty);
140137
} else {
141138
sources = module.sources.map(sourceToImportUri).toList();
@@ -342,7 +339,7 @@ class RunD8 implements IOModularStep {
342339
if (_options.verbose) print("\nstep: d8 on $module");
343340
List<String> d8Args = [
344341
sdkRoot
345-
.resolve('sdk_nnbd/lib/_internal/js_runtime/lib/preambles/d8.js')
342+
.resolve('sdk/lib/_internal/js_runtime/lib/preambles/d8.js')
346343
.toFilePath(),
347344
root.resolveUri(toUri(module, jsId)).toFilePath(),
348345
];

pkg/dev_compiler/lib/src/compiler/shared_command.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -339,9 +339,7 @@ Map placeSourceMap(Map sourceMap, String sourceMapPath, String multiRootScheme,
339339
// TODO(sigmund): extract all source-map normalization outside ddc. This
340340
// custom logic is BUILD specific and could be shared with other tools
341341
// like dart2js.
342-
var shortPath = uri.path
343-
.replaceAll('/sdk/', '/dart-sdk/')
344-
.replaceAll('/sdk_nnbd/', '/dart-sdk/');
342+
var shortPath = uri.path.replaceAll('/sdk/', '/dart-sdk/');
345343
var multiRootPath = "${multiRootOutputPath ?? ''}$shortPath";
346344
multiRootPath = p.url.relative(multiRootPath, from: sourceMapDir);
347345
return multiRootPath;

pkg/dev_compiler/test/modular_suite.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class SourceToSummaryDillStep implements IOModularStep {
7777
sources = ['dart:core'];
7878
extraArgs = [
7979
'--libraries-file',
80-
'$rootScheme:///sdk_nnbd/lib/libraries.json',
80+
'$rootScheme:///sdk/lib/libraries.json',
8181
'--enable-experiment',
8282
'non-nullable',
8383
];
@@ -157,7 +157,7 @@ class DDCStep implements IOModularStep {
157157
extraArgs = [
158158
'--compile-sdk',
159159
'--libraries-file',
160-
'$rootScheme:///sdk_nnbd/lib/libraries.json',
160+
'$rootScheme:///sdk/lib/libraries.json',
161161
'--enable-experiment',
162162
'non-nullable',
163163
];

pkg/dev_compiler/test/modular_suite_nnbd.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ class SourceToSummaryDillStep implements IOModularStep {
7777
sources = ['dart:core'];
7878
extraArgs = [
7979
'--libraries-file',
80-
'$rootScheme:///sdk_nnbd/lib/libraries.json',
80+
'$rootScheme:///sdk/lib/libraries.json',
8181
];
8282
assert(transitiveDependencies.isEmpty);
8383
} else {
@@ -159,7 +159,7 @@ class DDCStep implements IOModularStep {
159159
extraArgs = [
160160
'--compile-sdk',
161161
'--libraries-file',
162-
'$rootScheme:///sdk_nnbd/lib/libraries.json',
162+
'$rootScheme:///sdk/lib/libraries.json',
163163
];
164164
assert(transitiveDependencies.isEmpty);
165165
} else {

pkg/dev_compiler/tool/check_nnbd_sdk.dart

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void main(List<String> argv) {
3737

3838
var librariesJson = args['libraries'] != null
3939
? resolveInputUri(args['libraries'] as String)
40-
: Platform.script.resolve('../../../sdk_nnbd/lib/libraries.json');
40+
: Platform.script.resolve('../../../sdk/lib/libraries.json');
4141
var target = args['target'] as String;
4242
patch.main([
4343
'--libraries',
@@ -115,8 +115,7 @@ main() {}
115115
var result = Process.runSync(dart.toFilePath(), [
116116
// The NNBD dart binaries / snapshots require this flag to be enabled at
117117
// VM level.
118-
if (analyzerSnapshot.contains('NNBD'))
119-
'--enable-experiment=non-nullable',
118+
if (analyzerSnapshot.contains('NNBD')) '--enable-experiment=non-nullable',
120119
analyzerSnapshot,
121120
'--dart-sdk=${sdkDir}',
122121
'--format',
@@ -198,7 +197,7 @@ main() {}
198197
final _parser = ArgParser()
199198
..addOption('libraries',
200199
help: 'Path to the nnbd libraries.json (defaults to the one under '
201-
'sdk_nnbd/lib/libraries.json.')
200+
'sdk/lib/libraries.json.')
202201
..addOption('out',
203202
help: 'Path to an output folder (defaults to a new tmp folder).')
204203
..addOption('target',

pkg/front_end/lib/src/api_prototype/experimental_flags.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ part 'experimental_flags_generated.dart';
99
/// The set of experiments enabled for SDK and packages.
1010
///
1111
/// This are derived from an `allowed_experiments.json` file whose default is
12-
/// located in `sdk_nnbd/lib/_internal/allowed_experiments.json`.
12+
/// located in `sdk/lib/_internal/allowed_experiments.json`.
1313
class AllowedExperimentalFlags {
1414
/// The set of experiments that are enabled for all SDK libraries other than
1515
/// for those which are specified in [sdkLibraryExperiments].

0 commit comments

Comments
 (0)