From 03adfecf206b361cdd9908844aeafea62eabfe98 Mon Sep 17 00:00:00 2001 From: "Ilya.Kazakevich" Date: Fri, 10 Feb 2023 22:28:51 +0000 Subject: [PATCH] DS-4370: Always upload helpers to WSL and run em there Any file access (especially ``openat(2)``) is very slow on Win11, see ``WSL/issues/9430`` Merge-request: IJ-MR-101792 Merged-by: Ilya Kazakevich GitOrigin-RevId: 524fa21d08611965bf03ae7f981be2ad12b32e49 --- .../com/intellij/execution/wsl/AbstractWslDistribution.kt | 6 ++++++ .../src/com/intellij/execution/wsl/WSLDistribution.java | 1 + .../run/target/HelpersAwareLocalTargetEnvironmentRequest.kt | 3 ++- .../run/target/HelpersAwareTargetEnvironmentRequest.kt | 5 ++++- 4 files changed, 13 insertions(+), 2 deletions(-) diff --git a/platform/execution/src/com/intellij/execution/wsl/AbstractWslDistribution.kt b/platform/execution/src/com/intellij/execution/wsl/AbstractWslDistribution.kt index e9f797aa6d21..f1211b67c0ae 100644 --- a/platform/execution/src/com/intellij/execution/wsl/AbstractWslDistribution.kt +++ b/platform/execution/src/com/intellij/execution/wsl/AbstractWslDistribution.kt @@ -51,4 +51,10 @@ interface AbstractWslDistribution { @ApiStatus.Experimental fun getUNCRootPath(): Path + /** + * Unique distrib id + */ + @get:NlsSafe + val msId: String + } \ No newline at end of file diff --git a/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java b/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java index 45b921bd4dcb..32472813a667 100644 --- a/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java +++ b/platform/platform-impl/src/com/intellij/execution/wsl/WSLDistribution.java @@ -509,6 +509,7 @@ public class WSLDistribution implements AbstractWslDistribution { return myDescriptor.getId(); } + @Override public @NotNull @NlsSafe String getMsId() { return myDescriptor.getMsId(); } diff --git a/python/src/com/jetbrains/python/run/target/HelpersAwareLocalTargetEnvironmentRequest.kt b/python/src/com/jetbrains/python/run/target/HelpersAwareLocalTargetEnvironmentRequest.kt index 072c9c179c58..839844c2ec6d 100644 --- a/python/src/com/jetbrains/python/run/target/HelpersAwareLocalTargetEnvironmentRequest.kt +++ b/python/src/com/jetbrains/python/run/target/HelpersAwareLocalTargetEnvironmentRequest.kt @@ -1,6 +1,7 @@ // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.run.target +import com.intellij.execution.target.FullPathOnTarget import com.intellij.execution.target.TargetEnvironmentRequest import com.intellij.execution.target.local.LocalTargetEnvironmentRequest import com.intellij.execution.target.value.TargetEnvironmentFunction @@ -10,5 +11,5 @@ import com.jetbrains.python.PythonHelpersLocator class HelpersAwareLocalTargetEnvironmentRequest : HelpersAwareTargetEnvironmentRequest { override val targetEnvironmentRequest: TargetEnvironmentRequest = LocalTargetEnvironmentRequest() - override fun preparePyCharmHelpers(): TargetEnvironmentFunction = constant(PythonHelpersLocator.getHelpersRoot().path) + override fun preparePyCharmHelpers(): TargetEnvironmentFunction = constant(PythonHelpersLocator.getHelpersRoot().path) } \ No newline at end of file diff --git a/python/src/com/jetbrains/python/run/target/HelpersAwareTargetEnvironmentRequest.kt b/python/src/com/jetbrains/python/run/target/HelpersAwareTargetEnvironmentRequest.kt index 1fe460aa752d..4bd3aadf94ef 100644 --- a/python/src/com/jetbrains/python/run/target/HelpersAwareTargetEnvironmentRequest.kt +++ b/python/src/com/jetbrains/python/run/target/HelpersAwareTargetEnvironmentRequest.kt @@ -1,8 +1,10 @@ // Copyright 2000-2021 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.jetbrains.python.run.target +import com.intellij.execution.target.FullPathOnTarget import com.intellij.execution.target.TargetEnvironmentRequest import com.intellij.execution.target.value.TargetEnvironmentFunction +import com.intellij.util.concurrency.annotations.RequiresBackgroundThread /** * The target request for Python interpreter configured in PyCharm on a @@ -15,5 +17,6 @@ interface HelpersAwareTargetEnvironmentRequest { * The value that could be resolved to the path to the root of PyCharm * helpers scripts. */ - fun preparePyCharmHelpers(): TargetEnvironmentFunction + @RequiresBackgroundThread + fun preparePyCharmHelpers(): TargetEnvironmentFunction } \ No newline at end of file