dependencies downloader: include extraction code version into cache directory name

Consider the following situation on Windows:
- jps-boostrap script with older extract code version downloads, extracts, runs JBR with other code
- this other code also downloads the same JBR version and tries to delete extract directory because of version mismatch
- fails to do so due to locked files
- now cache directory is in inconsistent state

GitOrigin-RevId: 97f391b7b8ee623cfcdb958eaae277687b33527e
This commit is contained in:
Leonid Shalupov
2024-10-11 20:32:58 +04:00
committed by intellij-monorepo-bot
parent 96b8929d41
commit fa36670220

View File

@@ -127,7 +127,7 @@ object BuildDependenciesDownloader {
vararg options: BuildDependenciesExtractOptions): Path {
cleanUpIfRequired(communityRoot)
val cachePath = getDownloadCachePath(communityRoot)
val hash = hashString(archiveFile.toString() + getExtractOptionsShortString(options)).substring(0, 6)
val hash = hashString(archiveFile.toString() + getExtractOptionsShortString(options) + EXTRACT_CODE_VERSION).substring(0, 6)
val directoryName = "${archiveFile.fileName}.${hash}.d"
val targetDirectory = cachePath.resolve(directoryName)
val flagFile = cachePath.resolve("${directoryName}.flag")