vscode-swift
vscode-swift copied to clipboard
Add options to enable thread/address sanitizer
Slightly more complex than just adding --sanitize=thread
to swift build command line. Need to set environment variable DYLD_INSERT_LIBRARIES to point to sanitizer library (on macOS) when running tests.
Not totally sure how to get path to sanitizer library. On macOS with Xcode 13 installed it is /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/13.0.0/lib/darwin/libclang_rt.tsan_osx_dynamic.dylib
Note: TSAN is not available on Windows, ASAN however is (though it may require some work in packaging to make easier to use). I think that the packaging stuff should be relatively easy to tackle when ready (i.e. the functionality is easy to use).
I have code for this but TestExplorer can get into a very bad situation where it leaves an SPM process running for ever. See https://bugs.swift.org/browse/SR-16079 so don't want to add this yet
#542