Add Windows build automation script and update QML comment for URI handling - #328
Merged
tedwaine merged 2 commits intoSep 7, 2026
Conversation
|
|
aramadan0096
force-pushed
the
feat/windows-build-script
branch
from
August 27, 2026 16:03
594c353 to
f48a216
Compare
scripts/build_windows.ps1 automates the sequence in docs/reference/build_guides/windows.md: preflight checks, Visual Studio discovery, Qt 6.5.3 installation via aqtinstall, vcpkg clone/pin/bootstrap, CMakeUserPresets.json generation, entering the VS developer shell, configure, build, NSIS packaging, and optionally building and running the tests. It selects an MSVC toolset that ships ATL. Enter-VsDevShell honours Microsoft.VCToolsVersion.v143.default.txt while vcpkg picks up Microsoft.VCToolsVersion.default.txt, so when those differ the dependencies and xSTUDIO are compiled with different toolsets, and a toolset without ATL fails to compile src/audio/src/windows_audio_output_device.cpp. It also prepends the VS-bundled CMake and Ninja to PATH, which the developer shell does not do, and reports three failure modes that are otherwise hard to diagnose: a CMakeCache.txt generated for a different source tree, a vcpkg root locked by another build, and a dependency download that fails its hash check because the source host served an anti-bot challenge page. Add build_logs/ and CMakeUserPresets.json.bak to .gitignore, both written by the script. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Ahmed Ramadan <57462754+aramadan0096@users.noreply.github.com>
aramadan0096
force-pushed
the
feat/windows-build-script
branch
from
August 27, 2026 16:04
f48a216 to
6cbbee9
Compare
Collaborator
|
Thanks for this contribution. Looks great, just what we needed to lower the bar for Windows users. I will test on my own Win10 and Win11 systems and merge pending that. |
Collaborator
|
Thanks for this one, @aramadan0096 - it worked 1st time on my Win11 machine too. This makes building and using xSTUDIO much more accessible for many. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[ 329: Add a Windows build automation script ]
Linked issues
Fixes #329
Summarize your change.
Adds
scripts/build_windows.ps1, which automates the sequence indocs/reference/build_guides/windows.mdend to end: preflight checks, Visual Studiodiscovery, Qt 6.5.3 installation via
aqtinstall, vcpkg clone/pin/bootstrap,CMakeUserPresets.jsongeneration, entering the VS Developer Shell, configure, build,NSIS packaging, and optionally building and running the tests.
Every phase can be skipped (
-SkipQt,-SkipVcpkg,-SkipConfigure,-SkipBuild) sothe same script serves both a cold first build and fast iteration.
-CheckOnlyreportsthe state of the toolchain without modifying anything.
Also adds
build_logs/andCMakeUserPresets.json.bakto.gitignore, both written bythe script.
Describe the reason for the change.
The Windows guide is a long manual sequence, and several environment details it cannot
reasonably cover only surface deep into a multi-hour build. The script turns each into an
early, explicit check. Detail is in #329; the substantive one:
Enter-VsDevShelland vcpkg can select different MSVC toolsets. The developer shellhonours
Microsoft.VCToolsVersion.v143.default.txt, vcpkg picks upMicrosoft.VCToolsVersion.default.txt. Where those differ, the dependencies and xSTUDIOare compiled with different toolsets. Following the guide exactly on my machine gave
dependencies at 14.42.34433 and xSTUDIO at 14.40.33807, and since only 14.42 shipped
atlmfc, the build failed about 50 minutes in:The ATL component was installed — just not for the toolset the dev shell chose. The
script enumerates installed toolsets, selects the newest one carrying ATL, pins it with
-vcvars_ver, and fails at preflight with installer guidance if none has it.Smaller ones it also handles:
cmake/ninjanot actually being onPATHafterEnter-VsDevShell(on my machineninjaresolved to Strawberry Perl's copy, beside aMinGW
gcc/ar); aCMakeCache.txtgenerated for a different source tree; a vcpkg rootlocked by another build, which otherwise looks identical to slow progress; and a
dependency download that fails its hash check because the host served an anti-bot page.
Describe what you have tested and on which operating system.
Windows 10 Pro 22H2 (19045), Ryzen 9 5950X, VS 2022 Community (MSVC 14.42.34433),
Qt 6.5.3
msvc2019_64, NSIS 3.x, presetWinNinjaRelease.Exercised for real, not dry-run:
aqtinstall(~34s) on a machine thathad only Qt 5.15.2.
builtin-baselinecommitc2aeddd80357b17592e59ad965d2adf65a19b22f, and bootstrapped.build/xSTUDIO-1.3.0-win64.exe(223.6 MB),plus
build/bin/xstudio.exeandbuild/run_xstudio.bat.-SkipVcpkg -SkipConfigure): 8m33s. Configure alone drops from44m12s to 1m22s once the vcpkg binary cache is warm.
-BuildTests/-RunTests: configure withBUILD_TESTING=ON, buildhelpers_test,run
ctest -R utility_helpers_test.-CheckOnly, and the failure paths for a stale cache, a missing vcpkg, and a toolsetwithout ATL.
Not tested: the Visual Studio generator presets (
WinRelease/WinDebug) — the scriptadds
--configfor those, but only the Ninja presets were exercised. Not tested onWindows 11.
Two issues encountered that are not caused by this change, but which anyone building
on Windows will hit right now:
code.videolan.orgserves an anti-bot challenge page to command-line downloads, sovcpkg's
x264fetch fails its SHA512 check. It has to be downloaded once in a browserinto the vcpkg downloads directory. The script detects the hash failure and prints that
remedy rather than a raw CMake trace.
BUILD_TESTING=ON,contact_sheet_testdoes not compile —winsock2.hisincluded after
windows.h, giving ~100 redefinition errors (sockaddr,fd_set,WSAData, ...) andC1003. This breaks--target all, so the docs' "some testscurrently fail or time out" understates it for that target. Happy to open a separate
issue.
Add a list of changes, and note any that might need special attention during the review.
scripts/build_windows.ps1(new).gitignorebuild_logs/,CMakeUserPresets.json.bakWorth attention:
via
-vcvars_ver;-MsvcVersionoverrides. If the project would rather document therequired component than auto-select, that is an easy change — but note the current
default silently mixes toolsets between dependencies and the application.
CMakePresets.jsonhardcodes${sourceDir}/../vcpkg.When
-VcpkgRootpoints elsewhere the script emits aCMAKE_TOOLCHAIN_FILEoverrideinto
CMakeUserPresets.json, so a project can use a dedicated vcpkg checkout and avoidlock contention with other builds. The binary cache is keyed by ABI hash rather than by
root, so a separate root still reuses everything already built.
CMakeUserPresets.jsonis rewritten. Other presets in the file are preserved and a.bakis written first, but the script does take ownership of its own preset entry.-RunTestswarns on a non-zero ctest resultand the script still exits 0, matching the docs' note that a clean run is not expected
yet. Say the word if you would rather it propagate.
build job later, which would have caught both issues noted above.
If possible, provide screenshots.
N/A — command-line change. Final summary from the packaging run: