From 818e8993655659b68fae1530275235d70f9fb2e7 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Thu, 14 Dec 2023 01:49:03 -0800 Subject: [PATCH] On Windows, use c++20 mode as correctly needed for designated initializers. Designated initializers is technically only supported starting with c++20, and the compiler on Windows points that out with an error. --- .bazelrc | 3 ++- .github/workflows/verible-ci.yml | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.bazelrc b/.bazelrc index c2a420aa0a..56bced8951 100644 --- a/.bazelrc +++ b/.bazelrc @@ -21,7 +21,8 @@ common:macos --features=-supports_dynamic_linker --linkopt=-framework --linkopt= # Force the use clang-cl on Windows instead of MSVC. MSVC has some issues with # the codebase, so we focus the effort for now is to have a Windows Verible # compiled with clang-cl before fixing the issues unique to MSVC. -common:windows --compiler=clang-cl --cxxopt=/std:c++17 --host_cxxopt=/std:c++17 --client_env=BAZEL_CXXOPTS=/std:c++17 +# Since we use designated initializers (C99 ... but >= c++20), compiler really wants the c++20 mode +common:windows --compiler=clang-cl --cxxopt=/std:c++20 --host_cxxopt=/std:c++20 --client_env=BAZEL_CXXOPTS=/std:c++20 # Address sanitizer settings. build:asan --strip=never diff --git a/.github/workflows/verible-ci.yml b/.github/workflows/verible-ci.yml index c70819865d..29978602c5 100644 --- a/.github/workflows/verible-ci.yml +++ b/.github/workflows/verible-ci.yml @@ -500,17 +500,20 @@ jobs: restore-keys: bazelcache_windows2_ - name: Install dependencies - # Bazel breaks on Windows with LLVM 16. Will be fixed in bazel 6.4 - run: choco install llvm --force --version=15.0.7 + run: | + choco install bazel --force --version=6.4.0 + choco install llvm --force + choco list -lo + BAZEL_BIN=C:/ProgramData/chocolatey/lib/bazel/bazel.exe - name: Debug bazel directory settings - run: bazel info + run: $BAZEL_BIN info - name: Run Tests - run: bazel test --keep_going --noshow_progress --test_output=errors //... + run: bazel-6 test --keep_going --noshow_progress --test_output=errors //... - name: Build Verible Binaries - run: bazel build --keep_going --noshow_progress -c opt :install-binaries + run: bazel-6 build --keep_going --noshow_progress -c opt :install-binaries - name: Prepare release run: |