mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 18:07:35 +00:00
CI: Create a secondary ccache for the Clang toolchain build
We bust the prebuilt cache when any header in e.g. LibC changes. Doing a full toolchain rebuild probably isn't necessary, so this adds a separate ccache to speed up toolchain builds.
This commit is contained in:
parent
4a4e614387
commit
8084957e88
2 changed files with 28 additions and 3 deletions
|
@ -5,6 +5,8 @@ parameters:
|
||||||
build_directory: ''
|
build_directory: ''
|
||||||
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
ccache_version: 1 # Increment this number if CI has trouble with ccache.
|
||||||
serenity_ccache_path: $(CCACHE_DIR)
|
serenity_ccache_path: $(CCACHE_DIR)
|
||||||
|
toolchain_ccache_path: $(CCACHE_DIR)
|
||||||
|
toolchain_ccache_size: $(CCACHE_MAXSIZE)
|
||||||
with_unicode_caches: true
|
with_unicode_caches: true
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
@ -18,13 +20,26 @@ steps:
|
||||||
inputs:
|
inputs:
|
||||||
key: '"toolchain" | "${{ parameters.arch }}" | Toolchain/BuildClang.sh | Toolchain/Patches/*[!gcc].patch | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h'
|
key: '"toolchain" | "${{ parameters.arch }}" | Toolchain/BuildClang.sh | Toolchain/Patches/*[!gcc].patch | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h'
|
||||||
path: $(Build.SourcesDirectory)/Toolchain/Cache
|
path: $(Build.SourcesDirectory)/Toolchain/Cache
|
||||||
displayName: 'Toolchain Cache'
|
displayName: 'Toolchain Prebuilt Cache'
|
||||||
- ${{ if eq(parameters.toolchain, 'gcc') }}:
|
- ${{ if eq(parameters.toolchain, 'gcc') }}:
|
||||||
- task: Cache@2
|
- task: Cache@2
|
||||||
inputs:
|
inputs:
|
||||||
key: '"toolchain" | "${{ parameters.arch }}" | Toolchain/BuildIt.sh | Toolchain/Patches/*[!llvm].patch | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h'
|
key: '"toolchain" | "${{ parameters.arch }}" | Toolchain/BuildIt.sh | Toolchain/Patches/*[!llvm].patch | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h'
|
||||||
path: $(Build.SourcesDirectory)/Toolchain/Cache
|
path: $(Build.SourcesDirectory)/Toolchain/Cache
|
||||||
displayName: 'Toolchain Cache'
|
displayName: 'Toolchain Prebuilt Cache'
|
||||||
|
|
||||||
|
- task: Cache@2
|
||||||
|
inputs:
|
||||||
|
key: '"toolchain ccache" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}" | "$(timestamp)"'
|
||||||
|
restoreKeys: |
|
||||||
|
"toolchain ccache" | "${{ parameters.arch }}" | "${{ parameters.toolchain }}" | "${{ parameters.ccache_version }}"
|
||||||
|
path: ${{ parameters.toolchain_ccache_path }}
|
||||||
|
displayName: 'Toolchain Compiler Cache'
|
||||||
|
|
||||||
|
- script: |
|
||||||
|
CCACHE_DIR=${{ parameters.toolchain_ccache_path }} ccache -M ${{ parameters.toolchain_ccache_size }}
|
||||||
|
CCACHE_DIR=${{ parameters.toolchain_ccache_path }} ccache -s
|
||||||
|
displayName: 'Configure Toolchain ccache'
|
||||||
|
|
||||||
- task: Cache@2
|
- task: Cache@2
|
||||||
inputs:
|
inputs:
|
||||||
|
|
|
@ -8,6 +8,10 @@ jobs:
|
||||||
variables:
|
variables:
|
||||||
- name: SERENITY_CCACHE_DIR
|
- name: SERENITY_CCACHE_DIR
|
||||||
value: $(Build.SourcesDirectory)/.ccache
|
value: $(Build.SourcesDirectory)/.ccache
|
||||||
|
- name: LLVM_CCACHE_DIR
|
||||||
|
value: $(Build.SourcesDirectory)/Toolchain/.ccache
|
||||||
|
- name: LLVM_CCACHE_MAXSIZE
|
||||||
|
value: 20GB
|
||||||
|
|
||||||
pool:
|
pool:
|
||||||
vmImage: ubuntu-20.04
|
vmImage: ubuntu-20.04
|
||||||
|
@ -23,8 +27,10 @@ jobs:
|
||||||
toolchain: 'clang'
|
toolchain: 'clang'
|
||||||
build_directory: 'Build/${{ parameters.arch }}clang'
|
build_directory: 'Build/${{ parameters.arch }}clang'
|
||||||
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
|
serenity_ccache_path: '$(SERENITY_CCACHE_DIR)'
|
||||||
|
toolchain_ccache_path: '$(LLVM_CCACHE_DIR)'
|
||||||
|
toolchain_ccache_size: '$(LLVM_CCACHE_MAXSIZE)'
|
||||||
|
|
||||||
- script: ./Toolchain/BuildClang.sh
|
- script: ./Toolchain/BuildClang.sh --ci
|
||||||
displayName: Build Toolchain
|
displayName: Build Toolchain
|
||||||
env:
|
env:
|
||||||
TRY_USE_LOCAL_TOOLCHAIN: 'y'
|
TRY_USE_LOCAL_TOOLCHAIN: 'y'
|
||||||
|
@ -91,5 +97,9 @@ jobs:
|
||||||
condition: failed()
|
condition: failed()
|
||||||
|
|
||||||
- script: |
|
- script: |
|
||||||
|
echo "##[section]Toolchain Cache"
|
||||||
|
CCACHE_DIR='$(LLVM_CCACHE_DIR)' ccache -s
|
||||||
|
|
||||||
|
echo "##[section]Serenity Cache"
|
||||||
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache -s
|
CCACHE_DIR='$(SERENITY_CCACHE_DIR)' ccache -s
|
||||||
displayName: 'Cache Stats'
|
displayName: 'Cache Stats'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue