Skip to content

The std cache key of the clang MSVC row does not hold the MSVC version clang derives from cl.exe #746

Description

@speak-agent

Observation

e2e 760 (760_msvc_toolset_is_chosen_once.sh) failed once on the Windows e2e leg of #745 (job 109769581840) and passed on a rerun of the same commit. The failing compile was leg 2 (the toolset pinned to the runner's default, 14.51.36231, with a VCToolsInstallDir naming a fake 14.99.0):

error: AST file '...\pcm.cache\std.pcm' was compiled for the target 'x86_64-pc-windows-msvc19.51.36260'
       but the current translation unit is being compiled for target 'x86_64-pc-windows-msvc19.51.36257'
error: module file ...\std.pcm cannot be loaded due to a configuration mismatch with the current compilation
Job Runner image mcpp-sandbox cache 760
109757602629 (#745, 9b8cdd7) windows-2025-vs2026 20260925.250.1 not found, saved at the end pass
109769581840 (#745, ac4beb8) windows-2025-vs2026 20260922.246.2 restored (the one saved above) fail
109778980139 (rerun of the above) windows-2025-vs2026 not found pass

Both images report the default toolset 14.51.36231, and the two MSVC versions that clang derived differ (19.51.36260 and 19.51.36257).

Hypothesis (not yet measured on a runner)

The build fingerprint and the std cache key of the clang MSVC row hold the toolset directory (-Xmicrosoft-visualc-tools-root) and the SDK, but not the MSVC version clang derives from cl.exe (-fms-compatibility-version, embedded in the BMI's target). Two images whose cl.exe differ under one toolset directory name then share a std entry, and a cache restored from one image serves the other.

Criterion for a fix

On one machine, two cl.exe builds under one toolset directory name produce two std cache keys; equivalently, the MSVC version clang derives is part of the key (or is passed explicitly as -fms-compatibility-version from the recorded toolset).

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions