From 891c4ac68e507ec74ec3e422aa21ea0a66fe250d Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Wed, 24 Apr 2024 15:03:06 -0400 Subject: [PATCH] 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. --- Meta/Azure/Caches.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Meta/Azure/Caches.yml b/Meta/Azure/Caches.yml index fc2b74bc2bf..ad9d1d6e504 100644 --- a/Meta/Azure/Caches.yml +++ b/Meta/Azure/Caches.yml @@ -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'