clang-tool-chain 1.1.6__py3-none-any.whl → 1.1.7__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- __version__ = "1.0.30"
1
+ __version__ = "1.1.7"
2
2
 
3
3
  # Re-export commonly used functions for convenient access
4
4
  from clang_tool_chain.env_utils import (
@@ -11,6 +11,7 @@ from clang_tool_chain.execution.sanitizer_env import (
11
11
  detect_sanitizers_from_flags,
12
12
  get_all_sanitizer_runtime_dlls,
13
13
  get_asan_runtime_dll,
14
+ get_default_asan_options,
14
15
  get_runtime_dll_paths,
15
16
  get_symbolizer_path,
16
17
  prepare_sanitizer_environment,
@@ -35,4 +36,5 @@ __all__ = [
35
36
  "detect_sanitizers_from_flags",
36
37
  "get_asan_runtime_dll",
37
38
  "get_all_sanitizer_runtime_dlls",
39
+ "get_default_asan_options",
38
40
  ]
@@ -1,3 +1,3 @@
1
1
  """Version information for clang-tool-chain."""
2
2
 
3
- __version__ = "1.1.6"
3
+ __version__ = "1.1.7"
@@ -30,11 +30,47 @@ logger = logging.getLogger(__name__)
30
30
  # Default options to inject for optimal stack traces
31
31
  # fast_unwind_on_malloc=0: Use slow but accurate unwinding (fixes <unknown module>)
32
32
  # symbolize=1: Enable symbolization for readable stack traces
33
- # detect_leaks=1: Enable leak detection (ASAN only)
34
- DEFAULT_ASAN_OPTIONS = "fast_unwind_on_malloc=0:symbolize=1:detect_leaks=1"
33
+ # detect_leaks=1: Enable leak detection (ASAN only, NOT on Windows - LSAN unsupported)
34
+ #
35
+ # LeakSanitizer (LSAN) is NOT supported on Windows. Only Linux, macOS, Android,
36
+ # Fuchsia, and NetBSD are supported. See: https://clang.llvm.org/docs/LeakSanitizer.html
37
+ #
38
+ # On Windows, setting detect_leaks=1 causes immediate failure with:
39
+ # "AddressSanitizer: detect_leaks is not supported on this platform."
40
+ _BASE_ASAN_OPTIONS = "fast_unwind_on_malloc=0:symbolize=1"
35
41
  DEFAULT_LSAN_OPTIONS = "fast_unwind_on_malloc=0:symbolize=1"
36
42
 
37
43
 
44
+ def get_default_asan_options() -> str:
45
+ """
46
+ Get platform-appropriate default ASAN options.
47
+
48
+ Returns options string with detect_leaks=1 only on platforms where
49
+ LeakSanitizer is supported (Linux, macOS). Windows does not support
50
+ LSAN, so detect_leaks is omitted to prevent runtime failures.
51
+
52
+ Returns:
53
+ ASAN options string appropriate for the current platform.
54
+
55
+ Example:
56
+ >>> get_default_asan_options() # On Linux/macOS
57
+ 'fast_unwind_on_malloc=0:symbolize=1:detect_leaks=1'
58
+ >>> get_default_asan_options() # On Windows
59
+ 'fast_unwind_on_malloc=0:symbolize=1'
60
+ """
61
+ if platform.system() == "Windows":
62
+ # LSAN (LeakSanitizer) is not supported on Windows
63
+ # See: https://clang.llvm.org/docs/LeakSanitizer.html
64
+ return _BASE_ASAN_OPTIONS
65
+ # Linux, macOS, and other platforms support LSAN
66
+ return f"{_BASE_ASAN_OPTIONS}:detect_leaks=1"
67
+
68
+
69
+ # For backward compatibility - this is now dynamically computed
70
+ # Code that imports DEFAULT_ASAN_OPTIONS directly will get the platform-appropriate value
71
+ DEFAULT_ASAN_OPTIONS = get_default_asan_options()
72
+
73
+
38
74
  def get_symbolizer_path() -> str | None:
39
75
  """
40
76
  Get the path to llvm-symbolizer from the clang-tool-chain installation.
@@ -425,8 +461,9 @@ def prepare_sanitizer_environment(
425
461
 
426
462
  # Inject ASAN_OPTIONS if ASAN is enabled and not already set by user
427
463
  if asan_enabled and "ASAN_OPTIONS" not in env:
428
- env["ASAN_OPTIONS"] = DEFAULT_ASAN_OPTIONS
429
- logger.info(f"Injecting ASAN_OPTIONS={DEFAULT_ASAN_OPTIONS}")
464
+ asan_options = get_default_asan_options()
465
+ env["ASAN_OPTIONS"] = asan_options
466
+ logger.info(f"Injecting ASAN_OPTIONS={asan_options}")
430
467
 
431
468
  # Inject LSAN_OPTIONS if LSAN is enabled and not already set by user
432
469
  if lsan_enabled and "LSAN_OPTIONS" not in env:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: clang-tool-chain
3
- Version: 1.1.6
3
+ Version: 1.1.7
4
4
  Summary: Clang Tool Chain - C/C++ compilation toolchain utilities
5
5
  Project-URL: Homepage, https://github.com/zackees/clang-tool-chain
6
6
  Project-URL: Repository, https://github.com/zackees/clang-tool-chain
@@ -1,5 +1,5 @@
1
- clang_tool_chain/__init__.py,sha256=TS-fHsqErYIes4VJyZExhRMQjveVv7i99T9JjHJPpas,1064
2
- clang_tool_chain/__version__.py,sha256=YTx56JW89_upt38FX8hlUWfRFbv_i6nx3Au3Ysdk01M,71
1
+ clang_tool_chain/__init__.py,sha256=Ac2qUqz9rzFHvXLkH6kqf63m-1JywYcJckKrbLft2ag,1125
2
+ clang_tool_chain/__version__.py,sha256=gVI5QWADLkUhsYHs8TuVovVei5SJ_bx5saZRIWgkOTU,71
3
3
  clang_tool_chain/archive.py,sha256=t3reh7cm5XP2rhTqfRIDAQZv5XQq7SsstyiROYg8wFA,27697
4
4
  clang_tool_chain/archive_cache.py,sha256=5ZmlwXIJZDcrDFkTbdgBQYN9sulGn0WyI6qwWqC4HEU,6806
5
5
  clang_tool_chain/checksums.py,sha256=KFXeAeDz5ZlcZVOxsHDpNDCrm9UDoJ8bMA4PeNhuzdA,9868
@@ -49,7 +49,7 @@ clang_tool_chain/execution/iwyu.py,sha256=bmP0d_PZObA1JfmFYp3qIOKCb7y32AWPm2_ReF
49
49
  clang_tool_chain/execution/lldb.py,sha256=VpxkWTPS6PsyskaKTALeziR5Z5NLwarW174Fm1SMX9k,20718
50
50
  clang_tool_chain/execution/nodejs_resolver.py,sha256=8QsJWvIfmt5mBDV7n0ypSjsPyXS-eZTizhBli937I-g,11172
51
51
  clang_tool_chain/execution/platform_executor.py,sha256=sF4GyW0ujy2EewG8y2Eo1gUWGzss5G5iIkv02w7-2_o,14362
52
- clang_tool_chain/execution/sanitizer_env.py,sha256=DgmSKOOGd0JxoKJfLkT9pDFXIfm4C6IWtECeeRGc838,19269
52
+ clang_tool_chain/execution/sanitizer_env.py,sha256=IHxmeAzbbdrIAz38c2U3erunTVjHjePx7BytVBzluB4,20766
53
53
  clang_tool_chain/installers/__init__.py,sha256=NAV5woPCEDKSbFr1UmfQsrg4Ua5UdghN4q7H3ymvRsg,279
54
54
  clang_tool_chain/installers/base.py,sha256=OS78bau9zoYPitmhla7pKsfCPEj-zLY0DkvVzjE31Tw,15437
55
55
  clang_tool_chain/installers/clang.py,sha256=rUtheVRF7mq_1YdmQ3XzIybrJqsHbm2Xf0cbhRbH7RQ,16994
@@ -71,8 +71,8 @@ clang_tool_chain/symbolizer/unwind_windows.h,sha256=XTWhJDv13AAMUPAzWCfRN7tO6EbN
71
71
  clang_tool_chain/testing/__init__.py,sha256=-sYqOOCuTV_u-MkmExrD4uKdTHG4RmMwR3D1kIG281Q,208
72
72
  clang_tool_chain/testing/diagnostic_runner.py,sha256=mnmFUEOQulY3-Ggu6hKVGZwjrKQNmV6kY80PRTUu2qU,5293
73
73
  clang_tool_chain/testing/diagnostic_tests.py,sha256=GmtKWrDcddZTpx9_yIKfhRAy6YOde8dj7SksCWVEME4,6019
74
- clang_tool_chain-1.1.6.dist-info/METADATA,sha256=fUCTpvTHpVserQz52zpkBTZVZD0KoZR-AMxA4r3vmhc,60267
75
- clang_tool_chain-1.1.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
76
- clang_tool_chain-1.1.6.dist-info/entry_points.txt,sha256=N0a0OVPkCFbf6BisRkHj-m2TcZ-f1mqxfXxAHQxfrQg,2800
77
- clang_tool_chain-1.1.6.dist-info/licenses/LICENSE,sha256=51FO1oc2pZbQNI0v0_THnznnZIF4iFgawG1xnQ58kKo,10997
78
- clang_tool_chain-1.1.6.dist-info/RECORD,,
74
+ clang_tool_chain-1.1.7.dist-info/METADATA,sha256=m33JQp6EzIWtJsAFjwat9lcI-kGIXmh902VQZ2IQwb8,60267
75
+ clang_tool_chain-1.1.7.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
76
+ clang_tool_chain-1.1.7.dist-info/entry_points.txt,sha256=N0a0OVPkCFbf6BisRkHj-m2TcZ-f1mqxfXxAHQxfrQg,2800
77
+ clang_tool_chain-1.1.7.dist-info/licenses/LICENSE,sha256=51FO1oc2pZbQNI0v0_THnznnZIF4iFgawG1xnQ58kKo,10997
78
+ clang_tool_chain-1.1.7.dist-info/RECORD,,