mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-15 11:53:49 +07:00
PY-40123 Do not try to obtain remote debugger socket for Docker and Docker Compose Python interpreters
Avoids the situation in which "Could not find docker0 network interface" error might occur during the attempt to debug a Python application. GitOrigin-RevId: 4f4c8c69f61e5dd0c6e72b0d7450772756fe5be7
This commit is contained in:
committed by
intellij-monorepo-bot
parent
322104eb3c
commit
24c0414d0e
@@ -15,10 +15,33 @@ import java.io.File;
|
||||
/**
|
||||
* Use {@link PyRemoteCommandLinePatcherKt} instead
|
||||
*/
|
||||
final class PyRemoteCommandLineStateUtil {
|
||||
public final class PyRemoteCommandLineStateUtil {
|
||||
private PyRemoteCommandLineStateUtil() {
|
||||
}
|
||||
|
||||
/**
|
||||
* Patches the debug parameters of PyCharm debugger script when it is run in
|
||||
* <i>client mode</i>.
|
||||
* <p>
|
||||
* Let's take as an example SSH Python interpreter. IDE listens for the
|
||||
* connection from the debugger script on <i>loopback</i> interface on the
|
||||
* host machine. The debugger script in this case runs on the remote machine.
|
||||
* To let the debugger script establish the connection to IDE we create
|
||||
* <i>remote port forwarding</i> from an arbitrary ephemeral port on the
|
||||
* remote machine to the port on the host machine where IDE listens for the
|
||||
* connection. This ephemeral port and <i>localhost</i> address is used
|
||||
* to patch the parameters of the debugger script to let it instantiate the
|
||||
* connection.
|
||||
*
|
||||
* @param helpersPath the path to PyCharm helpers directory on the
|
||||
* target machine
|
||||
* @param remoteSocketProvider the provider that allows to establish a
|
||||
* connection from the debugger process that
|
||||
* might run on a remote machine (including
|
||||
* virtual ones) and IDE
|
||||
* @param debugParams the debug parameters group of the script
|
||||
* @throws RemoteSdkException
|
||||
*/
|
||||
static void patchDebugParams(@NotNull String helpersPath,
|
||||
@NotNull PyRemoteSocketToLocalHostProvider remoteSocketProvider,
|
||||
@NotNull ParamsGroup debugParams)
|
||||
@@ -39,11 +62,11 @@ final class PyRemoteCommandLineStateUtil {
|
||||
.set(PyDebugRunner.findIndex(debugParams.getParameters(), PyDebugRunner.PORT_PARAM), Integer.toString(socket.getSecond()));
|
||||
}
|
||||
|
||||
static void patchProfileParams(@NotNull String interpreterPath,
|
||||
@NotNull PyRemoteSocketToLocalHostProvider remoteSocketProvider,
|
||||
@NotNull ParamsGroup profileParams,
|
||||
@Nullable File workDirectory,
|
||||
@NotNull PathMapper pathMapper)
|
||||
public static void patchProfileParams(@NotNull String interpreterPath,
|
||||
@NotNull PyRemoteSocketToLocalHostProvider remoteSocketProvider,
|
||||
@NotNull ParamsGroup profileParams,
|
||||
@Nullable File workDirectory,
|
||||
@NotNull PathMapper pathMapper)
|
||||
throws RemoteSdkException {
|
||||
PyCommandLineStateUtil.remapParameters(interpreterPath, pathMapper, profileParams, workDirectory);
|
||||
|
||||
@@ -58,11 +81,10 @@ final class PyRemoteCommandLineStateUtil {
|
||||
.set(2, Integer.toString(socket.getSecond()));
|
||||
}
|
||||
|
||||
static void patchCoverageParams(@NotNull String interpreterPath,
|
||||
@NotNull ParamsGroup coverageParams,
|
||||
@Nullable File workDirectory,
|
||||
@NotNull PathMapper pathMapper)
|
||||
throws RemoteSdkException {
|
||||
public static void patchCoverageParams(@NotNull String interpreterPath,
|
||||
@NotNull ParamsGroup coverageParams,
|
||||
@Nullable File workDirectory,
|
||||
@NotNull PathMapper pathMapper) {
|
||||
|
||||
PyCommandLineStateUtil.remapParameters(interpreterPath, pathMapper, coverageParams, workDirectory);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user