CI: Bust the toolchain ccache when the toolchain's major version changes

The build will be entirely clean anyways, so no need to preserve the
previous version's ccache.
This commit is contained in:
Timothy Flynn 2024-04-24 15:03:06 -04:00 committed by Tim Flynn
parent 4cc8266727
commit 891c4ac68e
Notes: sideshowbarker 2024-07-17 02:59:43 +09:00

View file

@ -21,6 +21,12 @@ steps:
key: '"toolchain" | "x86_64" | Toolchain/BuildClang.sh | Toolchain/Patches/llvm/*.patch | Toolchain/CMake/*.cmake | Userland/Libraries/LibC/**/*.h'
path: $(Build.SourcesDirectory)/Toolchain/Cache
displayName: 'Toolchain Prebuilt Cache'
- script: |
source $(Build.SourcesDirectory)/Ports/llvm/package.sh
echo "##vso[task.setvariable variable=toolchain_version]$(echo ${version} | cut -d'.' -f1)"
displayName: 'Toolchain Version'
- ${{ if eq(parameters.toolchain, 'gcc') }}:
- task: Cache@2
inputs:
@ -28,12 +34,17 @@ steps:
path: $(Build.SourcesDirectory)/Toolchain/Cache
displayName: 'Toolchain Prebuilt Cache'
- script: |
source $(Build.SourcesDirectory)/Ports/gcc/package.sh
echo "##vso[task.setvariable variable=toolchain_version]$(echo ${version} | cut -d'.' -f1)"
displayName: 'Toolchain Version'
- ${{ if ne(parameters.toolchain_ccache_path, '') }}:
- task: Cache@2
inputs:
key: '"toolchain ccache" | "x86_64" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
key: '"toolchain ccache" | "x86_64" | "${{ parameters.toolchain }}" | "$(toolchain_version)" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
restoreKeys: |
"toolchain ccache" | "x86_64" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}"
"toolchain ccache" | "x86_64" | "${{ parameters.toolchain }}" | "$(toolchain_version)" | "${{ parameters.ccache_version }}"
path: ${{ parameters.toolchain_ccache_path }}
displayName: 'Toolchain Compiler Cache'