File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change 6161 with :
6262 key : ${{ inputs.target }}
6363 save-if : ${{ inputs.save-cache }}
64- shared-key : stable-cache-v4
64+ shared-key : stable-cache-v5
6565
6666 # TODO: Re-enable cargo config generation when preprep.mjs is ported
6767 # For now, use cargo's defaults which work fine without native deps
Original file line number Diff line number Diff line change @@ -80,16 +80,22 @@ runs:
8080 # 4. Set LIBCLANG_PATH for bindgen (points to our LLVM where libclang.dll lives)
8181 echo "LIBCLANG_PATH=$llvmBin" >> $env:GITHUB_ENV
8282
83- # 5. Find cl.exe full path via vswhere and set CMAKE_C_COMPILER
83+ # 5. Find cl.exe full path via vswhere and force it for ALL compiler detection.
84+ # aws-lc-sys uses the `cc` crate (not CMAKE_C_COMPILER) to detect the compiler.
85+ # If it finds clang-cl, it enables __builtin_bswap support, but CMake then compiles
86+ # with MSVC which doesn't know those builtins → linker error.
87+ # Setting CC forces the cc crate to use MSVC for both detection AND compilation.
8488 $vsPath = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" `
8589 -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 `
8690 -property installationPath
8791 $msvcVer = (Get-Content "$vsPath\VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt").Trim()
8892 $clExe = "$vsPath\VC\Tools\MSVC\$msvcVer\bin\HostX64\x64\cl.exe"
8993 if (Test-Path $clExe) {
94+ echo "CC=$clExe" >> $env:GITHUB_ENV
95+ echo "CXX=$clExe" >> $env:GITHUB_ENV
9096 echo "CMAKE_C_COMPILER=$clExe" >> $env:GITHUB_ENV
9197 echo "CMAKE_CXX_COMPILER=$clExe" >> $env:GITHUB_ENV
92- Write-Host "Set CMAKE_C_COMPILER to $clExe"
98+ Write-Host "Set CC and CMAKE_C_COMPILER to $clExe"
9399 } else {
94100 Write-Error "Could not find cl.exe at $clExe"
95101 exit 1
You can’t perform that action at this time.
0 commit comments