@@ -1225,6 +1225,93 @@ jobs:
12251225 symbolsFolder : ${{ github.workspace }}/BinaryCache/1
12261226 searchPattern : ' **/*.exe'
12271227
1228+ sanitizers :
1229+ # TODO: Build this on macOS or make an equivalent Mac-only job
1230+ if : inputs.build_os == 'Windows'
1231+ runs-on : ${{ inputs.default_build_runner }}
1232+ needs : [compilers]
1233+
1234+ strategy :
1235+ fail-fast : false
1236+ matrix : ${{ fromJSON(inputs.target_matrix) }}
1237+
1238+ name : ${{ matrix.os }} ${{ matrix.arch }} Sanitizers
1239+
1240+ steps :
1241+ - name : Download Compilers
1242+ uses : thebrowsercompany/gha-download-tar-artifact@59992d91335d4ecba543c8535f7d07238e42125d # main
1243+ with :
1244+ name : compilers-Windows-${{ inputs.build_arch }}
1245+ path : ${{ github.workspace }}/BinaryCache/Library
1246+
1247+ - uses : actions/checkout@v4
1248+ with :
1249+ repository : swiftlang/llvm-project
1250+ ref : ${{ inputs.llvm_project_revision }}
1251+ path : ${{ github.workspace }}/SourceCache/llvm-project
1252+ show-progress : false
1253+
1254+ - uses : nttld/setup-ndk@v1
1255+ if : matrix.os == 'Android' && inputs.build_android
1256+ id : setup-ndk
1257+ with :
1258+ ndk-version : ${{ inputs.ANDROID_NDK_VERSION }}
1259+
1260+ - name : Compute workspace hash
1261+ id : workspace_hash
1262+ shell : pwsh
1263+ run : |
1264+ $stringAsStream = [System.IO.MemoryStream]::new()
1265+ $writer = [System.IO.StreamWriter]::new($stringAsStream)
1266+ $writer.write("${{ github.workspace }}")
1267+ $writer.Flush()
1268+ $stringAsStream.Position = 0
1269+ $hash = (Get-FileHash -Algorithm SHA256 -InputStream $stringAsStream).Hash
1270+ echo "hash=$hash" >> $env:GITHUB_OUTPUT
1271+
1272+ - name : Setup sccache
1273+ uses : hendrikmuhs/ccache-action@2e0e89e8d74340a03f75d58d02aae4c5ee1b15c6
1274+ with :
1275+ max-size : 500M
1276+ key : ${{ steps.workspace_hash.outputs.hash }}-${{ matrix.os }}-${{ matrix.arch }}-sanitizers
1277+ variant : sccache
1278+
1279+ - uses : seanmiddleditch/gha-setup-ninja@96bed6edff20d1dd61ecff9b75cc519d516e6401 # master
1280+
1281+ - name : Configure Sanitizers
1282+ run : |
1283+ cmake -B "${{ github.workspace }}/BinaryCache/${{ matrix.os }}-${{ matrix.arch }}-sanitzers" `
1284+ -D CMAKE_BUILD_TYPE=Release `
1285+ -D CMAKE_ASM_COMPILER="${{ github.workspace }}/BinaryCache/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr/bin/clang${{ matrix.exe_suffix }}" `
1286+ -D CMAKE_ASM_COMPILER_LAUNCHER=sccache `
1287+ -D CMAKE_C_COMPILER="${{ matrix.cc }}" `
1288+ -D CMAKE_C_COMPILER_LAUNCHER=sccache `
1289+ -D CMAKE_C_FLAGS="${{ matrix.cflags }}" `
1290+ -D CMAKE_CXX_COMPILER="${{ matrix.cxx }}" `
1291+ -D CMAKE_CXX_COMPILER_LAUNCHER=sccache `
1292+ -D CMAKE_CXX_FLAGS="${{ matrix.cxxflags }}" `
1293+ -D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/Developer/Toolchains/unknown-Asserts-development.xctoolchain/usr `
1294+ -D CMAKE_SYSTEM_NAME=${{ matrix.os }} `
1295+ -G Ninja `
1296+ -S ${{ github.workspace }}/SourceCache/llvm-project/compiler-rt `
1297+ -D COMPILER_RT_DEFAULT_TARGET_ONLY=YES `
1298+ -D COMPILER_RT_BUILD_BUILTINS=NO `
1299+ -D COMPILER_RT_BUILD_CRT=NO `
1300+ -D COMPILER_RT_BUILD_LIBFUZZER=NO `
1301+ -D COMPILER_RT_BUILD_ORC=NO `
1302+ -D COMPILER_RT_BUILD_PROFILE=YES `
1303+ -D COMPILER_RT_BUILD_SANITIZERS=YES `
1304+ -D COMPILER_RT_BUILD_XRAY=NO
1305+ - name : Build Sanitizers
1306+ run : cmake --build ${{ github.workspace }}/BinaryCache/${{ matrix.os }}-${{ matrix.arch }}-sanitzers
1307+ - name : Install Sanitizers
1308+ run : cmake --build ${{ github.workspace }}/BinaryCache/${{ matrix.os }}-${{ matrix.arch }}-sanitzers --target install-compiler-rt-stripped
1309+
1310+ - uses : thebrowsercompany/gha-upload-tar-artifact@e18c33b1cd416d0d96a91dc6dce06219f98e4e27 # main
1311+ with :
1312+ name : sanitizers-${{ matrix.os }}-${{ matrix.arch }}
1313+ path : ${{ github.workspace }}/BuildRoot/Library
1314+
12281315 zlib :
12291316 runs-on : ${{ inputs.default_build_runner }}
12301317
@@ -1695,6 +1782,7 @@ jobs:
16951782 with :
16961783 name : compilers-Windows-${{ inputs.build_arch }}
16971784 path : ${{ github.workspace }}/BinaryCache/Library
1785+
16981786 - uses : actions/checkout@v4
16991787 with :
17001788 repository : swiftlang/llvm-project
0 commit comments