Skip to content

Commit 2442dfb

Browse files
author
Kartik Raj
authored
Add logging which could help indicate why Discovering Python Interpreters... never finishes (#20792)
For #20250
1 parent e8303bb commit 2442dfb

19 files changed

+25
-12
lines changed

src/client/pythonEnvironments/base/locators/composite/envsReducer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ function checkIfFinishedAndNotify(
129129
if (state.done && state.pending === 0) {
130130
didUpdate.fire({ stage: ProgressReportStage.discoveryFinished });
131131
didUpdate.dispose();
132+
traceVerbose(`Finished with environment reducer`);
132133
}
133134
}
134135

src/client/pythonEnvironments/base/locators/composite/envsResolver.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ function checkIfFinishedAndNotify(
174174
if (state.done && state.pending === 0) {
175175
didUpdate.fire({ stage: ProgressReportStage.discoveryFinished });
176176
didUpdate.dispose();
177+
traceVerbose(`Finished with environment resolver`);
177178
}
178179
}
179180

src/client/pythonEnvironments/base/locators/lowLevel/activestateLocator.ts renamed to src/client/pythonEnvironments/base/locators/lowLevel/activeStateLocator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,6 @@ export class ActiveStateLocator extends LazyResourceBasedLocator {
4040
}
4141
}
4242
}
43+
traceVerbose(`Finished searching for active state environments`);
4344
}
4445
}

src/client/pythonEnvironments/base/locators/lowLevel/condaLocator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,6 @@ export class CondaEnvironmentLocator extends FSWatchingLocator {
3838
traceError(`Failed to process conda env: ${JSON.stringify(env)}`, ex);
3939
}
4040
}
41+
traceVerbose(`Finished searching for conda environments`);
4142
}
4243
}

src/client/pythonEnvironments/base/locators/lowLevel/customVirtualEnvLocator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export class CustomVirtualEnvironmentLocator extends FSWatchingLocator {
132132
});
133133

134134
yield* iterable(chain(envGenerators));
135+
traceVerbose(`Finished searching for custom virtual envs`);
135136
}
136137

137138
return iterator();

src/client/pythonEnvironments/base/locators/lowLevel/globalVirtualEnvronmentLocator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ export class GlobalVirtualEnvironmentLocator extends FSWatchingLocator {
134134
});
135135

136136
yield* iterable(chain(envGenerators));
137+
traceVerbose(`Finished searching for global virtual envs`);
137138
}
138139

139140
return iterator();

src/client/pythonEnvironments/base/locators/lowLevel/microsoftStoreLocator.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
isStorePythonInstalled,
1313
getMicrosoftStoreAppsRoot,
1414
} from '../../../common/environmentManagers/microsoftStoreEnv';
15+
import { traceVerbose } from '../../../../logging';
1516

1617
/**
1718
* This is a glob pattern which matches following file names:
@@ -91,6 +92,7 @@ export class MicrosoftStoreLocator extends FSWatchingLocator {
9192
kind,
9293
executablePath,
9394
}));
95+
traceVerbose(`Finished searching for windows store envs`);
9496
};
9597
return iterator(this.kind);
9698
}

src/client/pythonEnvironments/base/locators/lowLevel/poetryLocator.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class PoetryLocator extends LazyResourceBasedLocator {
7070
});
7171

7272
yield* iterable(chain(envGenerators));
73+
traceVerbose(`Finished searching for poetry envs`);
7374
}
7475

7576
return iterator(this.root);

src/client/pythonEnvironments/base/locators/lowLevel/posixKnownPathsLocator.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ import { BasicEnvInfo, IPythonEnvsIterator, Locator } from '../../locator';
88
import { commonPosixBinPaths, getPythonBinFromPosixPaths } from '../../../common/posixUtils';
99
import { isPyenvShimDir } from '../../../common/environmentManagers/pyenv';
1010
import { getOSType, OSType } from '../../../../common/utils/platform';
11-
import { isMacDefaultPythonPath } from './macDefaultLocator';
12-
import { traceError } from '../../../../logging';
11+
import { isMacDefaultPythonPath } from '../../../common/environmentManagers/macDefault';
12+
import { traceError, traceVerbose } from '../../../../logging';
1313

1414
export class PosixKnownPathsLocator extends Locator<BasicEnvInfo> {
1515
public readonly providerId = 'posixKnownPaths';
@@ -44,6 +44,7 @@ export class PosixKnownPathsLocator extends Locator<BasicEnvInfo> {
4444
traceError(`Failed to process environment: ${bin}`, ex);
4545
}
4646
}
47+
traceVerbose('Finished searching for interpreters in posix paths locator');
4748
};
4849
return iterator(this.kind);
4950
}

src/client/pythonEnvironments/base/locators/lowLevel/pyenvLocator.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { FSWatchingLocator } from './fsWatchingLocator';
77
import { getInterpreterPathFromDir } from '../../../common/commonUtils';
88
import { getSubDirs } from '../../../common/externalDependencies';
99
import { getPyenvVersionsDir } from '../../../common/environmentManagers/pyenv';
10-
import { traceError } from '../../../../logging';
10+
import { traceError, traceVerbose } from '../../../../logging';
1111

1212
/**
1313
* Gets all the pyenv environments.
@@ -33,6 +33,7 @@ async function* getPyenvEnvironments(): AsyncIterableIterator<BasicEnvInfo> {
3333
}
3434
}
3535
}
36+
traceVerbose('Finished searching for pyenv environments');
3637
}
3738

3839
export class PyenvLocator extends FSWatchingLocator {

0 commit comments

Comments
 (0)