Commit ef123a4
authored
Harden Windows build setup (#840)
* Harden Windows build setup
- Prefer VS 2017/2019/2022 over newer installs (e.g. VS 2026) when
vswhere reports both, so a host with a newer VS installed
alongside VS 2022 still builds with v143. Without this the
downstream Select-String version checks miss and the VS 2015
fallback dereferences a null VS140COMNTOOLS.
- Pin vcpkg's CMake with VCPKG_VISUAL_STUDIO_PATH and
VCPKG_PLATFORM_TOOLSET=v143 so it uses the same toolset as the
.vcxproj files, avoiding MSB8040 (Spectre-libs missing for v145)
when vcpkg would otherwise pick up a newer VS.
- Fall back to the repo root for OpenSSH-build.ps1 -destination when
\$env:WORKSPACE is unset. CI still has its WORKSPACE value, and no
longer invokes this script directly anyway.
- Document Windows build prerequisites in README.txt: VS 2022
Desktop C++ workload, v143 Spectre-mitigated libs, Git, the
one-time vcpkg bootstrap/integrate step, and the need to run from
an elevated PowerShell.
* Prefer VS 2022 specifically, not 2017/2019/2022 as a group
The .vcxproj files pin PlatformToolset v143, which ships with VS 2022.
VS 2017 (v141) and VS 2019 (v142) would need v143 build tools sideloaded
to build this, which is a non-default setup — so they shouldn't be
treated as equals to VS 2022 in the preference order.1 parent fbfe284 commit ef123a4
3 files changed
Lines changed: 56 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
559 | 559 | | |
560 | 560 | | |
561 | 561 | | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
562 | 567 | | |
563 | 568 | | |
564 | 569 | | |
| |||
614 | 619 | | |
615 | 620 | | |
616 | 621 | | |
617 | | - | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
618 | 628 | | |
619 | 629 | | |
620 | 630 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
13 | 55 | | |
14 | 56 | | |
15 | 57 | | |
16 | 58 | | |
17 | 59 | | |
18 | | - | |
| 60 | + | |
19 | 61 | | |
20 | 62 | | |
21 | 63 | | |
| |||
0 commit comments