diff --git a/ci/builders/mac_unopt.json b/ci/builders/mac_unopt.json index 3f58ce3601e60..57c144478c952 100644 --- a/ci/builders/mac_unopt.json +++ b/ci/builders/mac_unopt.json @@ -514,6 +514,49 @@ } } }, + { + "cas_archive": false, + "drone_dimensions": + [ + "os=Mac-13|Mac-14", + "device_type=none", + "cpu=arm64" + ], + "gclient_variables": + { + "download_android_deps": false, + "use_rbe": true + }, + "gn": + [ + "--target-dir", + "ci/host_debug_unopt_arm64", + "--runtime-mode", + "debug", + "--unoptimized", + "--no-stripped", + "--no-lto", + "--xcode-symlinks", + "--asan", + "--rbe", + "--no-goma" + ], + "name": "ci/macos/host_debug_unopt_asan", + "description": "Builds impeller golden unit tests with asan enabled.", + "ninja": + { + "config": "ci/host_debug_unopt_arm64", + "targets": + [ "flutter/impeller/golden_tests:impeller_golden_tests"] + }, + "properties": + { + "$flutter/osx_sdk": + { + "sdk_version": "15a240d" + } + } + }, { "cas_archive": false, "drone_dimensions": diff --git a/impeller/compiler/BUILD.gn b/impeller/compiler/BUILD.gn index 5ea4c05b3e17e..86b3971f5673f 100644 --- a/impeller/compiler/BUILD.gn +++ b/impeller/compiler/BUILD.gn @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. +import("//build/toolchain/toolchain.gni") import("//flutter/impeller/tools/impeller.gni") import("//flutter/shell/version/version.gni") @@ -116,3 +117,20 @@ impeller_component("compiler_unittests") { "//flutter/testing:testing_lib", ] } + +copy("copy_asan_runtime_dylib") { + visibility = [ "*" ] + + if (host_cpu == "arm64") { + _libclang_base_path = + "$buildtools_path/mac-arm64/clang/lib/clang/18/lib/darwin/" + } else { + _libclang_base_path = + "$buildtools_path/mac-x64/clang/lib/clang/18/lib/darwin/" + } + + _dylib_name = "libclang_rt.asan_osx_dynamic.dylib" + + sources = [ "$_libclang_base_path/$_dylib_name" ] + outputs = [ "$root_out_dir/$_dylib_name" ] +} diff --git a/impeller/tools/shaders.gni b/impeller/tools/shaders.gni index 140b886552de4..90cbb98bf6a13 100644 --- a/impeller/tools/shaders.gni +++ b/impeller/tools/shaders.gni @@ -151,6 +151,11 @@ template("impeller_shaders") { group(target_name) { public_deps = [] + + if (is_asan && is_mac) { + public_deps += [ "//flutter/impeller/compiler:copy_asan_runtime_dylib" ] + } + if (impeller_enable_metal) { public_deps += [ ":$mtl_shaders" ] }