@@ -98,7 +98,9 @@ def generate_name(compiler_family, entry):
9898 macos_ver = runner .replace ("macos-" , "macOS " )
9999 modifiers .append (macos_ver )
100100
101- if entry .get ("asan" ) and entry .get ("ubsan" ):
101+ if entry .get ("tsan" ):
102+ modifiers .append ("tsan" )
103+ elif entry .get ("asan" ) and entry .get ("ubsan" ):
102104 modifiers .append ("asan+ubsan" )
103105 elif entry .get ("asan" ):
104106 modifiers .append ("asan" )
@@ -139,6 +141,20 @@ def generate_sanitizer_variant(compiler_family, spec):
139141 return make_entry (compiler_family , spec , ** overrides )
140142
141143
144+ def generate_tsan_variant (compiler_family , spec ):
145+ """Generate TSan variant for the latest compiler in a family (Linux only)."""
146+ overrides = {
147+ "tsan" : True ,
148+ "build-type" : "RelWithDebInfo" ,
149+ "shared" : True ,
150+ }
151+
152+ if compiler_family == "clang" :
153+ overrides ["shared" ] = False
154+
155+ return make_entry (compiler_family , spec , ** overrides )
156+
157+
142158def generate_coverage_variant (compiler_family , spec ):
143159 """Generate coverage variant (GCC only)."""
144160 return make_entry (compiler_family , spec , ** {
@@ -185,6 +201,10 @@ def main():
185201 if spec .get ("is_latest" ):
186202 matrix .append (generate_sanitizer_variant (family , spec ))
187203
204+ # TSan is incompatible with ASan; separate variant for Linux
205+ if family in ("gcc" , "clang" ):
206+ matrix .append (generate_tsan_variant (family , spec ))
207+
188208 if family == "gcc" :
189209 matrix .append (generate_coverage_variant (family , spec ))
190210
0 commit comments