[Mlir-commits] [mlir] [MLIR, Python] Make it easy to run tests with ASan on mac (PR #115524)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Nov 8 10:04:28 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {darker}-->
:warning: Python code formatter, darker found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
darker --check --diff -r 231e03ba7e82896847dbc27d457dbb208f04699c...836b621fc04d16c2e8e56902fd9a657ed73525af mlir/test/get_darwin_real_python.py mlir/test/lit.cfg.py
``````````
</details>
<details>
<summary>
View the diff from darker here.
</summary>
``````````diff
--- lit.cfg.py 2024-11-08 17:56:10.000000 +0000
+++ lit.cfg.py 2024-11-08 18:04:01.131779 +0000
@@ -80,14 +80,11 @@
# Provide the path to asan runtime lib 'libclang_rt.asan_osx_dynamic.dylib' if
# available. This is darwin specific since it's currently only needed on darwin.
# Stolen from llvm/test/lit.cfg.py with a few modifications
def get_asan_rtlib():
- if (
- not "asan" in config.available_features
- or not "Darwin" in config.host_os
- ):
+ if not "asan" in config.available_features or not "Darwin" in config.host_os:
return ""
try:
import glob
except:
print("glob module not found, skipping get_asan_rtlib() lookup")
@@ -262,11 +259,13 @@
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
lit_config.note(
- "Using {} instead of {}".format(python_executable, config.python_executable)
+ "Using {} instead of {}".format(
+ python_executable, config.python_executable
+ )
)
asan_rtlib = get_asan_rtlib()
lit_config.note("Using ASan rtlib {}".format(asan_rtlib))
config.environment["DYLD_INSERT_LIBRARIES"] = asan_rtlib
``````````
</details>
https://github.com/llvm/llvm-project/pull/115524
More information about the Mlir-commits
mailing list