Skip to content

Commit 4b571e7

Browse files
committed
fix(ci): set VCToolsInstallDir as well — the two consumers do not read each other
Moving 14.51 out settled mcpp and broke clang. Each lever was measured alone, and each failed in its own half: * `VCToolsInstallDir` alone — clang used 14.44's headers, mcpp kept scanning and handed it 14.51's std.ixx: std.ixx:126: fatal error: 'flat_map' file not found * moving 14.51 out alone — mcpp picked 14.44, and clang's own MSVC detection (which goes through the VS installation's registration, and that still names 14.51) found nothing. The compile came out with NO include paths at all: std.ixx:12: fatal error: 'assert.h' file not found `assert.h` is a UCRT header, and the command line carried neither /imsvc nor -I — clang was not looking in the wrong place, it had no place to look. mcpp SCANS the toolset directory; clang READS the environment. Neither reads the other's answer, so there is one lever per consumer and both are needed. Setting both is not redundancy. That took three rounds to land and the intermediate states are in the step's comment, because each of them looks like a reasonable thing to try and each is wrong in a way only the next failure shows.
1 parent df1691a commit 4b571e7

1 file changed

Lines changed: 19 additions & 0 deletions

File tree

‎.github/workflows/validate.yml‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1049,6 +1049,25 @@ jobs:
10491049
} else {
10501050
Write-Host "14.51.36231 not present; nothing to move"
10511051
}
1052+
# BOTH LEVERS, because they answer different consumers and each
1053+
# alone was measured failing:
1054+
#
1055+
# * moving 14.51 out settles mcpp, which SCANS the directory and
1056+
# takes the newest. Alone, it broke clang: clang's own MSVC
1057+
# detection goes through the VS installation's registration,
1058+
# which still names 14.51, so it found nothing and emitted a
1059+
# compile with NO include paths at all --
1060+
# `std.ixx:12: fatal error: 'assert.h' file not found`, the UCRT
1061+
# header, from a command line carrying neither /imsvc nor -I.
1062+
# * `VCToolsInstallDir` settles clang, which reads it instead of
1063+
# detecting. Alone, it left mcpp scanning and picking 14.51, so
1064+
# 14.51's std.ixx compiled against 14.44's headers --
1065+
# `std.ixx:126: fatal error: 'flat_map' file not found`.
1066+
#
1067+
# Neither consumer reads the other's answer. Setting both is not
1068+
# belt-and-braces; it is one answer per consumer.
1069+
"VCToolsInstallDir=$want\" | Out-File -Append -Encoding utf8 $env:GITHUB_ENV
1070+
Write-Host "VCToolsInstallDir -> $want"
10521071
Write-Host "visible toolsets now:"
10531072
Get-ChildItem $vs -Directory | ForEach-Object { Write-Host " $($_.Name)" }
10541073
- name: Download mcpp

0 commit comments

Comments
 (0)