mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 03:32:45 +00:00 
			
		
		
		
	CI: Hash only relevant files for the key of the compiler cache
In the last few commits, a second patch was added to the LLVM toolchain, and it no longer uses our binutils patch. This commit changes the CI cache keys accordingly, in order to prevent unnecessary rebuilds of both toolchains when only one is changed. The Clang toolchain's cache now only takes into account patches that begin with `llvm`, and the GNU toolchain excludes those from the hash calculation. We now also hash the two CMake cache files that we use for building LLVM and its runtime libraries.
This commit is contained in:
		
							parent
							
								
									43008267b2
								
							
						
					
					
						commit
						d21c38a72d
					
				
					 2 changed files with 4 additions and 4 deletions
				
			
		
							
								
								
									
										4
									
								
								.github/workflows/cmake.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								.github/workflows/cmake.yml
									
										
									
									
										vendored
									
									
								
							|  | @ -73,8 +73,8 @@ jobs: | ||||||
|           # *and* as actual output variable, in this order. |           # *and* as actual output variable, in this order. | ||||||
|           message("  set-output name=time::${current_date}") |           message("  set-output name=time::${current_date}") | ||||||
|           message("::set-output name=time::${current_date}") |           message("::set-output name=time::${current_date}") | ||||||
|           message("  set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*[!llvm].patch', 'Toolchain/BuildIt.sh') }}") |           message("  set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/[!llvm]*.patch', 'Toolchain/BuildIt.sh') }}") | ||||||
|           message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/*[!llvm].patch', 'Toolchain/BuildIt.sh') }}") |           message("::set-output name=libc_headers::${{ hashFiles('Userland/Libraries/LibC/**/*.h', 'Userland/Libraries/LibPthread/**/*.h', 'Toolchain/Patches/[!llvm]*.patch', 'Toolchain/BuildIt.sh') }}") | ||||||
| 
 | 
 | ||||||
|       - name: Toolchain cache |       - name: Toolchain cache | ||||||
|         # TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. |         # TODO: Change the version to the released version when https://github.com/actions/cache/pull/489 (or 571) is merged. | ||||||
|  |  | ||||||
|  | @ -18,13 +18,13 @@ steps: | ||||||
|     - ${{ if eq(parameters.toolchain, 'clang') }}: |     - ${{ if eq(parameters.toolchain, 'clang') }}: | ||||||
|       - task: Cache@2 |       - task: Cache@2 | ||||||
|         inputs: |         inputs: | ||||||
|           key: '"toolchain" | "x86_64" | Toolchain/BuildClang.sh | Toolchain/Patches/*[!gcc].patch | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h' |           key: '"toolchain" | "x86_64" | Toolchain/BuildClang.sh | Toolchain/Patches/llvm*.patch | Toolchain/CMake/*.cmake | Userland/Libraries/LibC/**/*.h | Userland/Libraries/LibPthread/**/*.h' | ||||||
|           path: $(Build.SourcesDirectory)/Toolchain/Cache |           path: $(Build.SourcesDirectory)/Toolchain/Cache | ||||||
|         displayName: 'Toolchain Prebuilt 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 Prebuilt Cache' |         displayName: 'Toolchain Prebuilt Cache' | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Daniel Bertalan
						Daniel Bertalan