From c387d5039bf26884111d8cd5c9c5f557f6f37289 Mon Sep 17 00:00:00 2001 From: Alexander Koshevoy Date: Wed, 22 Oct 2025 15:04:09 +0200 Subject: [PATCH] [jps] IDEA-381056 Remove unused build option inactive since 2021.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The option was introduced as a Registry flag in `aba75dc4a9c7d6c33f8aa96a83d5505304e5e0b2` and later replaced with a system property in `63439ad1d476dda6f6d7640d3fb19f1dcc63917e` due to Fleet’s inability to access the Registry. The property is read but never set anywhere in the product or in `ultimate-teamcity-config`, so the behavior has effectively been disabled since 2021.1. This change removes the property handling and related code paths. No functional change is expected. (cherry picked from commit a06a298f8776f3e2d648176198b30d56c1fd7021) IJ-CR-179667 GitOrigin-RevId: 08e1f054ad61be423f98e0af9f97995ea5293858 --- .../compiler/server/BuildManager.java | 56 +++++++------------ 1 file changed, 20 insertions(+), 36 deletions(-) diff --git a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java index 67b36341c757..f795c25d9fee 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java @@ -19,7 +19,6 @@ import com.intellij.execution.ExecutionManager; import com.intellij.execution.process.*; import com.intellij.execution.runners.ExecutionEnvironment; import com.intellij.execution.wsl.WSLDistribution; -import com.intellij.execution.wsl.WslDistributionManager; import com.intellij.execution.wsl.WslPath; import com.intellij.execution.wsl.WslProxy; import com.intellij.ide.IdleTracker; @@ -207,43 +206,28 @@ public final class BuildManager implements Disposable { return; } - Collection systemDirs = Collections.singleton(LocalBuildCommandLineBuilder.getLocalBuildSystemDirectory().toFile()); - if (Boolean.parseBoolean(System.getProperty("compiler.build.data.clean.unused.wsl"))) { - final List distributions = WslDistributionManager.getInstance().getInstalledDistributions(); - if (!distributions.isEmpty()) { - systemDirs = new ArrayList<>(systemDirs); - for (WSLDistribution distribution : distributions) { - final Path wslSystemDir = WslBuildCommandLineBuilder.getWslBuildSystemDirectory(distribution); - if (wslSystemDir != null) { - systemDirs.add(wslSystemDir.toFile()); - } - } - } - } - - for (File buildSystemDir : systemDirs) { - File[] dirs = buildSystemDir.listFiles(pathname -> pathname.isDirectory() && !TEMP_DIR_NAME.equals(pathname.getName())); - if (dirs != null) { - Instant now = Instant.now(); - for (File buildDataProjectDir : dirs) { - File usageFile = getUsageFile(buildDataProjectDir); - if (usageFile.exists()) { - final Pair usageData = readUsageFile(usageFile); - if (usageData != null) { - final File projectFile = usageData.second; - if (projectFile != null && !projectFile.exists() || - Duration.between(usageData.first.toInstant(), now).toDays() > unusedThresholdDays) { - LOG.info("Clearing project build data because the project does not exist or was not opened for more than " + - unusedThresholdDays + - " days: " + - buildDataProjectDir); - FileUtil.delete(buildDataProjectDir); - } + File buildSystemDir = LocalBuildCommandLineBuilder.getLocalBuildSystemDirectory().toFile(); + File[] dirs = buildSystemDir.listFiles(pathname -> pathname.isDirectory() && !TEMP_DIR_NAME.equals(pathname.getName())); + if (dirs != null) { + Instant now = Instant.now(); + for (File buildDataProjectDir : dirs) { + File usageFile = getUsageFile(buildDataProjectDir); + if (usageFile.exists()) { + final Pair usageData = readUsageFile(usageFile); + if (usageData != null) { + final File projectFile = usageData.second; + if (projectFile != null && !projectFile.exists() || + Duration.between(usageData.first.toInstant(), now).toDays() > unusedThresholdDays) { + LOG.info("Clearing project build data because the project does not exist or was not opened for more than " + + unusedThresholdDays + + " days: " + + buildDataProjectDir); + FileUtil.delete(buildDataProjectDir); } } - else { - updateUsageFile(null, buildDataProjectDir); // set usage stamp to start the countdown - } + } + else { + updateUsageFile(null, buildDataProjectDir); // set usage stamp to start the countdown } } }