Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 481bdbc

Browse files
author
Dart CI
committed
Version 2.15.0-12.0.dev
Merge commit 'eae58445e904440ff3fcb2a12d2905990d66bbf4' into 'dev'
2 parents eb7661b + eae5844 commit 481bdbc

File tree

15 files changed

+110
-96
lines changed

15 files changed

+110
-96
lines changed

.dart_tool/package_config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"constraint, update this by running tools/generate_package_config.dart."
1212
],
1313
"configVersion": 2,
14-
"generated": "2021-08-10T10:51:47.272341",
14+
"generated": "2021-08-12T14:38:50.585343",
1515
"generator": "tools/generate_package_config.dart",
1616
"packages": [
1717
{
@@ -617,7 +617,7 @@
617617
"name": "smith",
618618
"rootUri": "../pkg/smith",
619619
"packageUri": "lib/",
620-
"languageVersion": "2.3"
620+
"languageVersion": "2.12"
621621
},
622622
{
623623
"name": "source_map_stack_trace",

pkg/analysis_server/test/lsp/completion_yaml_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ dependencies:
524524
openCloseFile: false,
525525
);
526526

527-
// Also veryify the detail fields were populated as expected.
527+
// Also verify the detail fields were populated as expected.
528528
expect(
529529
completionResults.singleWhere((c) => c.label == '^2.3.4').detail,
530530
equals('latest compatible'),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
analyzer:
22
errors:
33
import_internal_library: ignore
4+
export_internal_library: ignore
45
strong-mode:
56
implicit-casts: false

pkg/smith/lib/builder.dart

Lines changed: 29 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ class Step {
2121
final String script;
2222
final List<String> arguments;
2323
final Map<String, String> environment;
24-
final String fileSet;
25-
final int shards;
24+
final String? fileSet;
25+
final int? shards;
2626
final bool isTestRunner;
27-
final Configuration testedConfiguration;
27+
final Configuration? testedConfiguration;
2828

29-
Step(this.name, String script, this.arguments, this.environment, this.fileSet,
30-
this.shards, this.isTestRunner, this.testedConfiguration)
29+
Step(this.name, String? script, this.arguments, this.environment,
30+
this.fileSet, this.shards, this.isTestRunner, this.testedConfiguration)
3131
: script = script ?? testScriptName;
3232

3333
static const testScriptName = "tools/test.py";
@@ -36,14 +36,14 @@ class Step {
3636

3737
/// Create a [Step] from the 'step template' [map], values for supported
3838
/// variables [configuration], and the list of supported named configurations.
39-
static Step parse(Map map, Map<String, String> configuration,
39+
static Step parse(Map map, Map<String, String?> configuration,
4040
List<Configuration> configurations) {
41-
var arguments = (map["arguments"] as List ?? [])
41+
var arguments = (map["arguments"] as List? ?? [])
4242
.map((argument) => _expandVariables(argument as String, configuration))
4343
.toList();
4444
var testedConfigurations = <Configuration>[];
45-
var script = map["script"] as String ?? testScriptName;
46-
var isTestRunner = map["testRunner"] as bool ?? false;
45+
var script = map["script"] as String? ?? testScriptName;
46+
var isTestRunner = map["testRunner"] as bool? ?? false;
4747
if (script == testScriptName || isTestRunner) {
4848
// TODO(karlklose): replace with argument parser that can handle all
4949
// arguments to test.py.
@@ -78,8 +78,8 @@ class Step {
7878
script,
7979
arguments,
8080
<String, String>{...?map["environment"]},
81-
map["fileset"] as String,
82-
map["shards"] as int,
81+
map["fileset"] as String?,
82+
map["shards"] as int?,
8383
isTestRunner,
8484
testedConfigurations.isEmpty ? null : testedConfigurations.single);
8585
}
@@ -92,13 +92,13 @@ class Step {
9292
/// the test matrix.
9393
class Builder {
9494
final String name;
95-
final String description;
95+
final String? description;
9696
final List<Step> steps;
97-
final System system;
98-
final Mode mode;
99-
final Architecture arch;
100-
final Sanitizer sanitizer;
101-
final Runtime runtime;
97+
final System? system;
98+
final Mode? mode;
99+
final Architecture? arch;
100+
final Sanitizer? sanitizer;
101+
final Runtime? runtime;
102102
final Set<Configuration> testedConfigurations;
103103

104104
Builder(this.name, this.description, this.steps, this.system, this.mode,
@@ -111,7 +111,7 @@ class Builder {
111111
/// `${arch}`, and `${runtime}. The values for these variables are inferred
112112
/// from the builder's name.
113113
static Builder parse(String builderName, List<Map> steps,
114-
List<Configuration> configurations, String description) {
114+
List<Configuration> configurations, String? description) {
115115
var builderParts = builderName.split("-");
116116
var systemName = _findPart(builderParts, System.names, 'linux');
117117
var modeName = _findPart(builderParts, Mode.names, 'release');
@@ -146,7 +146,7 @@ class Builder {
146146

147147
/// Tries to replace a variable named [variableName] with [value] and throws
148148
/// and exception if the variable is used but `value == null`.
149-
String _tryReplace(String string, String variableName, String value) {
149+
String _tryReplace(String string, String variableName, String? value) {
150150
var variable = "\${$variableName}";
151151
if (string.contains(variable)) {
152152
if (value == null) {
@@ -160,7 +160,7 @@ String _tryReplace(String string, String variableName, String value) {
160160

161161
/// Replace the use of supported variable names with the their value given
162162
/// in [values] and throws an exception if an unsupported variable name is used.
163-
String _expandVariables(String string, Map<String, String> values) {
163+
String _expandVariables(String string, Map<String, String?> values) {
164164
for (var variable in ["system", "mode", "arch", "sanitizer", "runtime"]) {
165165
string = _tryReplace(string, variable, values[variable]);
166166
}
@@ -171,33 +171,35 @@ Set<Configuration> _getTestedConfigurations(List<Step> steps) {
171171
return steps
172172
.where((step) => step.isTestStep)
173173
.map((step) => step.testedConfiguration)
174+
.whereType<Configuration>()
174175
.toSet();
175176
}
176177

177-
T _findIfNotNull<T>(T Function(String) find, String name) {
178+
T? _findIfNotNull<T>(T Function(String) find, String? name) {
178179
return name != null ? find(name) : null;
179180
}
180181

181-
String _findPart(List<String> builderParts, List<String> parts,
182-
[String fallback]) {
183-
return builderParts.firstWhere((part) => parts.contains(part),
184-
orElse: () => fallback);
182+
String? _findPart(List<String> builderParts, List<String> parts,
183+
[String? fallback]) {
184+
return builderParts
185+
.cast<String?>()
186+
.firstWhere((part) => parts.contains(part), orElse: () => fallback);
185187
}
186188

187189
List<Builder> parseBuilders(
188190
List<Map> builderConfigurations, List<Configuration> configurations) {
189191
var builders = <Builder>[];
190192
var names = <String>{};
191193
for (var builderConfiguration in builderConfigurations) {
192-
var meta = builderConfiguration["meta"] as Map ?? <String, String>{};
194+
var meta = builderConfiguration["meta"] as Map? ?? <String, String>{};
193195
var builderNames = <String>[...?builderConfiguration["builders"]];
194196
var steps = <Map>[...?builderConfiguration["steps"]];
195197
for (var builderName in builderNames) {
196198
if (!names.add(builderName)) {
197199
throw FormatException('Duplicate builder name: "$builderName"');
198200
}
199201
builders.add(Builder.parse(
200-
builderName, steps, configurations, meta["description"] as String));
202+
builderName, steps, configurations, meta["description"] as String?));
201203
}
202204
}
203205
return builders;

pkg/smith/lib/configuration.dart

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ class Configuration {
117117
var words = name.split("-").toSet();
118118
var optionsCopy = Map.of(optionsJson);
119119

120-
T enumOption<T extends NamedEnum>(
120+
T? enumOption<T extends NamedEnum>(
121121
String option, List<String> allowed, T Function(String) parse) {
122122
// Look up the value from the words in the name.
123-
T fromName;
123+
T? fromName;
124124
for (var value in allowed) {
125125
// Don't treat "none" as matchable since it's ambiguous as to whether
126126
// it refers to compiler or runtime.
@@ -137,7 +137,7 @@ class Configuration {
137137
}
138138

139139
// Look up the value from the options.
140-
T fromOption;
140+
T? fromOption;
141141
if (optionsCopy.containsKey(option)) {
142142
fromOption = parse(optionsCopy[option] as String);
143143
optionsCopy.remove(option);
@@ -157,7 +157,7 @@ class Configuration {
157157
return fromName ?? fromOption;
158158
}
159159

160-
bool boolOption(String option) {
160+
bool? boolOption(String option) {
161161
if (!optionsCopy.containsKey(option)) return null;
162162

163163
var value = optionsCopy.remove(option);
@@ -166,10 +166,10 @@ class Configuration {
166166
throw FormatException('Option "$option" had value "$value", which is '
167167
'not a bool.');
168168
}
169-
return value as bool;
169+
return value;
170170
}
171171

172-
int intOption(String option) {
172+
int? intOption(String option) {
173173
if (!optionsCopy.containsKey(option)) return null;
174174

175175
var value = optionsCopy.remove(option);
@@ -178,10 +178,10 @@ class Configuration {
178178
throw FormatException('Option "$option" had value "$value", which is '
179179
'not an int.');
180180
}
181-
return value as int;
181+
return value;
182182
}
183183

184-
String stringOption(String option) {
184+
String? stringOption(String option) {
185185
if (!optionsCopy.containsKey(option)) return null;
186186

187187
var value = optionsCopy.remove(option);
@@ -190,10 +190,10 @@ class Configuration {
190190
throw FormatException('Option "$option" had value "$value", which is '
191191
'not a string.');
192192
}
193-
return value as String;
193+
return value;
194194
}
195195

196-
List<String> stringListOption(String option) {
196+
List<String>? stringListOption(String option) {
197197
if (!optionsCopy.containsKey(option)) return null;
198198

199199
var value = optionsCopy.remove(option);
@@ -202,7 +202,7 @@ class Configuration {
202202
throw FormatException('Option "$option" had value "$value", which is '
203203
'not a List.');
204204
}
205-
return List<String>.from(value as List);
205+
return List<String>.from(value);
206206
}
207207

208208
// Extract options from the name and map.
@@ -340,27 +340,27 @@ class Configuration {
340340

341341
Configuration(this.name, this.architecture, this.compiler, this.mode,
342342
this.runtime, this.system,
343-
{NnbdMode nnbdMode,
344-
Sanitizer sanitizer,
345-
String babel,
346-
String builderTag,
347-
List<String> genKernelOptions,
348-
List<String> vmOptions,
349-
List<String> dart2jsOptions,
350-
List<String> experiments,
351-
int timeout,
352-
bool enableAsserts,
353-
bool isChecked,
354-
bool isCsp,
355-
bool isHostChecked,
356-
bool isMinified,
357-
bool useAnalyzerCfe,
358-
bool useAnalyzerFastaParser,
359-
bool useElf,
360-
bool useHotReload,
361-
bool useHotReloadRollback,
362-
bool useSdk,
363-
bool useQemu})
343+
{NnbdMode? nnbdMode,
344+
Sanitizer? sanitizer,
345+
String? babel,
346+
String? builderTag,
347+
List<String>? genKernelOptions,
348+
List<String>? vmOptions,
349+
List<String>? dart2jsOptions,
350+
List<String>? experiments,
351+
int? timeout,
352+
bool? enableAsserts,
353+
bool? isChecked,
354+
bool? isCsp,
355+
bool? isHostChecked,
356+
bool? isMinified,
357+
bool? useAnalyzerCfe,
358+
bool? useAnalyzerFastaParser,
359+
bool? useElf,
360+
bool? useHotReload,
361+
bool? useHotReloadRollback,
362+
bool? useSdk,
363+
bool? useQemu})
364364
: nnbdMode = nnbdMode ?? NnbdMode.legacy,
365365
sanitizer = sanitizer ?? Sanitizer.none,
366366
babel = babel ?? "",

pkg/smith/lib/test_matrix.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class TestMatrix {
2222

2323
static TestMatrix fromJson(Map<String, dynamic> json) {
2424
var configurationsJson =
25-
json["configurations"] as Map<String, dynamic> ?? <String, dynamic>{};
25+
json["configurations"] as Map<String, dynamic>? ?? <String, dynamic>{};
2626

2727
// Keep track of the configurations and which templates they were expanded
2828
// from.
@@ -60,8 +60,8 @@ class TestMatrix {
6060
var testedOn = <Configuration, Builder>{};
6161
for (var builder in builders) {
6262
for (var configuration in builder.testedConfigurations) {
63-
if (testedOn.containsKey(configuration)) {
64-
var other = testedOn[configuration];
63+
var other = testedOn[configuration];
64+
if (other != null) {
6565
throw FormatException('Configuration "${configuration.name}" is '
6666
'tested on both "${builder.name}" and "${other.name}"');
6767
} else {

pkg/smith/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ description: Shared code for working with the Dart SDK's tests and test runner.
33
# This package is not intended for consumption on pub.dev. DO NOT publish.
44
publish_to: none
55
environment:
6-
sdk: "^2.3.0"
6+
sdk: "^2.12.0"
77
dev_dependencies:
88
expect:
99
path: ../expect

pkg/smith/test/builder_test.dart

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ void main() {
2929
"arguments": ["-nfoo-x64-none-debug-d8-linux"]
3030
}, {}, configurations);
3131
expect(step.isTestStep, isTrue);
32-
expect(step.testedConfiguration.name, "foo-x64-none-debug-d8-linux");
32+
expect(step.testedConfiguration?.name, "foo-x64-none-debug-d8-linux");
3333
});
3434
test("custom test runner step", () {
3535
var step = Step.parse({
@@ -39,15 +39,15 @@ void main() {
3939
"arguments": ["-nfoo-x64-none-debug-d8-linux"]
4040
}, {}, configurations);
4141
expect(step.isTestStep, isTrue);
42-
expect(step.testedConfiguration.name, "foo-x64-none-debug-d8-linux");
42+
expect(step.testedConfiguration?.name, "foo-x64-none-debug-d8-linux");
4343
});
4444
test("implicit test step", () {
4545
var step = Step.parse({
4646
"name": "foo",
4747
"arguments": ["-nfoo-x64-none-debug-d8-linux"]
4848
}, {}, configurations);
4949
expect(step.isTestStep, isTrue);
50-
expect(step.testedConfiguration.name, "foo-x64-none-debug-d8-linux");
50+
expect(step.testedConfiguration?.name, "foo-x64-none-debug-d8-linux");
5151
});
5252
test("a step can only test one configuration", () {
5353
expectFormatError(
@@ -69,7 +69,7 @@ void main() {
6969
"arguments": ["--named_configuration foo-x64-none-debug-d8-linux"]
7070
}, {}, configurations);
7171
expect(step.isTestStep, isTrue);
72-
expect(step.testedConfiguration.name, "foo-x64-none-debug-d8-linux");
72+
expect(step.testedConfiguration?.name, "foo-x64-none-debug-d8-linux");
7373
});
7474
test("a test step using multiple values for the argument", () {
7575
expectFormatError(
@@ -89,7 +89,7 @@ void main() {
8989
"arguments": ["-nfoo-x64-none-debug-d8-linux", "--bar", "-b=az"]
9090
}, {}, configurations);
9191
expect(step.isTestStep, isTrue);
92-
expect(step.testedConfiguration.name, "foo-x64-none-debug-d8-linux");
92+
expect(step.testedConfiguration?.name, "foo-x64-none-debug-d8-linux");
9393
});
9494
test("in non-test steps, argument -n can have arbitrary values", () {
9595
var step = Step.parse({
@@ -229,6 +229,6 @@ void expectTestedConfigurations(
229229
var step = builder.steps[0];
230230
expect(step.isTestStep, isTrue);
231231
}
232-
expect(builders.map((b) => b.steps[0].testedConfiguration.name).toList(),
232+
expect(builders.map((b) => b.steps[0].testedConfiguration!.name).toList(),
233233
equals(expectedConfigurations));
234234
}

runtime/bin/eventhandler.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ enum MessageFlags {
3232
kSetEventMaskCommand = 12,
3333
kListeningSocket = 16,
3434
kPipe = 17,
35+
kSignalSocket = 18,
3536
};
3637

3738
// clang-format off
@@ -54,6 +55,8 @@ enum MessageFlags {
5455
(data & ~(1 << kInEvent | 1 << kOutEvent | 1 << kCloseEvent)) == 0)
5556
#define IS_LISTENING_SOCKET(data) \
5657
((data & (1 << kListeningSocket)) != 0) // NOLINT
58+
#define IS_SIGNAL_SOCKET(data) \
59+
((data & (1 << kSignalSocket)) != 0) // NOLINT
5760
#define TOKEN_COUNT(data) (data & ((1 << kCloseCommand) - 1))
5861
// clang-format on
5962

0 commit comments

Comments
 (0)