Update cmake, cc, and find-msvc-tools for Visual Studio 2026 - #293
Open
SalvatoreT wants to merge 1 commit into
Open
Update cmake, cc, and find-msvc-tools for Visual Studio 2026#293SalvatoreT wants to merge 1 commit into
SalvatoreT wants to merge 1 commit into
Conversation
GitHub repointed the windows-latest label from windows-2025 to
windows-2025-vs2026, which carries Visual Studio 2026 (18.7) and MSBuild
18.7 with no VS 2022 present. Every build that runs cmake from a build
script now panics with "couldn't determine visual studio generator".
That message comes from find-msvc-tools, not from cmake. Version 0.1.4
only recognises MSBuild 17.0 down to 14.0, so nothing matches on the new
image, and cmake re-panics with the error it got back.
Fixing it takes all three crates:
find-msvc-tools 0.1.4 -> 0.1.9 adds Vs18 and MSBuild 18.0 detection
cc 1.2.41 -> 1.4.0 exposes VsVers::Vs18 instead of
hitting unreachable!()
cmake 0.1.54 -> 0.1.58 maps Vs18 to "Visual Studio 18 2026"
Bumping only some of them is worse than bumping none. cc 1.2.41 accepts
find-msvc-tools 0.1.9 under semver and then panics on the Vs18 it gets
back.
Running vcvars first would not have helped either. It sets
VisualStudioVersion=18.0, which 0.1.4 does not recognise from the
environment any more than from the registry.
The runner ships CMake 4.4.0, and the Visual Studio 18 2026 generator
arrived in CMake 4.2, so the generator string this produces is supported.
Checked on macOS by forcing the MSVC code path with
VisualStudioVersion=18.0. The old versions panic at cmake lib.rs:970,
the line CI reports; the new ones get through and emit
-G "Visual Studio 18 2026" -Thost=x64 -Ax64. cargo check over the
workspace is clean with cc 1.4.0, including boring-sys and the jvm-only
fixture, the two crates that call cmake here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Cargo.lockonly:cmake0.1.54 to 0.1.58,cc1.2.41 to 1.4.0,find-msvc-tools0.1.4 to 0.1.9.The problem
GitHub repointed
windows-latestfromwindows-2025towindows-2025-vs2026. That image carries Visual Studio 2026 (18.7) and MSBuild 18.7, and no VS 2022. Since then every build that calls cmake from a build script panics withcouldn't determine visual studio generator. Three Windows jobs have been red onmainever since:cargo-tests,gradle-tests, andexamples-tokio-boring-app. There are no commits between the last green run and the first red one.The panic surfaces in the
cmakecrate but the message is written elsewhere:find-msvc-tools0.1.4 knows MSBuild 17.0 down to 14.0. Nothing matches on the new image, so it returns an error andcmakere-panics with it.Why all three crates
Each is an independent blocker, and a partial bump is worse than none:
cc1.2.41 acceptsfind-msvc-tools0.1.9 under semver and then hitsunreachable!("unknown VS version")on theVs18it gets back.find-msvc-toolsVs18and MSBuild 18.0 detectionccVsVers::Vs18cmakeVs18to"Visual Studio 18 2026"cargo update -p cmake --precise 0.1.58produces exactly this. Plaincargo update -p cmakedoes nothing, because cargo holds the other locked packages fixed andcmake0.1.55+ needscc ^1.2.46.What was ruled out
Running vcvars first does not help. It sets
VisualStudioVersion=18.0, which 0.1.4 fails to recognise from the environment just as it does from the registry. I confirmed that by running it rather than reasoning about it.CMAKE_GENERATOR=Ninjais worse.boring-syspicks its output subdirectory fromtarget.ends_with("-msvc")rather than from the generator, so under single-config Ninja the libraries land where none of its link search paths look.Testing
Reproduced and fixed locally on macOS first, since
find_vs_version()readsVisualStudioVersionbefore any Windows-only code. UnderVisualStudioVersion=18.0the locked versions fail and the new ones returnOk(Vs18); VS 2022 still returnsOk(Vs17). Through the cmake crate, the old versions panic atlib.rs:970:25, the same line and column CI reports, and the new ones emit-G "Visual Studio 18 2026" -Thost=x64 -Ax64.Then on a trimmed CI matrix, all three previously red Windows jobs pass, including BoringSSL compiling under the VS 2026 toolchain.
cargo check --workspace --all-targetsis clean withcc1.4.0, covering both cmake consumers.One thing worth knowing:
gobley-wasm-transformer's dependency closure includescc, so this also changes what a futurecargo install --lockedof that tool pins.No CHANGELOG entry, following the precedent of recent CI and dependency commits (fbaec69, c49e8a9, a4d0a0e, 034cc27). These crates are build dependencies of test fixtures and examples only.
Written with AI assistance (Claude Code) and pending human review, per CONTRIBUTING.md.
🤖 Generated with Claude Code