Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 21, 2025

Add MSVC 2026 (Visual Studio 2026) and MinGW Workflow Support

This PR adds comprehensive Windows build support with multiple compilers.

Changes

Workflow (.github/workflows/windows-build.yml)

  • Added build-vs2022 job - Uses Visual Studio 2022 (stable)
  • Added build-vs2026 job - Uses Visual Studio 2026 (when available on GitHub runners)
    • Simplified: Only checks if VS2026 is installed, no auto-installation
    • Graceful skip: If VS2026 not available, prints informative message and skips remaining steps (job completes successfully)
    • Ready for when GitHub adds VS2026 to their runners
  • Added build-mingw job - Uses MinGW-w64 with MSYS2 and Ninja build system

VS2026 Job Behavior

When VS2026 is available:

  • Runs full build, test, and artifact upload

When VS2026 is not available:

  • Prints informative skip message
  • Lists available VS installations
  • Skips all build steps (except checkout)
  • Job completes successfully (not marked as failure)

MinGW Build Features

  • Uses msys2/setup-msys2@v2 action for MinGW-w64 toolchain
  • Installs mingw-w64-x86_64-toolchain, cmake, ninja
  • Produces libccap.a (static) or libccap.dll (shared)
  • Tests shared library linking with GCC

Documentation

  • README.md / README.zh-CN.md: Added MSVC 2026 and MinGW-w64 to compiler requirements
  • BUILD_AND_INSTALL.md: Recommend CMake 3.31+ for VS 2026 support, added MinGW option

Build Matrix

Compiler Debug Release Static Shared
VS 2022
VS 2026 ⏭ (skips if unavailable)
MinGW-w64

No breaking changes to existing VS 2022 builds.

Original prompt

msvc 2026 已经发布了, 我的项目的 workflow 还没有支持。 请收集 msvc 2026 的相关信息, 帮我加上对应的 workflow。 需要注意的是, msvc 2026 才发布没多久, 需要最新版本的 cmake


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Nov 21, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI and others added 7 commits November 21, 2025 18:50
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
…dling

Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Copilot AI changed the title [WIP] Add workflow support for MSVC 2026 Add MSVC 2026 (Visual Studio 2025) workflow support Nov 21, 2025
Copilot AI requested a review from wysaid November 21, 2025 19:01
Copilot finished work on behalf of wysaid November 21, 2025 19:01
@wysaid wysaid changed the title Add MSVC 2026 (Visual Studio 2025) workflow support Add MSVC 2026 (Visual Studio 2026) workflow support Nov 26, 2025
@wysaid
Copy link
Owner

wysaid commented Nov 27, 2025

@copilot 改一下代码以及git 提交、 workflow、PR 描述等等 里面出现的 vs2025 的字样
不存在 vs2025, 但是 vs2026 已经发布了。 不信你可以自己查一下网络上的资料。
然后, 如果有必要的话帮我添加更多版本的 visual studio 的 workflow。
最后, 帮我添加 Windows 上的基于最新版本的 mingw 编译的 workflow

Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 27, 2025

@copilot 改一下代码以及git 提交、 workflow、PR 描述等等 里面出现的 vs2025 的字样
不存在 vs2025, 但是 vs2026 已经发布了。 不信你可以自己查一下网络上的资...

已修复所有 VS2025 引用,改为 VS2026。同时添加了 MinGW-w64 workflow:

  1. 将所有 vs2025VS 2025Visual Studio 2025 改为 vs2026VS 2026Visual Studio 2026
  2. CMake generator 从 "Visual Studio 18 2025" 改为 "Visual Studio 18 2026"
  3. 添加了 build-mingw job,使用 MSYS2/MinGW-w64 工具链和 Ninja 构建系统
  4. 更新了 README.md、README.zh-CN.md、BUILD_AND_INSTALL.md 文档

现在 Windows workflow 包含三个 job:

  • build-vs2022: Visual Studio 2022 (稳定版)
  • build-vs2026: Visual Studio 2026 (预览版,自动安装)
  • build-mingw: MinGW-w64 (最新版)

Commit: 81b2777

Copilot AI changed the title Add MSVC 2026 (Visual Studio 2026) workflow support Add MSVC 2026 (Visual Studio 2026) and MinGW workflow support Nov 27, 2025
Copilot finished work on behalf of wysaid November 27, 2025 10:00
@wysaid
Copy link
Owner

wysaid commented Nov 27, 2025

@copilot 根据我们的上下文, 我知晓 vs2026 还未被 github 支持。 我认为未来某一天会被支持。
所以, 请继续改进 workflow, 检查一下当前配置的 runner 是否已经有 vs2026 了, 如果有, 就正常运行, 如果没有, 就打印一个跳过的日志, 然后跳过 runner 的执行 (但不显示为失败)
这样可以方便我把本次 PR 合入进去。

…available

Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Nov 27, 2025

@copilot 根据我们的上下文, 我知晓 vs2026 还未被 github 支持。 我认为未来某一天会被支持。
所以, 请继续改进 workflow, 检查一下当前配置的 runner 是否��...

