Skip to content

Commit ea9656b

Browse files
rmacnak-googleCommit Queue
authored and
Commit Queue
committed
[test] XCode's nm not available on shards that haven't yet run main task.
Change-Id: Ib438cac3acf1842afb4d55a203d1f7a0c91f5918 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/325451 Commit-Queue: Tess Strickland <[email protected]> Reviewed-by: Alexander Thomas <[email protected]>
1 parent 781a8ef commit ea9656b

File tree

2 files changed

+31
-7
lines changed

2 files changed

+31
-7
lines changed

runtime/tests/vm/dart/exported_symbols_test.dart

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,26 @@ main() {
1111
if (Platform.isWindows) return;
1212
if (Platform.isAndroid) return; // no nm available on test device
1313

14-
var result = Process.runSync("nm", [
14+
var nm;
15+
for (var path in [
16+
"buildtools/linux-arm64/clang/bin/llvm-nm",
17+
"buildtools/linux-x64/clang/bin/llvm-nm",
18+
"buildtools/mac-arm64/clang/bin/llvm-nm",
19+
"buildtools/mac-x64/clang/bin/llvm-nm",
20+
]) {
21+
if (new File(path).existsSync()) {
22+
nm = path;
23+
break;
24+
}
25+
}
26+
if (nm == null) {
27+
throw "Could not find nm";
28+
}
29+
30+
var result = Process.runSync(nm, [
1531
Platform.isMacOS ? "--extern-only" : "--dynamic",
1632
"--defined-only",
17-
"--format=posix",
33+
"--format=just-symbols",
1834
Platform.executable
1935
]);
2036
if (result.exitCode != 0) {
@@ -25,11 +41,9 @@ main() {
2541
}
2642

2743
var symbols = result.stdout.split("\n")..remove("");
28-
for (var i = 0; i < symbols.length; i++) {
29-
// Get just the symbol name. Old nm on bots doesn't have --just-symbols.
30-
symbols[i] = symbols[i].split(" ")[0];
31-
if (Platform.isMacOS) {
32-
// Remove leading underscores.
44+
if (Platform.isMacOS) {
45+
// Remove leading underscores.
46+
for (var i = 0; i < symbols.length; i++) {
3347
symbols[i] = symbols[i].substring(1);
3448
}
3549
}

tools/bots/test_matrix.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,20 @@
224224
"pkg/",
225225
"samples/",
226226
"tools/",
227+
"buildtools/linux-arm64/clang/bin/llvm",
228+
"buildtools/linux-arm64/clang/bin/llvm-nm",
229+
"buildtools/linux-arm64/clang/bin/llvm-strip",
230+
"buildtools/linux-arm64/clang/bin/llvm-symbolizer",
227231
"buildtools/linux-x64/clang/bin/llvm",
232+
"buildtools/linux-x64/clang/bin/llvm-nm",
228233
"buildtools/linux-x64/clang/bin/llvm-strip",
229234
"buildtools/linux-x64/clang/bin/llvm-symbolizer",
235+
"buildtools/mac-arm64/clang/bin/llvm",
236+
"buildtools/mac-arm64/clang/bin/llvm-nm",
237+
"buildtools/mac-arm64/clang/bin/llvm-strip",
238+
"buildtools/mac-arm64/clang/bin/llvm-symbolizer",
230239
"buildtools/mac-x64/clang/bin/llvm",
240+
"buildtools/mac-x64/clang/bin/llvm-nm",
231241
"buildtools/mac-x64/clang/bin/llvm-strip",
232242
"buildtools/mac-x64/clang/bin/llvm-symbolizer",
233243
"buildtools/win-x64/clang/bin/llvm-symbolizer.exe",

0 commit comments

Comments
 (0)