build: add windows ubsan and clang ci (#4138)
Fixes a detected error: incompatible pointer to integer conversion passing 'uv_os_fd_t' (aka 'void *') to parameter of type 'SOCKET' (aka 'unsigned long long'). Use upstream llvm to work-around broken VS2022 clang unable to link.
This commit is contained in:
parent
77991a0761
commit
93efccf4ee
4
.github/workflows/CI-win.yml
vendored
4
.github/workflows/CI-win.yml
vendored
@ -26,6 +26,7 @@ jobs:
|
|||||||
- {toolchain: Visual Studio 17 2022, arch: Win32, server: 2022}
|
- {toolchain: Visual Studio 17 2022, arch: Win32, server: 2022}
|
||||||
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022}
|
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022}
|
||||||
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, config: ASAN}
|
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, config: ASAN}
|
||||||
|
- {toolchain: Visual Studio 17 2022, arch: x64, server: 2022, config: UBSAN}
|
||||||
- {toolchain: Visual Studio 17 2022, arch: arm64, server: 2022}
|
- {toolchain: Visual Studio 17 2022, arch: arm64, server: 2022}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
@ -36,7 +37,8 @@ jobs:
|
|||||||
run:
|
run:
|
||||||
cmake -S . -B build -DBUILD_TESTING=ON
|
cmake -S . -B build -DBUILD_TESTING=ON
|
||||||
-G "${{ matrix.config.toolchain }}" -A ${{ matrix.config.arch }}
|
-G "${{ matrix.config.toolchain }}" -A ${{ matrix.config.arch }}
|
||||||
${{ matrix.config.config == 'ASAN' && '-DASAN=on -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded' || '' }}
|
${{ matrix.config.config == 'ASAN' && '-DASAN=on -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded' ||
|
||||||
|
matrix.config.config == 'UBSAN' && '-DUBSAN=on' || '' }}
|
||||||
|
|
||||||
cmake --build build --config RelWithDebInfo
|
cmake --build build --config RelWithDebInfo
|
||||||
|
|
||||||
|
|||||||
26
.github/workflows/sanitizer.yml
vendored
26
.github/workflows/sanitizer.yml
vendored
@ -95,3 +95,29 @@ jobs:
|
|||||||
- name: UBSAN Test
|
- name: UBSAN Test
|
||||||
run: |
|
run: |
|
||||||
./build-ubsan/uv_run_tests_a
|
./build-ubsan/uv_run_tests_a
|
||||||
|
|
||||||
|
sanitizers-windows:
|
||||||
|
runs-on: windows-2022
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Setup
|
||||||
|
run: |
|
||||||
|
choco install ninja
|
||||||
|
|
||||||
|
# Note: clang shipped with VS2022 has an issue where the UBSAN runtime doesn't link.
|
||||||
|
- name: Install LLVM and Clang
|
||||||
|
uses: KyleMayes/install-llvm-action@v1
|
||||||
|
with:
|
||||||
|
version: "17"
|
||||||
|
|
||||||
|
- name: Envinfo
|
||||||
|
run: npx envinfo
|
||||||
|
|
||||||
|
- name: UBSAN Build
|
||||||
|
run: |
|
||||||
|
mkdir build-ubsan
|
||||||
|
cmake -B build-ubsan -G Ninja -DBUILD_TESTING=ON -DUBSAN=ON -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_COMPILER=clang
|
||||||
|
cmake --build build-ubsan
|
||||||
|
- name: UBSAN Test
|
||||||
|
run: |
|
||||||
|
./build-ubsan/uv_run_tests_a
|
||||||
|
|||||||
@ -81,7 +81,7 @@ static void do_close(uv_tcp_t* handle) {
|
|||||||
ASSERT_OK(r);
|
ASSERT_OK(r);
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
ASSERT_PTR_NE(fd, INVALID_FD);
|
ASSERT_PTR_NE(fd, INVALID_FD);
|
||||||
ASSERT_OK(shutdown(fd, SD_BOTH));
|
ASSERT_OK(shutdown((SOCKET)fd, SD_BOTH));
|
||||||
#else
|
#else
|
||||||
ASSERT_NE(fd, INVALID_FD);
|
ASSERT_NE(fd, INVALID_FD);
|
||||||
ASSERT_OK(shutdown(fd, SHUT_RDWR));
|
ASSERT_OK(shutdown(fd, SHUT_RDWR));
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user