已简化 VS2026 job:

  1. 移除了自动安装 VS2026 的逻辑
  2. 现在只检查 runner 上是否已有 VS2026(检查 Preview/Enterprise/Professional/Community 等版本)
  3. 如果有 VS2026,正常运行构建
  4. 如果没有 VS2026,打印跳过日志后跳过所有构建步骤(job 完成但不显示为失败)

输出示例(VS2026 不可用时):

ℹ Visual Studio 2026 is not available on this GitHub runner yet.
Available Visual Studio installations:
  - C:\Program Files\Microsoft Visual Studio\2022
⏭ Skipping VS2026 build - this job will complete successfully without running the build.
Once GitHub adds VS2026 to their runners, this job will automatically start building.

Commit: ba2341d

Co-authored-by: wysaid <1430725+wysaid@users.noreply.github.com>
Copilot finished work on behalf of wysaid November 27, 2025 16:36
@wysaid wysaid marked this pull request as ready for review November 27, 2025 16:49
Copilot AI review requested due to automatic review settings November 27, 2025 16:49
Copilot finished reviewing on behalf of wysaid November 27, 2025 16:53
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds comprehensive Windows build support for Visual Studio 2026 and MinGW-w64 compilers to complement the existing VS2022 workflow. The VS2026 job includes intelligent detection that gracefully skips when the compiler isn't available on GitHub runners, ensuring forward compatibility when GitHub adds VS2026 support. The MinGW job provides an alternative GCC-based build option using MSYS2.

Key changes:

  • Renamed the existing Windows build job to build-vs2022 and updated artifact naming to include the compiler version
  • Added build-vs2026 job with automatic version detection and graceful skip capability when VS2026 is not available
  • Added build-mingw job using MSYS2 with MinGW-w64 toolchain and Ninja build system
  • Updated documentation to reflect MSVC 2026 and MinGW-w64 support with CMake 3.31+ recommendation

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
.github/workflows/windows-build.yml Split single Windows build job into three separate jobs (VS2022, VS2026, MinGW), added VS2026 detection logic, configured MinGW with MSYS2, updated artifact naming
README.md Added MSVC 2026 and MinGW-w64 to compiler requirements, noted CMake 3.31+ recommendation for VS2026
README.zh-CN.md Chinese version of README updates - added MSVC 2026 and MinGW-w64 support documentation
BUILD_AND_INSTALL.md Updated prerequisites to mention VS2026 and MinGW-w64, recommended CMake 3.31+ for MSVC 2026

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

fi
cd scripts
if [ "${{ matrix.config }}" == "Debug" ]; then
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use = instead of == for string comparison in bash [ ] test construct to maintain consistency with the rest of the file (lines 60, 124, 309, 370) and follow POSIX standards. While == works in bash, it's a bashism and may not work in all shells.

Suggested change
if [ "${{ matrix.config }}" == "Debug" ]; then
if [ "${{ matrix.config }}" = "Debug" ]; then

Copilot uses AI. Check for mistakes.
Comment on lines +285 to +288
try {
Write-Host "Attempting to use Visual Studio 18 2026 generator..."
cmake ../.. -G "Visual Studio 18 2026" -A x64 -DCCAP_BUILD_TESTS=ON $SHARED_FLAG
} catch {
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The try-catch block may not work as expected for the cmake command in PowerShell. External commands don't throw exceptions by default. Consider checking $LASTEXITCODE after the first cmake attempt instead of using try-catch, or set $ErrorActionPreference = 'Stop' before the try block to ensure cmake failures are caught.

Suggested change
try {
Write-Host "Attempting to use Visual Studio 18 2026 generator..."
cmake ../.. -G "Visual Studio 18 2026" -A x64 -DCCAP_BUILD_TESTS=ON $SHARED_FLAG
} catch {
Write-Host "Attempting to use Visual Studio 18 2026 generator..."
cmake ../.. -G "Visual Studio 18 2026" -A x64 -DCCAP_BUILD_TESTS=ON $SHARED_FLAG
if ($LASTEXITCODE -ne 0) {

Copilot uses AI. Check for mistakes.
echo "✓ Windows shared library linking test with MinGW passed"
- name: Run Unit Tests
if: matrix.config == 'Release'
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MinGW job only runs unit tests for Release builds, while VS2022 and VS2026 jobs run tests for both Debug (functional tests) and Release (performance tests) builds. Consider adding tests for Debug builds to maintain consistency with the other Windows build jobs, or add a comment explaining why MinGW only tests Release builds.

Copilot uses AI. Check for mistakes.
mkdir -p build
if [ ! -L "build/${{ matrix.config }}" ]; then
ln -sf "${{ matrix.config }}-${{ matrix.library_type }}" "build/${{ matrix.config }}"
fi
Copy link

Copilot AI Nov 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MinGW test setup only creates a symbolic link for build/${{ matrix.config }} but not for build/tests/${{ matrix.config }}, unlike VS2022 and VS2026 jobs (lines 413-423). If the test script expects the tests directory structure, this could cause issues. Verify that ./run_tests.sh --functional --skip-build works correctly with MinGW's simplified symlink setup, or add the tests symlink for consistency.

Suggested change
fi
fi
mkdir -p build/tests
if [ ! -L "build/tests/${{ matrix.config }}" ]; then
ln -sf "../../${{ matrix.config }}-${{ matrix.library_type }}" "build/tests/${{ matrix.config }}"
fi

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants