[Mlir-commits] [mlir] [MLIR, Python] Make it easy to run tests with ASan on mac (PR #115524)

Mehdi Amini llvmlistbot at llvm.org
Sun Nov 10 14:04:36 PST 2024


================
@@ -174,8 +252,25 @@ def add_runtime(name):
 python_executable = config.python_executable
 # Python configuration with sanitizer requires some magic preloading. This will only work on clang/linux.
 # TODO: detect Darwin/Windows situation (or mark these tests as unsupported on these platforms).
-if "asan" in config.available_features and "Linux" in config.host_os:
-    python_executable = f"LD_PRELOAD=$({config.host_cxx} -print-file-name=libclang_rt.asan-{config.host_arch}.so) {config.python_executable}"
+if "asan" in config.available_features:
+    if "Linux" in config.host_os:
+        python_executable = f"LD_PRELOAD=$({config.host_cxx} -print-file-name=libclang_rt.asan-{config.host_arch}.so) {config.python_executable}"
+    if "Darwin" in config.host_os:
+        real_python_executable = find_real_python_interpreter()
+        if real_python_executable:
+            python_executable = real_python_executable
+            # Ensure Python is not wrapped, for DYLD_INSERT_LIBRARIES to take effect
----------------
joker-eph wrote:

Is this comment in the right place? I'm not sure how it applies to the note.

https://github.com/llvm/llvm-project/pull/115524


More information about the Mlir-commits mailing list