mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 11:21:30 +00:00
ci: key the Windows compiler cache on the MSVC toolset version (#15729)
This commit is contained in:
@@ -85,6 +85,15 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
leg="${{ runner.os }}-${{ inputs.arch || 'amd64' }}${{ runner.os == 'Windows' && format('-{0}', inputs.compiler) || '' }}"
|
leg="${{ runner.os }}-${{ inputs.arch || 'amd64' }}${{ runner.os == 'Windows' && format('-{0}', inputs.compiler) || '' }}"
|
||||||
|
# clang-cl refuses a precompiled header from another cl.exe build and ccache
|
||||||
|
# does not hash that build, so each one gets its own cache. The build number
|
||||||
|
# is read from cl.exe itself; the toolset directory keeps its name across patches.
|
||||||
|
if [ "${{ runner.os }}" = Windows ]; then
|
||||||
|
vswhere='/c/Program Files (x86)/Microsoft Visual Studio/Installer/vswhere.exe'
|
||||||
|
toolset=$(tr -d '\r\n' < "$("$vswhere" -latest -products '*' -find 'VC\Auxiliary\Build\Microsoft.VCToolsVersion.default.txt' | tr -d '\r')")
|
||||||
|
cl=$("$vswhere" -latest -products '*' -find 'VC\Tools\MSVC\'"$toolset"'\**\cl.exe' | tr -d '\r' | head -1)
|
||||||
|
leg="$leg-vc$("$cl" 2>&1 | grep -o -E 'Version [0-9.]+' | cut -d' ' -f2)"
|
||||||
|
fi
|
||||||
echo "CCACHE_LEG=$leg" >> "$GITHUB_ENV"
|
echo "CCACHE_LEG=$leg" >> "$GITHUB_ENV"
|
||||||
echo "CCACHE_ENTRY=ccache-$leg-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_ENV"
|
echo "CCACHE_ENTRY=ccache-$leg-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_ENV"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user