From 3f0aec69e8a4e359be07840b225773398b196541 Mon Sep 17 00:00:00 2001 From: Andrii Zinchenko Date: Tue, 11 Feb 2025 09:05:17 +0100 Subject: [PATCH] [eel-jps] IJPL-176715: BuildManager: global options folder should be transferred to the target environment GitOrigin-RevId: 41eeaaef60c095f3e60f3d43eb3cba25b7dfa30c --- .../intellij/compiler/server/BuildManager.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 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 e327767edaf1..e1790949a68a 100644 --- a/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java +++ b/java/compiler/impl/src/com/intellij/compiler/server/BuildManager.java @@ -153,6 +153,9 @@ import java.util.stream.Collectors; import static com.intellij.ide.impl.ProjectUtil.getProjectForComponent; import static com.intellij.openapi.diagnostic.InMemoryHandler.IN_MEMORY_LOGGER_ADVANCED_SETTINGS_NAME; +import static com.intellij.platform.eel.provider.EelNioBridgeServiceKt.asEelPath; +import static com.intellij.platform.eel.provider.EelProviderUtil.upgradeBlocking; +import static com.intellij.platform.eel.provider.utils.EelPathUtils.transferContentsIfNonLocal; import static org.jetbrains.jps.api.CmdlineRemoteProto.Message.ControllerMessage.ParametersMessage.TargetTypeBuildScope; public final class BuildManager implements Disposable { @@ -882,7 +885,7 @@ public final class BuildManager implements Disposable { Function pathMapper; if (canUseEel() && !EelPathUtils.isProjectLocal(project)) { - pathMapper = e -> EelNioBridgeServiceKt.asEelPath(Path.of(e)).toString(); + pathMapper = e -> asEelPath(Path.of(e)).toString(); } else { pathMapper = wslDistribution != null ? wslDistribution::getWslPath : Function.identity(); @@ -916,8 +919,18 @@ public final class BuildManager implements Disposable { future.setDone(); } else { + String optionsPath = PathManager.getOptionsPath(); + + if (canUseEel() && !EelPathUtils.isProjectLocal(project)) { + final var eel = upgradeBlocking(eelDescriptor); + optionsPath = asEelPath(transferContentsIfNonLocal(eel, Path.of(optionsPath), null)).toString(); + } + else { + optionsPath = pathMapper.apply(optionsPath); + } + final CmdlineRemoteProto.Message.ControllerMessage.GlobalSettings globals = - CmdlineRemoteProto.Message.ControllerMessage.GlobalSettings.newBuilder().setGlobalOptionsPath(pathMapper.apply(PathManager.getOptionsPath())) + CmdlineRemoteProto.Message.ControllerMessage.GlobalSettings.newBuilder().setGlobalOptionsPath(optionsPath) .build(); CmdlineRemoteProto.Message.ControllerMessage.FSEvent currentFSChanges; final ExecutorService projectTaskQueue;