Skip to content

Add isolated Windows builds for VS 2022 and VS 2026 - #2397

Open
JATMN (jatmn) wants to merge 4 commits into
Ultimaker:mainfrom
jatmn:fix-vs2026-build
Open

JATMN (jatmn) wants to merge 4 commits into
Ultimaker:mainfrom
jatmn:fix-vs2026-build

Conversation

@jatmn

@jatmn JATMN (jatmn) commented Sep 29, 2026 •

Copy link
Copy Markdown

Description

Add an executable Windows build launcher with VS 2022 as the default and explicit --vs 2026 selection. It uses the existing Conan/CMake build recipe and rejects a mismatched active compiler instead of silently switching toolchains.

python scripts\build_windows.py
python scripts\build_windows.py --vs 2026 --build-type Debug --with-tests

Run each command from its matching x64 Native Tools prompt. The launcher checks compiler and prerequisite versions, pins Conan to that prompt's standard VSINSTALLDIR, and runs conan build. Profiles and remotes are isolated under build/windows-vs2022 or build/windows-vs2026; package sources and binaries use a short per-user, per-checkout, per-compiler store derived from %LOCALAPPDATA%. No username, drive, Visual Studio edition, or installation path is hard-coded.

The package workflow uses the repository's shared actor gate before invoking publishing jobs, matching the established pattern in other fork-originated PRs where upload secrets are unavailable.

--with-tests enables CuraEngine's tests without enabling test suites in dependencies built from source. Generated root presets and the caller's environment, profiles, and existing Conan home remain unchanged.

VS 2022 preservation: the existing direct Conan/CMake path, recipe minimums, dependencies, compiler defaults, and CI remain unchanged. The new helper requires Conan >=2.24,<3 for both IDEs because older Conan lacks the preset-isolation option; use a separate Python environment if an existing VS 2022 build uses older Conan. Its CMake minimum is 3.23 for VS 2022 and 4.2 for VS 2026.

The README and Windows guide cover prerequisites, helper and manual paths, Release/Debug, runtime DLL setup, tests, and troubleshooting. Empty OverrideAreas locals are const rather than constexpr, preserving immutability while allowing MSVC 19.50 Debug builds of the vector-backed type.

Reviewed commit: a8249f4fb0f02e1d78c0eca6df3634b978575596.

Type of change

  • New feature: optional Windows build launcher preserving existing build paths.
  • Bug fix: make current CuraEngine sources compile with MSVC 19.50 Debug iterator checks.
  • CI fix: skip package publishing when the shared actor gate does not authorize it.

How Has This Been Tested?

Native Windows validation

Environment: Windows x86_64, Visual Studio 2026 Build Tools 18.4.1, MSVC 19.50.35727, Conan 2.24.0, CMake 4.2.3, and Ninja 1.12.0.

  • VS 2026 Release helper build with tests: completed all 258 CuraEngine/test build steps.
  • VS 2026 Release CTest after conanrun.bat: 31/31 passed, 0 failed (--no-tests=error).
  • VS 2026 Release runtime smoke: CuraEngine.exe help printed version and usage and exited 0.
  • VS 2026 Debug helper build with tests: completed all 219 CuraEngine/test build steps.
  • VS 2026 Debug CTest after conanrun.bat: 31/31 passed, 0 failed (--no-tests=error).
  • VS 2026 Debug runtime smoke: CuraEngine.exe help printed version and usage and exited 0.
  • Toolchain selection: the matching VS 2026 prompt built successfully; running --vs 2022 from that prompt failed before Conan with the expected compiler-mismatch message.
  • Final launcher suite: 13/13 stdlib unit tests passed, including standard-environment path derivation, installation pinning, per-checkout/compiler storage isolation, tool/version rejection, and failure behavior.
  • Python syntax and git diff --check passed on the reviewed commit.
  • Fork CI gate: the shared check_actor job passed; unauthorized conan-package and npm-package publishing jobs skipped cleanly instead of attempting anonymous uploads.

Commands used for each configuration:

python scripts\build_windows.py --vs 2026 --build-type Release --with-tests
call build\windows-vs2026\build\Release\generators\conanrun.bat
ctest --test-dir build/windows-vs2026/build/Release --output-on-failure --no-tests=error
build\windows-vs2026\build\Release\CuraEngine.exe help

python scripts\build_windows.py --vs 2026 --build-type Debug --with-tests
call build\windows-vs2026\build\Debug\generators\conanrun.bat
ctest --test-dir build/windows-vs2026/build/Debug --output-on-failure --no-tests=error
build\windows-vs2026\build\Debug\CuraEngine.exe help

Earlier portable validation

  • Real Conan 2.24 + CMake/Ninja C++ fixture build and executable smoke test using the helper's Conan arguments on Linux. Verified separate output and unchanged pre-existing root CMakeUserPresets.json.
  • Real Conan 2.7.1 check identified its missing tools.cmake.cmaketoolchain:user_presets option; the launcher rejects it before configuration rather than risking preset collisions. The direct VS 2022 path keeps its existing minimum.
  • Conan 2.24 and 2.32 profile/mapping checks for MSVC 193, 194, and 195, including Debug/testing settings.

Windows validation before marking ready

This PR remains a draft because this host has no VS 2022 installation. No VS 2022 native result is claimed, and no compiler was installed as part of validation.

  • VS 2022: default helper path and explicit --vs 2022, Release/Debug, runtime smoke, and CTest.
  • VS 2022: existing direct build still works after running the VS 2026 helper; original presets/profile/cache remain intact.
  • VS 2026: --vs 2026, Release/Debug, runtime smoke, and CTest.
  • With both IDEs installed, each selection uses the matching compiler. The available negative direction (VS 2026 prompt with --vs 2022) is verified, but the reverse direction requires a VS 2022 installation.

Checklist

  • Followed applicable UltiMaker Meta and Python guidance.
  • Read the contribution guide.
  • Included focused tests and reproducible setup/build/validation instructions.
  • Native Windows validation complete with both VS 2022 and VS 2026 before marking ready.

Explain compiler selection and isolated Conan environments without changing existing VS 2022 build defaults. Include Release, Debug, runtime and CTest instructions for native Windows validation.
@github-actions github-actions Bot added the PR: Community Contribution 👑 Community Contribution PR's label Sep 29, 2026
@jatmn JATMN (jatmn) changed the title Document opt-in VS 2026 builds alongside VS 2022 Add isolated Windows builds for VS 2022 and VS 2026 Sep 29, 2026
@jatmn
JATMN (jatmn) marked this pull request as ready for review September 29, 2026 18:53

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: Community Contribution 👑 Community Contribution PR's

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant