From 201abb5cd1b400eeab6c3a98d350e45aa3e1abf2 Mon Sep 17 00:00:00 2001 From: Ryan Macnak Date: Mon, 1 Jun 2026 16:57:43 -0700 Subject: [PATCH] Reduce sanitizer build set. Change-Id: Idd5df6ff7c5b4f6bc3ccb0a335df0d332556d6ba Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/508420 Reviewed-by: Alexander Aprelev Commit-Queue: Ryan Macnak --- .../vm/dart/sanitizer_compatibility_test.dart | 112 ------------------ tools/bots/test_matrix.json | 1 - 2 files changed, 113 deletions(-) delete mode 100644 runtime/tests/vm/dart/sanitizer_compatibility_test.dart diff --git a/runtime/tests/vm/dart/sanitizer_compatibility_test.dart b/runtime/tests/vm/dart/sanitizer_compatibility_test.dart deleted file mode 100644 index 374a5454316..00000000000 --- a/runtime/tests/vm/dart/sanitizer_compatibility_test.dart +++ /dev/null @@ -1,112 +0,0 @@ -// Copyright (c) 2024, 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. - -// Check for a proper error when a snapshot and a runtime don't agree on which -// sanitizer they are using. - -import "dart:io"; - -import "package:expect/expect.dart"; - -import "use_flag_test_helper.dart"; - -String find(String haystack, List needles) { - for (String needle in needles) { - if (haystack.contains(needle)) { - return needle; - } - } - throw "None of ${needles.join(' ')}"; -} - -void checkExists(String path) { - if (!File(path).existsSync()) { - throw "$path does not exist"; - } -} - -main() async { - var sanitizer = find(Platform.executable, ["ASAN", "MSAN", "TSAN"]); - var mode = find(Platform.executable, ["Debug", "Release", "Product"]); - var arch = find(Platform.executable, ["X64", "ARM64", "RISCV64"]); - var out = find(Platform.executable, ["out", "xcodebuild"]); - var targetFlag = { - "ASAN": "--target_address_sanitizer", - "MSAN": "--target_memory_sanitizer", - "TSAN": "--target_thread_sanitizer", - }[sanitizer]!; - - var nonePlatform = "$out/$mode$arch/vm_platform.dill"; - var noneGenSnapshot = "$out/$mode$arch/gen_snapshot"; - var noneJitRuntime = "$out/$mode$arch/dart"; - var noneAotRuntime = "$out/$mode$arch/dartaotruntime"; - var sanitizerGenSnapshot = "$out/$mode$sanitizer$arch/gen_snapshot"; - var sanitizerAotRuntime = "$out/$mode$sanitizer$arch/dartaotruntime"; - - checkExists(noneGenSnapshot); - checkExists(noneJitRuntime); - checkExists(noneAotRuntime); - checkExists(sanitizerGenSnapshot); - checkExists(sanitizerAotRuntime); - - await withTempDir('sanitizer-compatibility-test', (String tempDir) async { - var aotDill = "$tempDir/aot.dill"; - var noneElf = "$tempDir/none.elf"; - var sanitizerElf = "$tempDir/$sanitizer.elf"; - var sanitizerElf2 = "$tempDir/${sanitizer}2.elf"; - - await run(noneJitRuntime, [ - "pkg/vm/bin/gen_kernel.dart", - "--platform", - nonePlatform, - "--aot", - "-o", - aotDill, - "tests/language/unsorted/first_test.dart", - ]); - - await run(noneGenSnapshot, [ - if (Platform.isMacOS) ...[ - "--snapshot-kind=app-aot-macho-dylib", - "--macho=$noneElf", - ] else ...[ - "--snapshot-kind=app-aot-elf", - "--elf=$noneElf", - ], - aotDill, - ]); - await run(sanitizerGenSnapshot, [ - if (Platform.isMacOS) ...[ - "--snapshot-kind=app-aot-macho-dylib", - "--macho=$sanitizerElf", - ] else ...[ - "--snapshot-kind=app-aot-elf", - "--elf=$sanitizerElf", - ], - aotDill, - ]); - await run(noneGenSnapshot, [ - if (Platform.isMacOS) ...[ - "--snapshot-kind=app-aot-macho-dylib", - "--macho=$sanitizerElf2", - ] else ...[ - "--snapshot-kind=app-aot-elf", - "--elf=$sanitizerElf2", - ], - targetFlag, - aotDill, - ]); - - await run(noneAotRuntime, [noneElf]); - await run(sanitizerAotRuntime, [sanitizerElf]); - await run(sanitizerAotRuntime, [sanitizerElf2]); - - var errorLines = await runError(noneAotRuntime, [sanitizerElf]); - Expect.contains("Snapshot not compatible", errorLines[0]); - errorLines = await runError(noneAotRuntime, [sanitizerElf2]); - Expect.contains("Snapshot not compatible", errorLines[0]); - errorLines = await runError(sanitizerAotRuntime, [noneElf]); - Expect.contains("Snapshot not compatible", errorLines[0]); - }); -} diff --git a/tools/bots/test_matrix.json b/tools/bots/test_matrix.json index f758368deb3..61eed0b6336 100644 --- a/tools/bots/test_matrix.json +++ b/tools/bots/test_matrix.json @@ -1525,7 +1525,6 @@ "name": "build dart", "script": "tools/build.py", "arguments": [ - "--sanitizer=none,${sanitizer}", "runtime", "runtime_precompiled" ]