From fd8c5296e5cb1402161357942d062cc20b14122d Mon Sep 17 00:00:00 2001 From: daz Date: Fri, 14 Apr 2023 15:23:04 -0600 Subject: [PATCH] Update for Gradle 8.1 release With Gradle 8.1, the configuration-cache has changed and is now stable. As a temporary measure, disable save/restore of the configuration-cache data to avoid breaks until we can deal wtih this change properly. --- README.md | 3 ++- src/cache-base.ts | 8 ++++---- src/cache-utils.ts | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4e6c087..45d573b 100644 --- a/README.md +++ b/README.md @@ -252,9 +252,10 @@ gradle-home-cache-includes: | caches notifications jdks -# Exclude the local build-cache from the directories cached. +# Exclude the local build-cache and keyrings from the directories cached. gradle-home-cache-excludes: | caches/build-cache-1 + caches/keyrings ``` You can specify any number of fixed paths or patterns to include or exclude. diff --git a/src/cache-base.ts b/src/cache-base.ts index 74bb797..8bada14 100644 --- a/src/cache-base.ts +++ b/src/cache-base.ts @@ -4,7 +4,7 @@ import path from 'path' import fs from 'fs' import {CacheListener} from './cache-reporting' import {saveCache, restoreCache, cacheDebug, isCacheDebuggingEnabled, tryDelete, generateCacheKey} from './cache-utils' -import {ConfigurationCacheEntryExtractor, GradleHomeEntryExtractor} from './cache-extract-entries' +import {GradleHomeEntryExtractor} from './cache-extract-entries' const RESTORED_CACHE_KEY_KEY = 'restored-cache-key' @@ -80,7 +80,7 @@ export class GradleStateCache { async afterRestore(listener: CacheListener): Promise { await this.debugReportGradleUserHomeSize('as restored from cache') await new GradleHomeEntryExtractor(this.gradleUserHome).restore(listener) - await new ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener) + // await new ConfigurationCacheEntryExtractor(this.gradleUserHome).restore(listener) await this.debugReportGradleUserHomeSize('after restoring common artifacts') } @@ -130,8 +130,8 @@ export class GradleStateCache { await this.debugReportGradleUserHomeSize('before saving common artifacts') this.deleteExcludedPaths() await Promise.all([ - new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener), - new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener) + new GradleHomeEntryExtractor(this.gradleUserHome).extract(listener) + // new ConfigurationCacheEntryExtractor(this.gradleUserHome).extract(listener) ]) await this.debugReportGradleUserHomeSize( "after extracting common artifacts (only 'caches' and 'notifications' will be stored)" diff --git a/src/cache-utils.ts b/src/cache-utils.ts index 5926013..6445ffd 100644 --- a/src/cache-utils.ts +++ b/src/cache-utils.ts @@ -9,7 +9,7 @@ import * as fs from 'fs' import {CacheEntryListener} from './cache-reporting' -const CACHE_PROTOCOL_VERSION = 'v6-' +const CACHE_PROTOCOL_VERSION = 'v7-' const JOB_CONTEXT_PARAMETER = 'workflow-job-context' const CACHE_DISABLED_PARAMETER = 'cache-disabled'