Skip to content

Commit 0b3fabc

Browse files
committed
extension/src/goMain: skip vscgo installation on windows
And, pass `-trimpath` when building it so the executable file hash is stable. And increase the vscgo test timeout. Fixes #3182 Change-Id: Ib86bf07ddc4a89849bb778b2621268b334f3a80a Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/565679 Reviewed-by: Peter Weinberger <[email protected]> kokoro-CI: kokoro <[email protected]> Commit-Queue: Hyang-Ah Hana Kim <[email protected]> Reviewed-by: Robert Findley <[email protected]>
1 parent 9480a16 commit 0b3fabc

File tree

4 files changed

+21
-13
lines changed

4 files changed

+21
-13
lines changed

extension/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
## v0.41.1 - 22 Feb, 2024
2+
3+
This release is a point release to skip `vscgo` installation on Windows
4+
([Issue 3182](https://github.com/golang/vscode-go/issues/3182)).
5+
For a detailed list of changes, refer to the complete
6+
[commit history](https://github.com/golang/vscode-go/compare/v0.41.0...v0.41.1).
7+
18
## v0.41.0 - 14 Feb, 2024
29

310
This release introduces significant updates to the extension's UI.

extension/src/goInstallTools.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -893,7 +893,7 @@ export async function maybeInstallVSCGO(
893893
: `@v${extensionVersion}`;
894894
// build from source acquired from the module proxy if this is a non-preview version.
895895
try {
896-
const args = ['install', `${importPath}${version}`];
896+
const args = ['install', '-trimpath', `${importPath}${version}`];
897897
console.log(`installing vscgo: ${args.join(' ')}`);
898898
await execFile(getBinPath('go'), args, { cwd, env });
899899
return progPath;

extension/src/goMain.ts

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,15 +102,18 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<ExtensionA
102102
await updateGoVarsFromConfig(goCtx);
103103

104104
// for testing or development mode, always rebuild vscgo.
105-
maybeInstallVSCGO(
106-
ctx.extensionMode,
107-
ctx.extension.id,
108-
extensionInfo.version || '',
109-
ctx.extensionPath,
110-
extensionInfo.isPreview
111-
)
112-
.then((path) => telemetryReporter.setTool(path))
113-
.catch((reason) => console.error(reason));
105+
if (process.platform !== 'win32') {
106+
// skip windows until Windows Defender issue reported in golang/vscode-go#3182 can be addressed
107+
maybeInstallVSCGO(
108+
ctx.extensionMode,
109+
ctx.extension.id,
110+
extensionInfo.version || '',
111+
ctx.extensionPath,
112+
extensionInfo.isPreview
113+
)
114+
.then((path) => telemetryReporter.setTool(path))
115+
.catch((reason) => console.error(reason));
116+
}
114117

115118
const registerCommand = commands.createRegisterCommand(ctx, goCtx);
116119
registerCommand('go.languageserver.restart', commands.startLanguageServer);

extension/test/gopls/telemetry.test.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,7 @@ function testTelemetryPrompt(tc: testCase, wantPrompt: boolean) {
173173
}
174174

175175
describe('# telemetry reporter using vscgo', async function () {
176-
if (os.platform() === 'win32') {
177-
this.timeout(10000); // go install is slow on windows builder.
178-
}
176+
this.timeout(10000); // go install can be slow.
179177
// installVSCGO expects
180178
// {extensionPath}/vscgo: vscgo source code for testing.
181179
// {extensionPath}/bin: where compiled vscgo will be stored.

0 commit comments

Comments
 (0)