Skip to content

Commit

Permalink
Add temporary mitigations for CI failures in windows-2022. (#5057)
Browse files Browse the repository at this point in the history
[SC-48975](https://app.shortcut.com/tiledb-inc/story/48975)

Visual Studio 2022 17.10 has been recently released and one of its
changes to MSVC is that the constructor of `std::mutex` became
`constexpr`. According to MSVC's binary compatibility guarantees, a
program must use a Visual C++ redistributable version at least as new as
the toolset that compiled the program. However, due to [a
defect](actions/runner-images#10004) on the
GitHub Actions `windows-2022` image, an old redistributable version was
picked, causing weird failures in CI.

This PR fixes these failures, by defining the
`_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR` symbol, which reverts the change
to `std::mutex`. Due to unexplained errors, I could not do that for the
standalone unit test workflow, and instead I changed that to use the
`windows-2019` image which does not exhibit this problem.

This PR should be reverted once the issue on GHA gets fixed.

---
TYPE: NO_HISTORY
  • Loading branch information
teo-tsirpanis authored Jun 10, 2024
1 parent f99c3f5 commit 3bb0699
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ jobs:
TILEDB_WEBP: ${{ matrix.TILEDB_WEBP }}
TILEDB_CMAKE_BUILD_TYPE: 'Release'
VCPKG_BINARY_SOURCES: 'clear;x-gha,readwrite'
CXXFLAGS: '/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR' # https://github.com/actions/runner-images/issues/10004
steps:
- name: 'tiledb env prep'
run: |
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/unit-test-runs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
# Temporarily reverting to windows-2019 until https://github.com/actions/runner-images/issues/10004 gets fixed.
os: [macos-latest, ubuntu-latest, windows-2019]
fail-fast: false
name: Build - ${{ matrix.os }}
timeout-minutes: 90
Expand Down Expand Up @@ -53,6 +54,11 @@ jobs:
shell: bash
if: ${{ !startsWith(matrix.os, 'windows-') }}

- name: 'Print env'
run: set
shell: cmd
if: ${{ startsWith(matrix.os, 'windows-') }}

- name: 'Build standalone unit tests'
run: |
cmake -S . \
Expand Down
4 changes: 4 additions & 0 deletions ports/triplets/x64-windows-asan.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)
# bigobj is needed for capnp.
set(VCPKG_C_FLAGS "/fsanitize=address /bigobj")
set(VCPKG_CXX_FLAGS "/fsanitize=address /bigobj")

# https://github.com/actions/runner-images/issues/10004
set(VCPKG_C_FLAGS "${VCPKG_C_FLAGS} /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
set(VCPKG_CXX_FLAGS "${VCPKG_CXX_FLAGS} /D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
4 changes: 4 additions & 0 deletions ports/triplets/x64-windows.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,8 @@ set(VCPKG_TARGET_ARCHITECTURE x64)
set(VCPKG_CRT_LINKAGE dynamic)
set(VCPKG_LIBRARY_LINKAGE static)

# https://github.com/actions/runner-images/issues/10004
set(VCPKG_C_FLAGS "/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")
set(VCPKG_CXX_FLAGS "/D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR")

set(X_VCPKG_APPLOCAL_DEPS_INSTALL ON)

0 comments on commit 3bb0699

Please sign in to comment.